ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Slider Expression to Control Influence of Parent.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dustin Bowser
Slider Expression to Control Influence of Parent.
on Sep 1, 2015 at 5:57:48 pm

I believe I've come across this before in the past, but can't seem to find it anywhere at the moment.

I have something that is tracked to a piece a footage, via parenting to a Null. What I would like to do is be able to animate a slider to lessen the influence of the parenting until the layer is not being tracked at all.

Thanks for any help!


Return to posts index

Dan Ebberts
Re: Slider Expression to Control Influence of Parent.
on Sep 1, 2015 at 10:41:45 pm

What determines the layer's position when the influence slider is at zero? Are you just talking about position?

Dan



Return to posts index

Dustin Bowser
Re: Slider Expression to Control Influence of Parent.
on Sep 1, 2015 at 10:53:27 pm

Basically I want something to go from being tracked, all the way to not being tracked.

What I'm doing is placing a composite element within a shot that morphs to something from within the plate itself, so at first it needs to be tracked in, but then when the morph happens it needs just be exactly as the underlying plate is with no added animation, but I have to hand between these two moments seamlessly

The tracking data is position, scale, and rotation.


Return to posts index


Dave Docimo
Re: Slider Expression to Control Influence of Parent.
on Oct 2, 2015 at 3:21:43 am

I have the exact some problem as Dustin. Hopefully there is a solution out there.


Return to posts index

James Paulley
Re: Slider Expression to Control Influence of Parent.
on Apr 24, 2018 at 3:41:54 pm

Did anyone ver get anywhere with this?


Return to posts index

Dan Ebberts
Re: Slider Expression to Control Influence of Parent.
on Apr 24, 2018 at 7:27:45 pm
Last Edited By Dan Ebberts on Apr 24, 2018 at 7:32:10 pm

It's tricky because, if I understand the question, you want the parented layer to keep any accumulated movement that was based on previous values of the slider. If that's the case, the only way I can think of is a brute force, frame-by-frame integration, something like this:


pos = thisComp.layer("leader").transform.position;
pct = effect("Slider Control")("Slider");
dAccum = 0;
f = timeToFrames(time);
for (i = 1; i <= f; i++){
t = framesToTime(i);
cPct = pct.valueAtTime(t)/100;
dAccum += (pos.valueAtTime(t) - pos.valueAtTime(t-thisComp.frameDuration))*cPct;
}


It could get bogged down if your comp goes on for quite a while.


Dan



Return to posts index


Andy Engelkemier
Re: Slider Expression to Control Influence of Parent.
on Apr 1, 2020 at 6:54:50 pm

Wouldn't it be simpler to create extra objects to accomplish this? Null1 is the LocRotScale of the track. Null2 is has another set. An expression would tell a 3rd object how much influence Null1 vs Null2 there would be.
This is actually what I'm looking for right now. I know things like it exist as plugins being related to IK, but I'm looking for something more simple than that.
Rather than splitting a bunch of layers and reparenting the second group, I'd like to just parent them all to a null that switches parent influence. it s so many less layers. lol

This is common for IK animation. Putting a hand on an object while a character moves, or throwing and catching a ball from one hand to another are both classic examples of parent influence. The ball has to be parented to Both hands, but you animate the influence. In that case, you would have the influence on/off, rather than animating it though. But you get the idea.


Return to posts index

Kalleheikki Kannisto
Re: Slider Expression to Control Influence of Parent.
on Apr 29, 2018 at 2:33:32 pm

It seems to me that you should be able to fade between the position, scale and rotation properties of two nulls with ease using a slider to control the balance. That would give you the position, scale and rotation of a third null, to which you would have parented the layer of choice.

In other words, you'd create the tracked null and a manually animated approximation of the same motion that ends up in the final location that you desire. And then fade the motion between the two with a simple percentage calculation attached to the third null values.

That is, if I pictured your objective correctly.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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