-
Expression to index Position on previous Shape group layer
Hi Everyone,
I wanted to say thank you in advance for all the knowledge you guys are sharing here.
I’m trying to index the Position (only Y axis) from a previous shape layer Group and apply that expression on all the other shape group Position so I only have to animate one layer once.
What I try to achieve is a pile of book falling on the ground, the idea is to animate the first book falling and index the other to follow with a delay. X Position doesn’t change.
I manage to do it on another more simple shape group but now I have a way more complex set and I’m completely lost with the Shape subgroup index.
So I manage to do it with this expression but on a simpler shape group (Contents > 4x group) :
“var thisPropGrpIndex = thisProperty.propertyGroup(2).propertyIndex;
y = thisLayer(“Contents”)(thisPropGrpIndex+1)(“Transform”)(“Position”).valueAtTime(time-0.2)[1];
x = value[0];
[x, y-8];”
The Y-8 is to offset them otherwise they pile up on each other.
But now I have a way more complex Shape layer that have 8 main group, 19 sub group. I tried this expression but I can’t get the second book to move :
“var thisPropGrpIndex = thisProperty.propertyGroup(3).propertyIndex;
y = content(“Group 8”).content(“Group 75”).transform.position.valueAtTime(time-0.2)[1];
x = value[0];
[x, y];”
My apologies it is a messy expression, not yet there when it comes to expressions.
Any idea?
Thank you for you help and time in advance.