Forum Replies Created

  • Whoooha!!!

    martinComp.openInViewer();
    martinComp.emotions(“HAPPY”).value = true;

    Thank you Dan – once again you save the day (and I learned something new) 🙂

    Martin

  • I thought so…

    Is there any other way of getting the Audio Amplitude as a value through scripting?

    Martin

  • Okay so I found a way to make all nested scripts part of the same scope. All functions needs to be bound to the first loaded script – the main script. And the function for loading nested scripts should be placed in main.jsx and this function should always be used for loading scripts – if you want it to be part of the same scope.

    I haven’t compiled and testet the code here but it should work.

    cheers,
    Martin

    //
    //main.jsx
    //

    this.loadExternalScript = function(path) {
    // [1] Create file object for the file you want to run.
    var nested_file = new File(path);

    // [2] Open the file for reading.
    nested_file.open("r");

    // [3] Read the file and evaluate the results.
    eval(nested_file.read());

    // [4] Close the file. That's it!
    nested_file.close();
    }

    loadExternalScript("nestedScript1.jsx");

    testAlert_1("called fom main.jsx")

    //
    //nestedScript1.jsx
    //

    loadExternalScript("nestedScript2.jsx");
    this.testAlert_1(str) = function(str) {
    alert("nested 1: " + str);
    }

    testAlert_2("called from nested 1");

    //
    //nestedScript2.jsx
    //

    this.testAlert_2(str) = function(str) {
    alert("nested 2: " + str);
    }

  • No nothing else changed… But it seems like calling external functions is completely cut off.

    I’ll get back to you if I find a workaround or an explanation.

    Martin

  • Martin Bollerup

    November 27, 2012 at 9:05 am in reply to: Getting the precise timecode for Layer Markers

    Sorry – missed that markers behave like keys…?

    Have a great day,
    Martin

    alert("marker.keyTime(i): "+marker.keyTime(i));

  • Martin Bollerup

    November 26, 2012 at 10:21 am in reply to: Moving existing keyframes with a .jsx-file

    Thank you so much Xavier – that just made my monday start like a charm!!!

    Have a great day,
    Martin

  • Martin Bollerup

    November 22, 2012 at 9:46 pm in reply to: Moving existing keyframes with a .jsx-file

    Hmm thought so 🙂

    I tried to fool around with the PropertyGroup object but couldn’t find a way to get anything but errors. Isn’t there a way to copy the easing between to keyframes (all handles on the curve etc.) and add them to another two?

    Thanks,
    Martin

  • Thanks for your reply Dan!

    Well I found a little workaround for my problem:

    I’m using the startup script to schedule a task with a delay of 1 second. The breakFree bool is used because somehow the script continues to run…

    This enables the project to get loaded and the script to replace footage and trim the comps – in my little sandbox environment…

    In the real world there is a virtual machine opening an After Effects document, replacing some footage and right after that starting a Render Cue… My script won’t even get run – it seems like it’s thrown to the back of the task cue… I also tried with a delay of 0.001 second – works fine in the sandbox, but still won’t get run before the Render Queue.

    If I just make an alert box in the startup scripts it’ll be shown before the project is loaded. So it’s not that the virtual machine ignores the startup scripts, but something about the queuing of tasks?

    So has anyone got any experience with pausing render queues, altering content, starting again or as I probably have to; stop a render cue, copy the names of the export files (so the servers won’t freak out), make the changes in duration etc., make a new render queue with the proper names…

    Any thoughts?

    cheers,
    Martin

    var breakFree = false;
    function runOnStartUp(){

    if (!breakFree){
    breakFree = true;
    replaceFootage();
    trimAndPositionLayers();
    }

    }

    if( ! app.project ) {
    alert("no project");
    } else {
    app.scheduleTask("runOnStartUp()", 1000, 1);
    }

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