-
Control position and scale from another comp
Hello everyone,
In a script, I am trying to have multiple layers (let’s call them “MaskedLayers”)in a comp (“PreComp”) masked by a layer(“MasterLayer”) in PreComp’s parent comp(“MasterComp”).
There will be multiple preComps in MasterComp.
PreComps won’t be the same size.
PreComp and MasterComp won’t be the same size.
PreComps have to be able to move, rotate and scale like any normal layer, without altering the masking continuity…I copied an instance of MasterLayer above each maskedLayer in PreComp, linked them to a null (“PreCompNull”)set Alpha matte.
Now, I am trying to drive PreCompNull with MasterLayer, regardless of PreComp’s original pos, rot and scale as well as their changing over time.I’ve managed to have the position part solved, regardless of PreComps original and time varying positions, but as soon as PreComp’s scale or rotation are altered, the masking continuity breaks…
I tried different things in scale, but it goes pretty crazy ???? Haven’t tried anything on rotation yet.Here’s the logic of the expression I put in PreCompNull’s position :
var MasterLayer = comp(“MasterComp”).layer(“MasterLayer”);
var PreCompLayer = comp(“MasterComp”).layer(“PreComp”);
var MaskedLayer = thisComp.layer(“MaskedLayer”);
a = MasterLayer.transform.position;
b = PreCompLayer .transform.position;
c = b – a;
d = MaskedLayer.transform.position;
d – c;Thanks in advance for any help !
Cheers !