Activity › Forums › Adobe After Effects › Child-Parent linking – how to avoid inheriting rotation?
-
Child-Parent linking – how to avoid inheriting rotation?
Posted by Michael Cosner on October 28, 2009 at 8:55 pmHey All,
I’ve got two layers in which I want the child to accept the position and scale values of the parent but *not* the rotation (to keep the orientation of the child level). Is there a simple way to do this? It’s a trivial thing to do in 3D but I’ve never found a need to replicate it in After Effects until now. Thanks for any thoughts or advice.Cheers,
MichaelMagdalena Olchawska replied 6 years, 5 months ago 7 Members · 10 Replies -
10 Replies
-
Dan Ebberts
October 28, 2009 at 9:18 pmIt sounds like you need a counter-rotation expression for the child, like this:
value – parent.transform.rotation
The child’s world postion will still be affected by the parent’s rotation, but it will retain it’s world orientation.
Dan
-
Michael Cosner
October 28, 2009 at 10:30 pmPerfect, Dan. Works like a champ. Thanks for the mental nudge.
Cheers,
Michael -
Kala Rackley
April 1, 2012 at 8:55 pmI know that this is an old thread, but I figured instead of starting a new one, I would just tag on!
I am trying to keep a pedal rotating with a bike gear, but still face upward so that the foot can rest on it. I am getting ready to dive into Duik or Dan’s IK expressions for the legs, and I have all of the wheels and gears going nicely with Carl Larsen’s Vehicle Rig expressions.
However, I cannot get the pedals to stay upright! I have tried this expression you suggested: “value – parent.transform.rotation;”. I am unsure exactly where to put it though. Rotation? Position? I have a null that is parented to the pedal “bar”, which is parented to the gear. The pedals are parented to the nulls.
Help? Thank you!
-
Dan Ebberts
April 1, 2012 at 11:51 pmThere is probably more than one way to do it, but if it’s the gear that’s actually rotating, I’d apply this to the pedal:
value – thisComp.layer(“Gear”).transform.rotation;
Or, from your description, something like this should work:
value – parent.parent.parent.transform.rotation;
Dan
-
Kala Rackley
April 2, 2012 at 1:42 amDan,
I’m glad that it was you that responded! I’ve been reading your answers to other questions re: expressions, and it has been helpful. Thank you.
Can you please tell me where to add the expression? Under position or rotation? And under the Child object (pedal), right?
Thanks again!
-
Kala Rackley
April 2, 2012 at 1:46 amHoly smokes. You got it. I’ve been trying to figure out which suggestion would work for hours!
For anyone else landing on this thread, I used
value – parent.parent.parent.transform.rotation;and I placed it as an expression under Rotation for the Child layer.
Thanks again Dan!
-
Dylan Byrne
January 15, 2016 at 10:36 amHello! I’m tagging onto this post too, hope that’s ok.
So I’ve been trying to use this expression but I’m having problems. Here’s my situation:
I am making a fake hand puppet in AE, it is doing a running sequence (loop).
I have a torso, that rotates up and down as it runs, connected to that I have two upper arms that rotate and then two fore arms with hands that also rotate.
What I want to do is attach my fake puppet strings to the forearms to make it look like they are controlling the arms – basically they are vertical strings that I want to follow the position of the forearms but not the rotation of them or any of the other parents.
Looked at simply I have
Parent 1 rotating (torso) > Parent 2 rotating (upper arms) > Parent 3 rotating (Forearms) > Child – not rotating (strings)
What seems to happen when I use this expression is it removes the immediate parent’s rotation but then inherits the rotation from the parent above it. Any thoughts? I hope this is clear enough 😉
thanks a lot!
Dylan
-
Jim Perry
December 22, 2016 at 3:09 pmThanks for this tip. I tried it and it worked for me. Thanks for passing along the knowledge.
-
Vera Steinbeck
March 4, 2019 at 2:15 pmhi there
i had the same question with 3d layers right now and adapted it like this:value – parent.transform.yRotation
in child Y-Rotation(or value – parent.transform.xRotation or value – parent.transform.zRotation)
-
Magdalena Olchawska
December 19, 2019 at 4:33 pmHi, can anyone help out this expression is not working for me unfortunately… I’m very much a beginner in expressions so this is killing me.
I have a main parent that controls rotation of 4 children. And then each of the children has one more child. So what I want to do is have the children NOT inheriting the rotation from the main parent…
How would I go about that? Thanks in advance!
Magda
Reply to this Discussion! Login or Sign Up