ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Storing position, replacing comp, then setting comp to original position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael Holmes
Storing position, replacing comp, then setting comp to original position
on Sep 17, 2019 at 3:07:44 pm

I am writing a jsx that will bring in all my new footage that I just imported and replace the current footage with it. This is so everything will be animated with the new footage.

My script works for replacing the footage, but the problem is position. It replacing things all misaligned.

My solution would be to store the old comp's layer position in a variable and then when the new footage is added, set the new fooage to the old comp's layer position. BUT the syntax I'm using doesn't seem to be correct. It runs but doesn't seem to add the right values.

What's wrong here?

var positionValues = copyToComp.layer(13).property("Position").value;
copyToComp.layer(13).replaceSource(copyFromComp.layer(13).source,false);
copyToComp.layer(13).property("Position").setValue([positionValues[0],positionValues[1],positionValues[2]]);


Return to posts index

Michael Holmes
Re: Storing position, replacing comp, then setting comp to original position
on Sep 18, 2019 at 1:01:44 pm

Nevermind, the problem was actually my logic. I was trying to match the position of the original comp when I should be trying to keep the position of the imported comp.


Return to posts index

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