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
  • 2032 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....

Community Expert
June 13, 2023

I have presets that create arcs, sign waves, bounces, and a bunch of other things. I just gave a simple example. I also have motion expressions that use mask paths on the same layer to move the layer around. All of mine use layer in and out points because I find that easier to work with than dragging markers. Move of them have Expression Controls like point, rotitatiion, slider, and checkbox controlls included. 

 

It will take a minute to come up with an expression that takes a starting point, sets and angle, then controls the arc and the speed, but it can be done. I just don't have time to do that right now. 

 

You can also take any layer that has existing keyframes and use the time of those keyframes and the time of the markers to set the timing. Personally, I think it's easier to move keyframes than it is to move markers, I also pre-compose and use time remapping a lot to adjust the timing of many of my automated moves.

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