ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Collect all layers' property value

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dan Turner
Collect all layers' property value
on Feb 8, 2017 at 11:49:41 am

Hi! So I am trying to animate a slider, based on the time remapping velocity values of the layers below it.

I'm looking for something along the lines of:

thisComp.layer(**All Layers**).timeRemap.speed

If anyone can help it would be much appreciated!

Thanks
Dan


Return to posts index

Dan Ebberts
Re: Collect all layers' property value
on Feb 8, 2017 at 7:55:54 pm

I'm not sure what you're trying to do, but this would give you the layer directly below the layer with the expression:

thisComp.layer(index+1).timeRemap.speed


Dan



Return to posts index

Dan Turner
Re: Collect all layers' property value
on Feb 8, 2017 at 11:15:01 pm

Thanks Dan, I'm actually looking to add together the values of ALL the layers below it.

So index+1,100 or something (assuming that would add all in that range), but it will probably require a qualifier for layers that have time remapping applied.


Return to posts index


Dan Ebberts
Re: Collect all layers' property value
on Feb 9, 2017 at 12:04:38 am

This might work:


tot = 0;
for (i = index+1; i <= thisComp.numLayers; i++){
try{
tot += thisComp.layer(i).timeRemap.speed;
}catch(e){
}
}
tot



Dan



Return to posts index

Dan Turner
Re: Collect all layers' property value
on Feb 9, 2017 at 9:44:11 am

Ah fantastic - that did work a treat, thanks Dan.

It did run me into another problem however.

I am trying to animate the rotation of an object based on the time remap properties of the other layers, so as they speed up, the rotation also speeds up etc.

However, when using the speed value , it works when the value is increasing, but as the velocity value decreases the object returns to it's original position.

So I guess I need an accumulating only value - perhaps using a valueAtTime property, but I'm afraid it's beyond me!

Any suggestion much appreciated!


Return to posts index

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