Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Problem with the order of actions. how to create a slider without losing the original property selection array

  • Problem with the order of actions. how to create a slider without losing the original property selection array

    Posted by Tal Arbiv on December 12, 2016 at 12:33 am

    I’ve got a double ‘for’ loop creating expressions on a selected properties of selected layers. the expression contains reference to a slider that is created on current layer within the same loop.
    problem is, if i place the slider creation after the expression assignment, the non existing reference breaks the loop,
    and if i place it after, my guess is that it replaces the active selection of the original property with the newly created slider and that messes up the rest of the loop .

    result 1 : faulty expression
    result 2 : expression assignment skipped

    // (1) :

    expr = “effect(‘name’)(‘slider’) //+something+something…. ;
    for (i=0; i <= sellayers.length-1; i++){
    for (p=0; p <= selprop.length-1; p++){
    selprop[p].expression = expr;
    }
    ofset = sellayers[i].Effects.addProperty(“ADBE Slider Control”);
    ofset.name = “name”;
    ofset.property(“Slider”).setValue(0);
    }
    // (2) :

    expr = “effect(‘name’)(‘slider’) //+something+something…. ;
    for (i=0; i <= sellayers.length-1; i++){

    ofset = sellayers[i].Effects.addProperty(“ADBE Slider Control”);
    ofset.name = “name”;
    ofset.property(“Slider”).setValue(0);

    for (p=0; p <= selprop.length-1; p++){
    selprop[p].expression = expr;
    }
    }

    Big thank you in advance

    // (1) :

    expr = "effect('name')('slider') //+something+something.... ;
    for (i=0; i &lt;= sellayers.length-1; i++){
    for (p=0; p &lt;= selprop.length-1; p++){
    selprop[p].expression = expr;
    }
    ofset = sellayers[i].Effects.addProperty("ADBE Slider Control");
    ofset.name = "name";
    ofset.property("Slider").setValue(0);
    }
    // (2) :

    expr = "effect('name')('slider') //+something+something.... ;
    for (i=0; i &lt;= sellayers.length-1; i++){

    ofset = sellayers[i].Effects.addProperty("ADBE Slider Control");
    ofset.name = "name";
    ofset.property("Slider").setValue(0);

    for (p=0; p &lt;= selprop.length-1; p++){
    selprop[p].expression = expr;
    }
    }

    Tal Arbiv replied 9 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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