Skip to main content
Known Participant
March 8, 2024
Question

Lock layer's position on timeline

  • March 8, 2024
  • 1 reply
  • 1343 views

I want to know if it is possible to lock only a layer's position on the timeline (so it is still editable for all it's other attributes)
I am working and keep accidentally selecting objects on the timeline and dragging them when I don't mean to. I am doing a lot of attribute animating and need to regularly switch between selections. It would be helpful to simply lock all layer's locations on the timeline so I can't accidentally move them.

I am often selecting via the timeline rather than the left of the timeline cuz I can visually see the elements I am looking for better by where they start and end on the timeline.

 

All help appreciated! 🙂

This topic has been closed for replies.

1 reply

Warren Heaton
Community Expert
Community Expert
March 8, 2024

It would be great if the Position property had a lock switch of it's own.

 

You could use an expression to set the Layer's position.

 

Select the Position property and the choose Animation > Add Expression.

Replace "transform.position" with the following:

// Set the X and Y position

xPosition = 300; // Replace this value with your desired X position

yPosition = 300; // Replace this value with your desired Y position

// Apply the new position

[xPosition, yPosition];

 

If the Position needs to animate, you could link the xPosition and yPosition to Slider Controls (Effect > Expression Controls > Slider Control).  That may limit you to linear spatical keyframe interpolation, though.  Someone better at scripting may have a more flexible suggestion if the layer needs to animate with Bezier, Continuous Bezier, or Auto-Bezier spatail interpolation.

 

Known Participant
March 8, 2024

I think you misunderstood. I'm not talking about the layer's position in a composition, I'm talking about its position on the timeline.

Warren Heaton
Community Expert
Community Expert
March 8, 2024

Do you mean the Layer Time Span?

If the Lock switch isn't doing what you are looking for, try enabling the Shy Layer switch for the Layer and then then enable the Hide Shy Layers Composition Switch.  While hidden in the Timeline, you will not be able to select the Layer Time Span and move it on accident.