Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Expression that links layer A position to layer B time remap frame number

New Here ,
May 31, 2016 May 31, 2016

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

TOPICS
Expressions
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2016 May 31, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2016 Jun 01, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 01, 2016 Jun 01, 2016
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines