-
Auto Scaling expression
Hey guys, currently have this expression:
margin = 0
text_width = thisLayer.sourceRectAtTime(time).width;
text_height = thisLayer.sourceRectAtTime(time).height;
rect_height = thisComp.layer("S").height*thisComp.layer("S").scale[1]/100-2*margin;
rect_width = thisComp.layer("S").width*thisComp.layer("S").scale[0]/100-2*margin;
s = Math.min(rect_width/text_width*100, rect_height/text_height*100);
[s,s]
But need some help in changing it so it also takes into account the keyframes I have set on a layer.
This code currently automatically scales a piece of text, well, anything I suppose, to the size of a box I have in the composition, but I have other keyframes on the text that change the scale for effect and currently this completely overwrites them.Any help is greatly appreciated!
Cheers,
Nathan.