Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Slider Control Expression w/ Precomps Breaks

  • Slider Control Expression w/ Precomps Breaks

    Posted by Ace Billet on June 7, 2017 at 9:27 pm

    Working on CC17. I have a project with revolving assets.
    I need to render out 20 instances with changing images, which are precomped .
    I wanted to have a slider control in the master comp – Feed the slider a number which corresponds to the image layer number.
    This will toggle the opacity, saving me the need to drill down each render, and turn layers on and off.

    The problem: After each render something breaks, and changing value on the slider doesn’t work.

    The hierarchy:
    Comp3 (deepest) – 20 layers, each has this expression on its opacity property:
    xx = comp("Comp1").layer("PlayerControl").effect("PlayerLayer")("Slider")
    if (index == Math.round(xx)) 100 else 0

    Comp2 – the layer from comp3, multiplied and effected.
    Lives inside Comp1. No expressions in it.

    Comp1 – Master comp, where I render out and the slider lives.
    The slider has this expression on it: locks it to integers and limiting the values to the number of layers.
    Slider layer is “PlayerControl” and the effect is named “PlayerLayer”.
    Math.floor(value);
    clamp(value,1,20)

    I also added a guide text layer to display the name of the chosen image.
    I applied this to the Source Text property:
    p1 = thisComp.layer("PlayerControl").effect("PlayerLayer")("Slider").value;
    comp("Comp3").layer(p1).name;

    Again, the expressions work great until render. If I change something in Comp3’s layers opacity expression,
    like change the name of the variable from “xx” to “zz” it works again, but only until the next render.

    I recreated the project on another system, on CC14. This works great and doesn’t break.
    Here’s the project file:
    https://www.dropbox.com/s/4ayyypaamrvonoq/Slider.aep.zip?dl=0

    Any help would be appreciated.

    <== BilletHQ | Creative that Goes to 11 ==>
    https://www.egg-factory.com

    Ace Billet replied 9 years, 2 months ago 2 Members · 7 Replies
  • 7 Replies
  • Ace Billet

    June 7, 2017 at 11:04 pm

    Out of frustration I created this explainer graphic…

    <== BilletHQ | Creative that Goes to 11 ==>
    https://www.egg-factory.com

  • Dan Ebberts

    June 7, 2017 at 11:34 pm

    I don’t know if this is the issue, but I don’t think your slider expression is doing what you want it to. It should be more like this:

    Math.floor(clamp(value,1,11));

    Dan

  • Ace Billet

    June 8, 2017 at 2:04 pm

    Thanks Dan. I changed this on the slider, but after a render the expression breaks.

    <== BilletHQ | Creative that Goes to 11 ==>
    https://www.egg-factory.com

  • Dan Ebberts

    June 8, 2017 at 4:52 pm

    What’s the error message associated with the broken expression?

    Dan

  • Ace Billet

    June 8, 2017 at 6:14 pm

    There’s no error message (like the ones that appear in the bottom of the comp in an orange strip)
    Rather than that, the slider stops functioning – no matter which value I dial in, the inside comps don’t swap.

    <== BilletHQ | Creative that Goes to 11 ==>
    https://www.egg-factory.com

  • Dan Ebberts

    June 8, 2017 at 6:25 pm

    Does it update if you do

    Edit > Purge > All Memory & Disc Cache…?

    Dan

  • Ace Billet

    June 8, 2017 at 7:36 pm

    No, purging doesn’t help. I guess we’ll have to go manual on this one.

    <== BilletHQ | Creative that Goes to 11 ==>
    https://www.egg-factory.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy