Skip to main content
Inspiring
June 13, 2023
Answered

A way to bind a layer's transformation property key to a layer marker.

  • June 13, 2023
  • 2 replies
  • 2031 views

Hi all.

If there is a way to bind a property key in a layer transformation to a layer marker, so that when the position of the layer marker changes, the position of the layer transformation key changes? Too lazy to open the transformation properties, to move the position of the keys, I would like to do this using layer markers...

This topic has been closed for replies.
Correct answer AnyON

Perhaps all this is redundant. You can select the required layers, press the "P" button, and edit the tangent paths. And layer markers are not required here. I'm trying to write a big script, and I'm looking at this task from this angle. And here everything is much simpler. Sorry...


Yes, thanks Dan, your version works

2 replies

Community Expert
June 13, 2023

You can use an expression to look at the time of two markers and then use a linear expression and a defined start and end point for the move. 

 

This expression will start any layer on the left side of the screen and move it on a straight line in X to the position where you want the layer to end up. 

 

sFix = ([100, 100] - scale) /100;
lyr = sourceRectAtTime();
w = lyr.width + lyr.left;
h = lyr.height;
t = time;
// find two markers and create a move
if (marker.numKeys == 2){
	st = marker.key(1).time;
	et = marker.key(2).time;
	sp = [- w, value[1]] + [w * sFix[0], 0];
	ep = value;
	ease(t, st, et, sp, ep);
	}
else{
	value
}

 

The expression compensates for scale, will work with text layers no matter the paragraph justification, and will work with any footage or solid layers if the anchor point is centered. If your shape layers have a stroke, you'll have to compensate for the stroke in the sp property.

 

I have many of these expressions saved as animation presets, but they are mostly based on the layer in and out points instead of markers. The expressions allow me to create slide shows and explainer graphics by choosing the move I want, setting layer in and out points, and positioning the layers where they need to rest. Here's one that I use a lot that will fly a layer in from the left side of the screen and bounce it to a stop. The timing is based on Sliders. The resting position depends on where the layer is before you apply the preset. 

https://www.dropbox.com/s/tewk9s88mpkmnou/flyInBounceDropOut.ffx?dl=0

Download the preset, position a layer where you want it to land, then use the Animation Menu to apply the preset. 

AnyONAuthor
Inspiring
June 13, 2023

Thank you for your attention to my question. The example code pointed out by Rick Gerard is quite famous. When writing it, the ability to control the tangents of the object's trajectory is lost. I asked this question in hopes of retaining the ability to control the tangent paths of many objects in the scene....

AnyONAuthor
Inspiring
June 13, 2023

You can sometimes maintain your spatial and temporal easing by using valueAtTime() to remap the timing based on where the markers are (in time) relative to where the keyframes are. It would help if you had a very specific example of what you're trying to do.


Here is an example.

https://drive.google.com/file/d/1zOkE2s1Ers_SwLifJsAJr5xrAI67eKw-/view?usp=sharing

There can be much more layers in the composition. The start and end times of movement for each layer are not the same. But at the same time, I would like to introduce diversity in the trajectory of the movement of each layer. In my opinion, it would be best to do it with the help of tangents.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Tried to drag a video to the chat page, and I get a message: You don't have permission to upload a video.???

Mathias Moehl
Community Expert
Community Expert
June 13, 2023

There is no direct way to link keyframes to markers. As a workaround, you could write some expressions, which time-remap the transform properties based on the marker position. That would mean the keyframes stay in place, but the expression, which acts on top of the keyframes would sample the property value from different time points if you move the marker.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects