Forum Replies Created

  • Steve Renshaw

    October 9, 2009 at 6:25 pm in reply to: AE script – applyPreset()

    Brilliant, thanks Dan. Not quite how I thought applyPreset() would work, but your code lets me achieve the desired results anyway.

    Thanks again,

    Steve.

  • Steve Renshaw

    October 9, 2009 at 9:19 am in reply to: AE script – applyPreset()

    Hi Dan,

    Your code works for me too. My problem is not adding the preset when I create the layer, but adding it later in the code. In the following test I’d expect the preset to be added to the layer called ‘Preset_here’, but instead it adds it to the last layer created (Test2).

    // Test script

    var myComp = app.project.activeItem;

    // Create layer that preset should be added to later
    var importantLayer = myComp.layers.addNull();
    importantLayer.startTime = 0;
    importantLayer.source.name = “Preset_here”;

    // Create a few other layers
    var testLayer = myComp.layers.addNull();
    testLayer.startTime = 0;
    testLayer.enabled = false;
    testLayer.source.name = “Test1”;

    var testLayer = myComp.layers.addNull();
    testLayer.startTime = 0;
    testLayer.enabled = false;
    testLayer.source.name = “Test2”;

    // Apply preset to 1st layer created (‘Preset_here’)
    {
    var presetPath = “c:/Program Files/Adobe/Adobe After Effects CS4/Support Files/Presets/SR/light_sweep1.ffx”;
    var myComp = app.project.activeItem;
    var importantLayer = myComp.layer(“Preset_here”);
    importantLayer.moveToBeginning();
    importantLayer.enabled = true;
    var myPreset = File(presetPath);
    importantLayer.applyPreset(myPreset);
    }

  • Steve Renshaw

    October 8, 2009 at 6:40 pm in reply to: AE script – applyPreset()

    Hi Dan, thanks for the response. Unfortunately I get the same behaviour. I’ve also tried the following experiment:

    //Add and remove temp null to clear any existing selection

    var tempLayer = myComp.layers.addNull();
    tempLayer.moveToBeginning();
    tempLayer.remove();

    // Move Cam_Null_ST to top of layer stack

    var mySTLayer = myComp.layer(“Cam_Null_ST”);
    mySTLayer.moveToBeginning();
    mySTLayer.enabled = true;

    // Add preset to 1st layer in stack

    var firstLayer = myComp.layer(1);
    firstLayer.applyPreset(thePreset02);

    Again I get the same behaviour – rather than adding the preset to the existing first layer, a new layer solid is created and the preset applied to that. I’ve also tried applying different presets, in case there is something odd in the preset code, but it still creates a new layer.

    Steve.

  • Steve Renshaw

    March 9, 2009 at 6:56 pm in reply to: Accelerate position value

    Perfect! Thanks Filip.

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