Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Create Grouped effects in effects controls panel via script

Tagged: 

  • Create Grouped effects in effects controls panel via script

    Posted by Evgenii Filippov on August 31, 2022 at 8:15 pm

    Hi guys, I am trying to apply an expression controller to the effects controls panel via script. I would like to achieve something like this (please check the screenshot). I want to have an effect layer that contains both single effects and grouped ones. Is it possible to do it via script?
    I have tried to add different effect controllers, but I am not sure how to parent-child/group them

    I know there is a solution with the creation of an ffx file and applying it via applyPreset or via binary script, but this approach sometimes doesn’t work as I want. applyPreset method depends on the selection and has some unwanted side effects, so I want to have full control instead and to be able to create it via script

    Evgenii Filippov replied 3 years, 8 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    August 31, 2022 at 8:35 pm

    You can create a pseudo effect by editing AE’s PresetEffects.xml file to define your effect panel. Then you can apply that effect by script, using the effect’s match name. The problem is, doing it that way, the system where you run your script has to have your modifications to the xml file, so that’s not a vary viable method if anyone else needs to run your script. You can get around that issue by including “Pseudo/” at the beginning of your match name, but then you have to apply it as a .ffx file, with the constraints you mentioned.

    The other alternative is to create your control panel as a actual effect, using the AE SDK, but that has its own steep learning curve and installation issues.

    Having done many of these for various scripts, I’d recommend the .ffx route as being the most manageable.

  • Evgenii Filippov

    August 31, 2022 at 9:31 pm

    Thank you Dan so much for clearing this out for me 🙂

    Honestly I would like to do it as applyPreset(ffx) method as well. But I don’t know how to get around the issues I face with this approach.

    I know that the applyPreset applies the effect preset as many times as selected layers/properies. I need as many effect controls as property objects selected. So I select only one layer and select needed properties and then run applyPreset. If Properties selected inside content or transform property groups then it creates as many effects as properties selected, everything is ok in this case.

    But whenever I select a property from layer’s effects group and from transform/contents group at the same time, It creates as many effects controllers as selected properties only from contents/transform without counting the properties from the effect group. However If I select property only from effects group it applies correctly.

    I was thinking about some workarounds and I thought if I select the layer without any properties selected and run the applyPreset method on it N times in a loop it will apply it N times, however it applies only once

    I really don’t know how to fix that

  • Dan Ebberts

    August 31, 2022 at 10:31 pm

    This is a little test script that will apply my controls preset 3 times to layer 1 of my comp:

    function test(){
    function deselectAll(theComp){
    var mySelected = theComp.selectedLayers;
    for (var i = 0; i < mySelected.length; i++){
    mySelected[i].selected = false;
    }
    }
    var myPresetPath = "/c/test/Test_Controls.ffx";
    var numControls = 3;
    var myComp = app.project.activeItem;
    var myLayer = myComp.layer(1);
    for (var i = 1; i <= numControls; i++){
    deselectAll(myComp);
    myLayer.selected = true;
    myLayer.applyPreset(File(myPresetPath));
    }
    }
    test();
  • Evgenii Filippov

    September 1, 2022 at 6:28 am

    Thank you, Dan, you are the best!

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