how to get _effective_ pixel dimensions of scaled solids?

Moderators: Disciple, zlovatt

Post Reply
Fishdriver
Posts: 2
Joined: July 15th, 2019, 9:08 am

July 15th, 2019, 9:21 am

hi folks,

I am building a 2.5d "interior set" for an AE camera to fly thru. I've made it out of placeholder solids which have been scaled, mostly non-proportionally, to fit the dimensions of the space.

I'd like to replace the placeholder solids (walls, ceiling, etc) with Photoshop texture files of appropriate pixel dimensions, and I need to figure out what those dimensions are so that I can avoid squashing or stretching the textures -- ie, bring them in at 100% proportional scale.

Is there a way I can retrieve the "effective" X & Y dimensions of each solid, based on its original dimensions & applied scale, without calculating them all by hand?
Fishdriver
Posts: 2
Joined: July 15th, 2019, 9:08 am

July 18th, 2019, 7:13 am

courtesy of Dan Ebberts:

Code: Select all

L = thisComp.layer(index + 1);
r = L.sourceRectAtTime(time,false);
sX = L.scale[0] / 100;
sY = L.scale[1] / 100;
text.sourceText = [ r.width * sX , r.height * sY ]
put that in the Source Text of a text layer, then put the source layer directly above the layer you want to measure.
Post Reply