Activity › Forums › Adobe After Effects Expressions › slider to change parent null?
-
slider to change parent null?
Posted by Bart Stevens on May 3, 2013 at 9:55 pmI have a null child layer that linked to a parent null’s position.
I want to change the null parent via a slider.
I know this has got to be pretty straight forward, but my language skills with expressions is very limited.
My null parents are named with numbers 1,2,etc…
Any info will help
ThanksMike Williams replied 12 years, 8 months ago 3 Members · 7 Replies -
7 Replies
-
Dan Ebberts
May 3, 2013 at 10:35 pmIf you’re talking about grabbing the position of another layer based on the value of a slider, I guess something like this would work:
s = effect(“Slider Control”)(“Slider”).value;
thisComp.layer(s.toFixed(0)).transform.positionBut when you change the slider, the layer will jump to the new parent. Is that what you want?
Dan
-
Bart Stevens
May 3, 2013 at 11:03 pmYes, that’s what I’m trying to do. Thanks!
Still struggling with the exact language.
Expression is not recognizing my “Slider Control”.
I haven’t changed the slider name, how should I set up the expression so it recognizes the slider?
I apologize for the rudimentary questions.
I appreciate the help.
-Bart -
Dan Ebberts
May 3, 2013 at 11:07 pmIf you apply the Slider to the layer with the expression, you shouldn’t have to change anything. If you have it applied to a different layer (say a layer named “controls”), it would be like this:
s = thisComp.layer(“controls”).effect(“Slider Control”)(“Slider”).value;
thisComp.layer(s.toFixed(0)).transform.positionDan
-
Mike Williams
September 8, 2013 at 3:31 pmHello Dan,
Ive been looking everywhere to answer a certain question, and this thread is the closest I could find. Maybe you can help me out…
Quick setup:
I am trying to animate a hand/arm pulling a playing card from a deck, then throwing it across a table. I have the card parented to the hand as it pulls it from the deck, but I want to animate the position of the card (to slide from hand, across the table) without it being parented to anything at all.I am wondering if there is a way to “toggle” the parenting of a layer on/off. Basically, to have a single layer go from having a parent of “hand” at frame A, to having NO parent at frame B.
The work-around I am using now is to have a duplicate of the card layer which has not parent, and to cut from one to the other in the timeline. This works, but is very cumbersome and results in a lot of layers and a messy workflow.
Any help would be awesome! Thanks!
-
Dan Ebberts
September 8, 2013 at 4:10 pmThe only thing I can think of that might work (short of splitting the layer) would be to simulate the parenting with expressions on the card’s position and orientation properties, which you would set up to follow a null that was parented to the hand (so I guess that doesn’t help much in the layer count). You would use something (layer marker?) to signal the end of the “parenting” and from then on the expressions would animate from the hand null’s position/orientation at the release time to the final destination. The whole thing would be somewhat messy, but do-able, I think.
Dan
-
Mike Williams
September 8, 2013 at 5:08 pmThanks for the fast response!
I ended up just splitting the layers, which, while inelegant, got the job done. Thanks a lot for your help tho!
-Mike
Reply to this Discussion! Login or Sign Up