ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression for Blending Position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Walczak
Expression for Blending Position
on Oct 19, 2011 at 4:37:09 pm

Hi everyone!

I'm wondering if there's an expression that will allow me to blend between two positional inputs. For instance, in Cinema4D, there is an XPresso node called "Mix" that receives two inputs and allows the user to blend between the two. I've used it for "keyframable parenting" in the past, so it can be extremely handy!

Is there anything like this for AE? If I haven't done the best job of explaining it, please let me know and I would be more than happy to elaborate.

Thank you!

http://vimeo.com/explosivegraffix


Return to posts index

Dan Ebberts
Re: Expression for Blending Position
on Oct 19, 2011 at 6:09:50 pm

I'm sure if this is what you're after, but this expression would give you a position somewhere on the line between Layer 1 and Layer 2, depending on the value (0-100)of a slider on the layer with the expression.

s = effect("Slider Control")("Slider");
p1 = thisComp.layer("Layer 1").transform.position;
p2 = thisComp.layer("Layer 2").transform.position;
linear(s/100,p1,p2)


Dan



Return to posts index

Mark Walczak
Re: Expression for Blending Position
on Oct 19, 2011 at 7:45:50 pm

Dan,

This is EXACTLY what I needed! I knew you'd come through for this one (as always)!

Thank you so much!

http://vimeo.com/explosivegraffix


Return to posts index


Mark Walczak
Re: Expression for Blending Position
on Oct 19, 2011 at 7:47:56 pm

PS - If I wanted to go uber-crazy with this, could I put your ToComp expression in the place of p1 or p2 and simply link the target layers to the first line in the ToComp code?

Thanks!

c=this_comp.layer("child");
c.to_comp(c.anchor_point)


http://vimeo.com/explosivegraffix


Return to posts index

Dan Ebberts
Re: Expression for Blending Position
on Oct 19, 2011 at 8:10:41 pm

Sure. I think I'd do it like this:

s = effect("Slider Control")("Slider");
L1 = thisComp.layer("Layer 1");
p1 = L1.toComp(L1.anchorPoint);
L2 = thisComp.layer("Layer 2");
p2 = L2.toComp(L2.anchorPoint);
linear(s/100,p1,p2)



Dan



Return to posts index

John Smith
Re: Expression for Blending Position
on Nov 23, 2017 at 5:43:30 am

hey Dan Can it be shape layer Path instead of position?


Return to posts index


Dan Ebberts
Re: Expression for Blending Position
on Nov 23, 2017 at 5:18:18 pm

I'm guessing you might be talking about something like this, but it only works if you have CC 2018:

s = effect("Slider Control")("Slider").value/100;
L = thisComp.layer("Shape Layer 1");
p = L.content("Shape 1").content("Path 1").path;
L.toComp(p.pointOnPath(s,time))


Dan



Return to posts index

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