Skip to content

Instantly share code, notes, and snippets.

@Saw-mon-and-Natalie
Created August 11, 2019 08:40
Show Gist options
  • Save Saw-mon-and-Natalie/4877b9c18ea0003cda76e7fff5d9f0f6 to your computer and use it in GitHub Desktop.
Save Saw-mon-and-Natalie/4877b9c18ea0003cda76e7fff5d9f0f6 to your computer and use it in GitHub Desktop.
Persistent Random Position on Marker / Adobe After Effects CC
temp = thisComp.layer("Null 1").transform.anchorPoint[0];
markers = thisComp.layer("Null 1").marker
idx = markers.nearestKey(time).index;
if(markers.nearestKey(time).time > time) { idx--; }
if(idx < 1) { idx = 1; }
var seed = time;
if(temp == 50) {
seed = time;
}
seedRandom(idx, timeless = true);
temp_x = random(thisComp.width);
temp_y = random(thisComp.height);
[temp_x, temp_y]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment