Hi, I have an issue with something that I can solve when using a 3D solid, whose layer space makes sense to me, but when using shape layers in 3D, something gets lost. This is probably hidden somewhere in sourceRectAtTime() or similar, but I can't quite get there at the moment.
I am trying to sample the alpha of one 3D shape layer, at the intersection with the 3D point of another (non-shape) layer, as seen in comp space.
I know this is a bit abstract when written down, but I have added the code that works when the shape layer is replaced with a 3D solid in the comp.
Any help would be greatly appreciated, and save me from going mad ;)
sam = effect("Sample Source")("Layer"); // layer whose alpha will be sampled
pos = effect("Position Source")("Layer"); // layer whose position will be used for sample
// rect = sam.sourceRectAtTime(time,true); // left this in from testing ideas on shape layer space
// rect2 = [rect.left,rect.top]; // left this in from testing ideas on shape layer space
thisCompPos = pos.toComp(pos.anchorPoint); // get comp position of non shape layer
thisCompPos = [thisCompPos,thisCompPos]; // I was just removing the  part of the array to clarify to myself
shapePos = sam.fromCompToSurface(thisCompPos); // this is the part that works on a solid layer
a = sam.sampleImage(shapePos,[0.5,0.5],true,time); // sample alpha at projected point on layer
if (a > 0) 100 else 0; // return value based on result