ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tal Arbiv
Problem with the order of actions. how to create a slider without losing the original property selection array
on Dec 12, 2016 at 12:33:51 am
Last Edited By Tal Arbiv on Dec 12, 2016 at 10:46:06 pm

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;
}
}


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]