ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# opacity of a bunch of shape layer groups triggered sequentially by markers

FAQ   •   VIEW ALL
 opacity of a bunch of shape layer groups triggered sequentially by markers on May 17, 2017 at 12:34:20 pm

Hi!
I'm trying to get this work:
I have a bunch of shape groups inside a shape layer. They are circles forming a spiral. I have to animate their opacity, a quick fade according to the markers on the layer would be the quickest I guess.
So on the first marker, the shape group "circle 001" would fade in and stay, when on the next marker, the shape group "circle 002" would fade in and stay, and so on.
Do you know any approach? playing with the shape group index and make the opacity wait until reaching the next marker is the way right? But no idea about how to achieve it in the expression

thanks!

 Return to posts index

 Re: opacity of a bunch of shape layer groups triggered sequentially by markerson May 17, 2017 at 3:55:06 pm

Something like this maybe:

``` n = 0; if (marker.numKeys > 0){ n = marker.nearestKey(time).index; if (time < marker.key(n).time) n--; } myN = parseInt(thisProperty.propertyGroup(2).name.split(" ")[1],10); if (n >= myN){ fadeDur = .5; t = time - marker.key(myN).time; linear(t,0,fadeDur,0,100); }else{ 0; } ```

Dan

 Return to posts index

 Re: opacity of a bunch of shape layer groups triggered sequentially by markerson May 17, 2017 at 6:22:45 pm

super awesome! thanks!

I modified the myN a bit to make it work no matter the name of the group but their order, it seems it works, if anyone is interested:
``` n = 0; if (marker.numKeys > 0){ n = marker.nearestKey(time).index; if (time < marker.key(n).time) n--; } myN=thisProperty.propertyGroup(2).propertyIndex; if (n >= myN){ fadeDur = .5; t = time - marker.key(myN).time; linear(t,0,fadeDur,0,100); }else{ 0; } ```

 Return to posts index

 Re: opacity of a bunch of shape layer groups triggered sequentially by markerson May 17, 2017 at 9:07:54 pm

uhm, I'm having a problem I can't solve, maybe you can help, if possible?

I have another couple shape layers with a lot of groups inside as before, but they are not starting at time=0 (the layers are spread over the timeline)
I changed the marker to read the composition marker instead of the layer's. But now when they reach a marker, the total marker count is not 0 relative to the layer, it's being counted since the beginning, so all the shape groups in the order stack less than the marker number jump from 0 opacity to 100 at the inPoint.

I need to make it start with the first marker the layer reaches, being that marker as its 0 marker and then counting from that.
I guess I need to use valueAtTime and inPoint but I cann't make it work at all....

Any clue would be super welcome

Thanks!

 Return to posts index

 Re: opacity of a bunch of shape layer groups triggered sequentially by markerson May 17, 2017 at 10:42:44 pm

Try this:

``` offset = 0; if (thisComp.marker.numKeys > 0){ n = thisComp.marker.nearestKey(inPoint).index; if (thisComp.marker.key(n).time < inPoint) n++ offset = n-1; } n = 0; if (thisComp.marker.numKeys > 0){ n = thisComp.marker.nearestKey(time).index; if (time < thisComp.marker.key(n).time) n--; } myN=thisProperty.propertyGroup(2).propertyIndex; myN += offset; if (n >= myN){ fadeDur = .5; t = time - thisComp.marker.key(myN).time; linear(t,0,fadeDur,0,100); }else{ 0; } ```

Dan

 Return to posts index

 Re: opacity of a bunch of shape layer groups triggered sequentially by markerson May 17, 2017 at 11:02:21 pm

Brilliant! Thanks!!!

 Return to posts index

© 2018 CreativeCOW.net All Rights Reserved
[TOP]