Page 1 of 1

Finding out the scale of a layer with a parent

Posted: May 26th, 2008, 8:25 am
by rainjam
Anyone know how to do this? The layer space transforms (toComp, toWorld etc) seem to do this for position values but I can't find any way of finding a layer's absolute scale value. I'm trying to do a "world zoom" similar to the Videocopilot tutorial, so the highest-res layer when fully zoomed out is scaled about 0.01%. But using layer(index).transform.scale just gives its "internal" scale value which is 50%. I just wanted to try and cut down on render time by turning off any layers smaller than about 1% scale, but can't figure out how.

Thanks in advance

Nick

Re: Finding out the scale of a layer with a parent

Posted: May 26th, 2008, 9:10 am
by Dan Ebberts
Like this:

Code: Select all

s = scale[0];
L = thisLayer;
while (L.hasParent){
  s = s*L.parent.scale[0]/100;
  L = L.parent;
}
s
Dan

Re: Finding out the scale of a layer with a parent

Posted: May 26th, 2008, 10:41 am
by rainjam
Genius. Thanks Dan!