FORUMS: list search recent posts

Issue with animated parents

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bryan Woods
Issue with animated parents
on Mar 29, 2016 at 5:45:48 pm

Hey there, I'm working on writing an expression to animate parents between layers and I have an issue I'm not understanding.

Scenario:
Two layers, child and a parent. My expression is going into the position value of the child. Child has a check box and a layer control drop down.

Issue:
with my current code (pasted below), things are working well, but I have one small issue. I can animate the code to work when its checked on, but once I do that, the child snaps to the position of the parent, wherever it happens to be, instead of moving with the parent regardless of where it initially started. I'm guessing I have to calculate the position at the current time for the parent or something, but not sure how to go about doing that.

I'm sure this has been posted before, so if its easier to direct me to a previous thread, please do. Thanks!

myParent = effect("Layer Control")("Layer");
myProp = myParent.transform.position;
boole = effect("Checkbox Control")("Checkbox");

if(boole==1){
value + (myProp.value - myProp.valueAtTime(0));
}else{
value;
}


Return to posts index

Dan Ebberts
Re: Issue with animated parents
on Mar 29, 2016 at 6:29:11 pm

I'm not exactly sure what you're trying to do, but if you want to animate the checkbox so that the child follows the parent when the box is checked and holds its position when the checkbox is off, your expression will need to look at all previous checkbox keyframes and add up the total distance the parent traveled for all previous segments where the check box was on. Then, if the checkbox is currently on, add the amount of travel so far for the current segment. Definitely do-able, but a bit of work.

Dan



Return to posts index

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