Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Problem trying to get compound scale of a chain of parented nulls

  • Problem trying to get compound scale of a chain of parented nulls

    Posted by Rob Mcgowan on February 26, 2017 at 11:14 pm

    hi, I’ve been trying to calculate the distance between an unparented point and a point in a chain of scaled parented nulls. I have toWorld’ed my parented point and everything is fine when there are no scale factors. When I change from 100% scales the distance is wrong.

    So I tried iterating up through the layers until I get to the parent with the idea that at each layer I could calculate the resulting scale adjustment and then I would apply it to my distance vector. But that didn’t work out at all.

    The main issue is the scale property. GimmePropPath gives the path for the property as .transform.scale as one would expect but I can’t find such a property shown in the data browser thingy and the code throws ‘undefined is not an object’ or something like that. The layer does have .scale but that property does not appear to be an array and attempts to access members [0] and [1] fail.

    Anyone point me in the right direction. I’m going about this the wrong way? Can I use toWorld somehow better?
    Thanks

    //Neither of these seem to work...

    myScale=[myScale[0]*myLayer.transform.scale[0],myScale[1]*myLayer.transform.scale[1]];
    myScale=[myScale[0]*myLayer.scale[0],myScale[1]*myLayer.scale[1]];

    Rob Mcgowan replied 9 years, 2 months ago 1 Member · 1 Reply
  • 1 Reply
  • Rob Mcgowan

    February 26, 2017 at 11:33 pm

    Ok I was missing a .value. So at least now I can build my scaleFactor

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