Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Turn Scale into Z Position

  • Turn Scale into Z Position

    Posted by Tim Montiq on September 30, 2008 at 8:30 pm

    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

    Roland R. kahlenberg replied 17 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Roland R. kahlenberg

    October 1, 2008 at 1:38 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

  • Tim Montiq

    October 7, 2008 at 3:20 pm

    Roland,

    I’m receiving a expected error in line 2. I’m entering the value for my minScale as 100 and maxScale as 550. Error is still occurring?

    Any idea?

    Improper planning on your part doesn’t necessarily constitute and emergency on my part

  • Roland R. kahlenberg

    October 7, 2008 at 7:10 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy