Forum Replies Created

  • Borja Tierra

    March 23, 2016 at 12:31 pm in reply to: Import multiple files and create a comp for each one

    Sorry for the spanish translation:

    This works well, I’m not using the folder part right now because I prefer to import the files one by one, but thanks anyway. I share my final script if useful to someone.

    var myfile = app.project.importFileWithDialog();
    var myText = app.project.items.addComp( "text", 1080, 1920, myfile[0].pixelAspect,myfile[0].duration,myfile[0].frameRate);

    for (var i = 0; i < myfile.length; i++){

    var myComp = app.project.items.addComp( myfile[i].name, myfile[i].width, myfile[i].height, myfile[i].pixelAspect,myfile[i].duration,myfile[i].frameRate);
    var nameComp = myfile[i].name
    var newObj = myComp.layers.add(myfile[i]);

    var format;

    //COMP LANDSCAPE
    format = nameComp.indexOf("landscape");
    if (format != -1) {
    var addText = myComp.layers.add(myText);//adds myfile to mycomp
    myComp.layer("text").rotation.setValueAtTime(0,-90);
    myComp.layer("text").position.setValue([1180,540]);
    }

    var myRender = app.project.renderQueue.items.add(myComp);

    }

  • Thank you David!

    Esto funciona bien, no estoy usando la parte de carpeta en este momento porque prefiero importar los archivos uno por uno, pero gracias de todos modos. Comparto mi guión final si es útil a alguien.

    var myfile = app.project.importFileWithDialog();
    var myText = app.project.items.addComp( "text", 1080, 1920, myfile[0].pixelAspect,myfile[0].duration,myfile[0].frameRate);

    for (var i = 0; i < myfile.length; i++){

    var myComp = app.project.items.addComp( myfile[i].name, myfile[i].width, myfile[i].height, myfile[i].pixelAspect,myfile[i].duration,myfile[i].frameRate);
    var nameComp = myfile[i].name
    var newObj = myComp.layers.add(myfile[i]);

    var format;

    //COMP LANDSCAPE
    format = nameComp.indexOf("landscape");
    if (format != -1) {
    var addText = myComp.layers.add(myText);//adds myfile to mycomp
    myComp.layer("text").rotation.setValueAtTime(0,-90);
    myComp.layer("text").position.setValue([1180,540]);
    }

    var myRender = app.project.renderQueue.items.add(myComp);

    }

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