i am trying to figure out a way to be able to show just one layer from a pre-composed comp. for example lets say there are 5 different hand pictures (with alphas) in a precomp, i seek a method to change the hand picture from pic 3 to pic 5 without entering the pre-comp, changing opacities constantly.
what do you think?
is there a solution for this?
Moderator: byronnash
- lloydalvarez
- Enhancement master
- Posts: 460
- Joined: June 17th, 2004, 9:27 am
- Location: New York City, NY
- Contact:
You can just add an expression to the opacity channel for each layer you want to show and tie that to a slider in the parent comp.
For example if the parent comp named "Main Comp" has an expression control slider on a control layer named "Control Null" then the expression on the opacity channel of the hand pictures in the pre-comp would have an expression along the lines of this:
o = Math.floor(comp("Main Comp").layer("Control Null").effect("Slider Control")("Slider"));
if (o == index) 100 else 0
Then simply keyframe the slider to the index number of the layer you want to show. The Math.floor bit will make it work with decimals, ie 1 to 1.9 will still select layer 1.
-Lloyd
For example if the parent comp named "Main Comp" has an expression control slider on a control layer named "Control Null" then the expression on the opacity channel of the hand pictures in the pre-comp would have an expression along the lines of this:
o = Math.floor(comp("Main Comp").layer("Control Null").effect("Slider Control")("Slider"));
if (o == index) 100 else 0
Then simply keyframe the slider to the index number of the layer you want to show. The Math.floor bit will make it work with decimals, ie 1 to 1.9 will still select layer 1.
-Lloyd
-
- Posts: 1
- Joined: April 14th, 2011, 1:16 am
Great post! It's very nice. Thank you so much for your post.