ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Slider Control Expression w/ Precomps Breaks

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ace Billet
Slider Control Expression w/ Precomps Breaks
on Jun 7, 2017 at 9:27:19 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 ==>
http://www.egg-factory.com


Return to posts index

Ace Billet
Re: Slider Control Expression w/ Precomps Breaks
on Jun 7, 2017 at 11:04:07 pm

Out of frustration I created this explainer graphic...



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


Return to posts index

Dan Ebberts
Re: Slider Control Expression w/ Precomps Breaks
on Jun 7, 2017 at 11:34:00 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



Return to posts index


Ace Billet
Re: Slider Control Expression w/ Precomps Breaks
on Jun 8, 2017 at 2:04:56 pm

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

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


Return to posts index

Dan Ebberts
Re: Slider Control Expression w/ Precomps Breaks
on Jun 8, 2017 at 4:52:54 pm

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

Dan



Return to posts index

Ace Billet
Re: Slider Control Expression w/ Precomps Breaks
on Jun 8, 2017 at 6:14:22 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 ==>
http://www.egg-factory.com


Return to posts index


Dan Ebberts
Re: Slider Control Expression w/ Precomps Breaks
on Jun 8, 2017 at 6:25:43 pm

Does it update if you do

Edit > Purge > All Memory & Disc Cache...?


Dan



Return to posts index

Ace Billet
Re: Slider Control Expression w/ Precomps Breaks
on Jun 8, 2017 at 7:36:44 pm

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

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


Return to posts index

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