ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Jumping to a specific frame inside precomp when hitting specific position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Saara Salminen
Jumping to a specific frame inside precomp when hitting specific position
on Jan 17, 2019 at 8:33:43 pm

Hi!
I wish to achieve an expression of the following:

When the x-position of current layer hits the x-position of layer "Layer2" (the position values are not separated on either layer, if that matters somehow), the time inside a precomp ("Precomp1") jumps to a specific frame, like frame 30 for example.

I'm not too familiar with expressions, and this is probably pretty basic, but I'd appreciate any help I can get.

Thanks in advance,
Saara


Return to posts index

Griffin Englander
Re: Jumping to a specific frame inside precomp when hitting specific position
on Jan 17, 2019 at 11:28:12 pm

Assuming you only want the frame to be frozen when the positions match.. I think this works.

a = thisComp.layer("Layer2").transform.position[0];
b = thisLayer.transform.position[0];
v = framesToTime(30);
if (a==b) v else value;


Return to posts index

Griffin Englander
Re: Jumping to a specific frame inside precomp when hitting specific position
on Jan 17, 2019 at 11:29:09 pm

Sorry, that expression should go on TimeRemap on your PreComp.


Return to posts index


Saara Salminen
Re: Jumping to a specific frame inside precomp when hitting specific position
on Jan 21, 2019 at 6:52:44 pm

This works perfectly, and also makes sense. Thank you very much!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]