I got a main composition. It got a subcomposition and a null-object(with a control checkbox).
How can I access a layers opacity in the subcomposition throught an expression in the main composition?
The goal would be to reuse the subcomp. Once with a layer visible and another time without.
So far I wrote this in the control checkbox:
if(value == 1)
{
comp("subcomp").layer("xy").opacity =100 ;
}
else
{
comp("subcomp").layer("xy").opacity =0 ;
}
I tried also to write an expression directly in the going to be hidden layers opacity:
var control = comp("maincomp").layer("control");
100*control.effect(1).param("SliderControl").valueAtTime(control.time) ;
This actually worked when I toggled the control checkbox manually, but as soon I keyed it, it didnt work anymore.
It was kind of a time conversion problem: It takes the time of the parent but applies it to the subcomp……
Thanks for help