Highlighted

Text scaling on each line (smart sizer)

New Here ,
Aug 06, 2020

Copy link to clipboard

Copied

Hi

 

I would like the text to be scaled up and the leading correct on each line. (see photos)
I am using a ukramedia script, but this only applies to a text box and not a text line.
I don't have much experience with after effects, which is why I also use this script in the first place.

I want to make this a template for premiere, so that it has to be dynamic.

matthiasvdv2002_0-1596721944081.png 

matthiasvdv2002_1-1596722028555.png

 

 

This is the smart sizer script:

try {
sizeOptions = effect("Smart Sizer 1.0")("Size Options").value;
customTime = sourceTime(effect("Smart Sizer 1.0")("Custom Time").value);
layerSizeAt = effect("Smart Sizer 1.0")("Layer Size at").value;
customTimeSource = effect("Smart Sizer 1.0")("Custom Time Source").value;
switch(layerSizeAt) {
	case 1:
	finalSize = sourceTime(time);
	break;
	case 2:
	finalSize = inPoint;
	break;
	case 3:
	finalSize = inPoint + outPoint/2;
	break;
	case 4:
	finalSize = outPoint;
	break;
	case 5:
		if (customTimeSource == 1) {
			finalSize = sourceTime(customTime);
		} else {
			finalSize = customTime;
		}
	break;
	default:
	finalSize = sourceTime(time);
	break;
}
sizeAtTime = sourceRectAtTime(finalSize, true);
xMargin = effect("Smart Sizer 1.0")("X Margin (px)").value * 2;
yMargin = effect("Smart Sizer 1.0")("Y Margin (px)").value * 2;
xSize = effect("Smart Sizer 1.0")("Width (px)").value - xMargin;
ySize = effect("Smart Sizer 1.0")("Height (px)").value - yMargin;
x = xSize / sizeAtTime.width * 100;
y = ySize / sizeAtTime.height * 100;
fitToWidth = Math.min(x, y);
fitToHeight = Math.max(x, y);
switch(sizeOptions) {
	case 1:
	[x, x];
	break;
	case 2:
	[y, y];
	break;
	case 3:
	[fitToWidth, fitToWidth];
	break;
	case 4:
	[fitToHeight, fitToHeight];
	break;
	case 5:
	[x, y];
	break;
	default:
	[x, y];
	break;
}
}
catch (err) {
	value;
}

 

Thanks in advance!

Topics

Expressions, Scripting

Views

38

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Text scaling on each line (smart sizer)

New Here ,
Aug 06, 2020

Copy link to clipboard

Copied

Hi

 

I would like the text to be scaled up and the leading correct on each line. (see photos)
I am using a ukramedia script, but this only applies to a text box and not a text line.
I don't have much experience with after effects, which is why I also use this script in the first place.

I want to make this a template for premiere, so that it has to be dynamic.

matthiasvdv2002_0-1596721944081.png 

matthiasvdv2002_1-1596722028555.png

 

 

This is the smart sizer script:

try {
sizeOptions = effect("Smart Sizer 1.0")("Size Options").value;
customTime = sourceTime(effect("Smart Sizer 1.0")("Custom Time").value);
layerSizeAt = effect("Smart Sizer 1.0")("Layer Size at").value;
customTimeSource = effect("Smart Sizer 1.0")("Custom Time Source").value;
switch(layerSizeAt) {
	case 1:
	finalSize = sourceTime(time);
	break;
	case 2:
	finalSize = inPoint;
	break;
	case 3:
	finalSize = inPoint + outPoint/2;
	break;
	case 4:
	finalSize = outPoint;
	break;
	case 5:
		if (customTimeSource == 1) {
			finalSize = sourceTime(customTime);
		} else {
			finalSize = customTime;
		}
	break;
	default:
	finalSize = sourceTime(time);
	break;
}
sizeAtTime = sourceRectAtTime(finalSize, true);
xMargin = effect("Smart Sizer 1.0")("X Margin (px)").value * 2;
yMargin = effect("Smart Sizer 1.0")("Y Margin (px)").value * 2;
xSize = effect("Smart Sizer 1.0")("Width (px)").value - xMargin;
ySize = effect("Smart Sizer 1.0")("Height (px)").value - yMargin;
x = xSize / sizeAtTime.width * 100;
y = ySize / sizeAtTime.height * 100;
fitToWidth = Math.min(x, y);
fitToHeight = Math.max(x, y);
switch(sizeOptions) {
	case 1:
	[x, x];
	break;
	case 2:
	[y, y];
	break;
	case 3:
	[fitToWidth, fitToWidth];
	break;
	case 4:
	[fitToHeight, fitToHeight];
	break;
	case 5:
	[x, y];
	break;
	default:
	[x, y];
	break;
}
}
catch (err) {
	value;
}

 

Thanks in advance!

Topics

Expressions, Scripting

Views

39

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mylenium LATEST
Most Valuable Participant ,
Aug 06, 2020

Copy link to clipboard

Copied

You can't use paragraph text in that way. If you realyl want to match different lines of text, the have to be separate. There's only so much expressions can do. Other than that you can always rig it up with scale text animators set to per line mode. Easy enough to do and eliminates using any expressions from the equation.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...