Forum Replies Created

  • Don Jobs

    June 10, 2019 at 4:01 pm in reply to: How to edit this script and make it link layers?

    I’m working with particles in 3ds Max and need to link all the particles with the after effects layers… So that’s why I need it ☺ It’s a personal project I’m working on.

    Thank you very much! 🙂

  • Don Jobs

    June 8, 2019 at 11:19 am in reply to: How to edit this script and make it link layers?

    I love you man! Thanks a million! ????????????

    It’s working and you just saved me hours and hours of “linking”…

    I had to replace “&I” with “<=” …I guess it’s went wrong in copy-paste ????

    God bless you!
    Don

    var w = new Window ("palette", "Link");
    w.add("button", undefined,"Selection 1",{name:"ok"}).onClick = function(){ selectLayersA(); }
    w.add("button", undefined,"Link To Selection 2",{name:"ok"}).onClick = function(){ selectLayersBLink(); }
    w.show();
    var selectionArray = new Array();

    function selectLayersA()
    {
    var activeComp = app.project.activeItem;
    var selectedLayersA = new Array();
    selectedLayersA = activeComp.selectedLayers;
    for (var b = 0; b &lt;= selectedLayersA.length; b++)
    {
    selectionArray[selectionArray.length] = selectedLayersA[b];
    }
    }
    function selectLayersBLink(){
    app.beginUndoGroup("Link to comps");
    var activeComp = app.project.activeItem;
    var selectedLayersB = new Array();
    selectedLayersB = activeComp.selectedLayers;
    for (var i = 0; i &lt;= selectionArray.length; i++)
    {
    if (selectedLayersB[i] != null){
    layerA = selectionArray[i];
    layerB = selectedLayersB[i];
    layerB.parent = layerA;
    }
    }
    selectionArray = []
    app.endUndoGroup();
    }

  • Don Jobs

    June 7, 2019 at 10:38 pm in reply to: How to edit this script and make it link layers?

    Dear Tomas,

    thank you very much for your time. ☺

    1. Yes, index 1 layer should be linked with 6th.

    2. The script should be used with non linked layers.

    (If some layers are linked then the script should override the parenting – this feature is not necessary)

    3. If first selection has 10 layers and second selection has 12 layers it should connect the first 10.

    If it’s easier, would it be possible just to edit the original script? So, first and second selection should be placed in the active composition and the result should be linking the two selections.

    Thanks a lot!
    Don

  • Don Jobs

    June 7, 2019 at 11:41 am in reply to: How to edit this script and make it link layers?

    Hi Tomas,

    thank you very much for your reply! ☺

    I’m sorry if I wasn’t clear enough. So by “layers” I mean: solids, nulls, compositions in the active composition.

    I don’t understand what you said:
    “What it would do is make copies of selected layers in the first place” – Why? It could link “selection 1” with “selection 2”

    If there are 10 solids in my composition. First I select the first 5 solids, then I select another 5 and link the first 5 to second 5. By “link” I mean make parent-child connection.

    I found this script here on the forum, and it’s doing the same thing but in a different way.

    Thanks for the help 🙂

    //Parent
    var myComp = app.project.activeItem;
    var SecondGrp = myComp.selectedLayers[myComp.selectedLayers.length-1].index+1;

    for (var i = 0; i &lt; myComp.selectedLayers.length; i++) {
    myComp.selectedLayers[i].parent = myComp.layers [SecondGrp+i];
    }
    // Invert
    var comp = app.project.activeItem;

    for (var w = 1; w &lt;= comp.numLayers; w++) {
    comp.layers[w].selected = !comp.layers[w].selected;
    }

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