ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

AE expression - trigger script on marker

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ondrej Hanel
AE expression - trigger script on marker
on Jul 30, 2012 at 8:16:49 am

Hi guys,
I have come across a bit stragne thing. I have a layer and I want to randomize its position at each marker. Soundd trivial, but it's giving me headache so far.

The script:

n = marker.nearestKey(time).index;

if (marker.key(n).time == time){
minVal = [0.1*thisComp.width, 0.1*thisComp.height];
maxVal = [0.9*thisComp.width, 0.9*thisComp.height];
random(minVal,maxVal)


} else {
value
}

So this script does randomize the position at each marker, but when the marker is passed it returns the layer to original position... which is so not what i want :)

any thoughts?


Return to posts index

Dan Fredley
Re: AE expression - trigger script on marker
on Jul 30, 2012 at 5:28:19 pm

Try this:

n = marker.nearestKey(time).index;

if (marker.key(n).time < time){
minVal = [0.1*thisComp.width, 0.1*thisComp.height];
maxVal = [0.9*thisComp.width, 0.9*thisComp.height];
random(minVal,maxVal)


} else {
value
}


Return to posts index

Ondrej Hanel
Re: AE expression - trigger script on marker
on Jul 31, 2012 at 7:42:43 am

Hi,
thanks for the reply. I actually had something like that already, it causes the layer to start randomizing its position at each frame passing the first marker. So its kinda like opposit of what I have.

However I need the layer to randomize its position just at one frame - where the marker is.


Return to posts index

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