Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text layer PreComp

  • Text layer PreComp

    Posted by Vasyl Iskovych on June 25, 2019 at 7:31 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.

    Vasyl Iskovych replied 7 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    June 26, 2019 at 1:25 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.

  • Vasyl Iskovych

    June 26, 2019 at 3:17 pm

    Thank you for help.
    Everything is working.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy