Copy link to clipboard
Copied
Hey all,
I am wondering if anyone can help with an expression that will move the position of one layer( character's arm) to a SPECIFIC spot when the time remap position of another layer (the body) is at a particular frame.
So the body of the character is a pre-comp that has been time remapped. When the time remap is at 0000 the body is straight ahead. When the time remap is at 0001, the body has turned 45 degrees to the left. At 00002, the body has turned 90 degrees to the left and so on. All up the body has 8 different positions.
I am trying to find an expression that will move the anchor point position of the two ARM layers (i.e. the shoulder) automatically to a predetermined position. So for example, when time remap of BODY layer is 0001, the X,Y position of the LEFT ARM layer is, say, 400.0, 612.0 and the RIGHT ARM layer is, say, 200.0, 300.0
I hope this makes sense.
Thanks!
Rob ![]()
Copy link to clipboard
Copied
You create arrays and associate their values via the array index with a linear() function.
mFrames=timeToFrames(comp("XYZ").layer("ABC").timeRemap.value);
mPositions=[[20,500],[350,600]];
mIndex=linear(mFrames,0,mPositions.length);
mPositions[mIndex]
Mylenium
Copy link to clipboard
Copied
Thanks for getting back to me Mylenium. Really appreciate it!
Afraid to say I am not familiar with arrays. (Expressions in general are a bit of a mystery to me!)
Is the above expression what you would paste into the position of the arm layer? And is there a corresponding expression I would need to type into the time remap of the body layer?
Rob ![]()
Copy link to clipboard
Copied
You only need an expression for the arm(s). Expressions on different properties do not interact in any form beyond retrieving the value of another property by referencing it. Simply insert your value pairs in the mPositions variable as illustrated. You can have as many as you like as long as they correspond to your actual time-remapping frames.
Mylenium
Find more inspiration, events, and resources on the new Adobe Community
Explore Now