Finding out the scale of a layer with a parent

Moderators: Disciple, zlovatt

Post Reply
rainjam
Posts: 4
Joined: April 4th, 2008, 4:28 am

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
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

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
rainjam
Posts: 4
Joined: April 4th, 2008, 4:28 am

Genius. Thanks Dan!
Post Reply