I've tracked a shot in Mocha and now have the transform data in x,y position, scale, and rotation. I would like to apply this data to a particle emitter.
x,y position is fine as I can just copy that data into the correct field. However, since Mocha yields depth info as Scale, I cannot easily link Scale to the emitter's Z Position.
I'm thinking I need an expression here to translate Scale Percentage to a real number.
Any ideas? And thanks in advance.
Monty
Improper planning on your part doesn't necessarily constitute and emergency on my part
Re: Turn Scale into Z Position by Roland R. Kahlenberg on Oct 1, 2008 at 1:38:04 am
Paste the Scale property to a Null Layer. Ensure that the Null is named "Null 1". If not make the necessary edit to the script below.
The Expression should be placed in Particular's Z-position property.
Also, you'll have to change the values to minScale, maxScale, NewZPosMin and NewZPosMax to suit your needs. For minScale and macScale, just eyeball the value graph to ascertain the minimum and maximum values there and insert those values accordingly
//Start Expression.
ZPos = thisComp.layer("Null 1").scale[0];
minScale = 20; //minimum value for scale
maxScale = 100; //maximum value for scale
NewZPosMin = 0; //minimum value for ZPos
NewZPosMax = 500; //minimum value for ZPos
linear(ZPos,minScale,maxScale,newZPosmin,NewZPosMax)
//End Expression
I'm not on a machine with AE so I'm hopeful that the script works.
Cheers
RoRK
broadcastGEMs.com - the leader in customizable royalty-free animated backdrops
Re: Turn Scale into Z Position by Roland R. Kahlenberg on Oct 7, 2008 at 7:10:07 pm
Hi Tim, I just checked on my side and the script works.
Do you have a Null 1 in your comp. And this Null 1 contains your scale values from Mocha?
Also, you have to be more specific with the error message that you are receiving. Seeing that it is in the line that specifies the Null 1 layer, I'm betting that it has to be related to the Null 1 layer not being present. But it'll be helpful to both of us if you spelt out the problem.
HTH
RoRK
broadcastGEMs.com - the leader in customizable royalty-free animated backdrops