ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Text layer PreComp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Vasyl Iskovych
Text layer PreComp
on Jun 25, 2019 at 7:31:39 pm

Hello.
Help me please.
How can a script make precomposing a text layer, according to the size of the text layer?
Or how to create a new composition, the size of the text layer?
I try to do it like this:
var myName = app.project.activeItem.selectedLayers[0];
var size=app.project.activeItem.selectedLayers[0].sourceRectAtTime();
var myComp1 = app.project.items.addComp("myName.name",size.width,size.height,1,10,30);

But nothing works.
Thank.


Return to posts index

Andrei Popa
Re: Text layer PreComp
on Jun 26, 2019 at 1:25:50 pm

Try this

var myName = app.project.activeItem.selectedLayers[0];
var size=app.project.activeItem.selectedLayers[0].sourceRectAtTime(app.project.activeItem.time,false);
var myComp1 = app.project.items.addComp(myName.name,Math.round(size.width),Math.round(size.height),1,10,30);


Andrei
My Envato portfolio.


Return to posts index

Vasyl Iskovych
Re: Text layer PreComp
on Jun 26, 2019 at 3:17:09 pm

Thank you for help.
Everything is working.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]