-
Comp() not working
Hi there, I’ve been going mad for a good part of the day trying to do something that feels fairly simple.
What I’m trying to do:
I have a lightbulb and I want it to flicker. There are various parts of the lightbulb and shadows of other objects so i thought it best to create an opacity control layer that the layers are linked to.
There are also some things that appear when the the light is off – opacity is down to 0% – so i created an inverse layer too.
Finally, the colour of the light bulb changes when it turns off, so i wanted the two colours change based on the 100% or 0% status of the opacity.
The control layers are in ‘shot 04 – essentials’
A lot of the elements are in nested comps. So I’ve been trying to use comp() to refer back to the two control layers. It doesn’t work. It works when they’re all in the same comp. So i found this code i think by the man himself dan ebberts.
C = comp(“Shot 04 – Essentials”);
ctrl = C.layer(“Light Control”).transform.opacity;
L = C.layer(thisComp.name);
ctrl.valueAtTime(time+L.startTime)
When I place this in the nested comps within ‘shot 04 – essentials’, they finally work. But now i’ve got a layer that needs to be in a comp that shot 04 is nested in. And it’s not working, even with the above code. I read that the compositions all need to start at the same time? which seems weird and hasn’t been something i’ve noticed before, so i made sure that was the case. All the comps start at 0s in their respective composition. And it still doesn’t work. I don’t understaaaand it feels so simple.
This is the current expression that doesn’t work:
comp(“Shot 04 – Essentials”).layer(“Opacity Inverse”).transform.opacity;
Attached are the photo’s of the two states. I’m working on for an idea. But it’s mainly just the fact that the comp() isn’t working.