FORUMS: list search recent posts

Keyframing Parenting

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Francois Germain
Keyframing Parenting
on Mar 13, 2015 at 8:54:29 pm
Last Edited By Francois Germain on Mar 16, 2015 at 1:31:37 pm

Hi guys. I've look if it was possible to keyframe parenting. Actually, it doesn't need to be a real parenting link beetween 2 objects. Just act like it. In fact I just need a position link. So I made that expression but there's a glitch. It triggers parenting but when I turn it off, the child gets back to it's original position.

So here's how it works:
the child layer has a checkbox expression control.
the expression is in the transform.position

i guess the solution is in the last 2 lines, but I can't find it.

thanks

newPos=transform.position;

objetA=thisComp.layer("Master");
objetB=thisLayer;



if (objetB.effect("Checkbox Control")("Checkbox")==true) {

if (objetA.transform.position[0]>objetB.transform.position[0])
{ Xsign=-1}
else
{Xsign=1}
if (objetA.transform.position[1]>objetB.transform.position[1])
{ Ysign=-1}
else
{Ysign=1}

t1=objetB.effect("Checkbox Control")("Checkbox").key(2).time;
lockOn=valueAtTime(t1);


distX=length(objetA.transform.position.valueAtTime(t1)[0],objetB.transform.position.valueAtTime(t1)[1]);
distY=length(objetA.transform.position.valueAtTime(t1)[1],objetB.transform.position.valueAtTime(t1)[1]);


newPosX=objetA.transform.position[0]+(distX*Xsign);
newPosY=objetA.transform.position[1]+(distY*Ysign);
newPos=[newPosX,newPosY];
newPos

}else{
if (time&lt;=0){
newPos=transform.position}
else{

PositionPause=objetB.transform.position.valueAtTime(time);
newPos=PositionPause;}
}


Return to posts index

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