ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
rob mcgowan
Problem trying to get compound scale of a chain of parented nulls
on Feb 26, 2017 at 11:14:23 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]];


Return to posts index

rob mcgowan
Re: Problem trying to get compound scale of a chain of parented nulls
on Feb 26, 2017 at 11:33:03 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]