Skip to main content
Known Participant
September 22, 2022
Question

Can I pass results from ' toCompVec ' expression to a parent comp?

  • September 22, 2022
  • 1 reply
  • 396 views

Trying to work this out in my head how it would be possible.  I assume if it were possible it would be via Essential Graphics, but can't decipher what property needs to be "essential".

 

My end goal is to get a fully built Cube precomp (CYAN Label in GIF) into a comp with a camera (Brown Label), which will have many other cubes.  Need the sides for each cube to react/disappear via toCompVec expression.

 

Seems as right now, I can only get the toCompVec to work in the comp that has the cube-faces (CYAN Label).  Can I pass this data into another comp (Brown Label)?  Collapse transform doesn't work, obviously, but thought it would be possible when I initially conceptualized this in my head.

 

 

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
September 22, 2022

I think you have to transform the vector twice--once in the nested comp and then transform that resulting vector in the outer comp. It will probably look something like this:

L = comp("Whole Cube").layer(thisComp.name);
v = toCompVec([0,0,1]);
L.toCompVec(v)[2] > 0 ? value : 0
spzspzAuthor
Known Participant
September 23, 2022

I am grateful for your response.  Could you possibly elaborate a little more?

I'm assuming you're implying I should apply this expression to the opacity in 'outer comp' -- however, I would need 6 parameters to alter opacity for each face of cube?  I tried to add a slider to see if this would register (so I could then carry it across each face), but it doesn't work.

Thank you.