transparency of 3d layer on top of 3d layer
Hello community
I have a comp with a white text on black background within another comp. On top of this subcomp I have a PNG of a traffic cone . This PNG layer is randomly placed all over the comp (comp is filled with about 200 of these cones).
Since I have to export several texts in this way, I thought it would be good to distribute the traffic cones over the whole space at random positions and only display them when the white writing is visible underneath. My expression for the transparency property of the PNG is the following:
underlyingLayer = thisComp.layer("Name Comp");
if(underlyingLayer.sampleImage(transform.position, [0.5, 0.5])[0] > 0.5) {
100;
} else {
0;
}
That works quite well, but sadly only in 2D space. If I change the "Name Comp" to 3D and change its x rotation, the cones are not changing their visibility as if the text comp hasn't turned in 3D space.
I found out that it could have something to do with toWorld(), but I don't know where to put that into my expression.
Does anyone see where I made the mistake?
