Copy link to clipboard
Copied
hey everyone i wanted to shuffle layers randomly in after effect. I have around 50 layers and wanted to just rendomly shuffle i need any kind if script or free tool that can help me to ease my work rather than doing manually
for example:
(before shuffle)
layer 1
layer 2
layer 3
layer 4
layer 5
layer 6
layer 7
layer 8
layer 9
layer 10
(after shuffle)
layer 4
layer 7
layer 5
layer 1
layer 9
layer 3
layer 8
layer 10
layer 2
layer 6
Here's a simple script that assumes all layers are participating:
function shuffleLayers(){
function shuffleArray(theArray){
var temp;
var idx;
for (var i = 0; i < theArray.length; i++){
idx = i + Math.floor(generateRandomNumber()*(theArray.length-i));
temp = theArray[i];
theArray[i] = theArray[idx];
theArray[idx] = temp;
}
}
var myComp = app.project.activeItem;
if (! (myComp && myComp instanceof CompItem)){
alert ("No comp active.");
return;
}
var myLayers = [];
f
...
Copy link to clipboard
Copied
Here's a simple script that assumes all layers are participating:
function shuffleLayers(){
function shuffleArray(theArray){
var temp;
var idx;
for (var i = 0; i < theArray.length; i++){
idx = i + Math.floor(generateRandomNumber()*(theArray.length-i));
temp = theArray[i];
theArray[i] = theArray[idx];
theArray[idx] = temp;
}
}
var myComp = app.project.activeItem;
if (! (myComp && myComp instanceof CompItem)){
alert ("No comp active.");
return;
}
var myLayers = [];
for (var i = 1; i <= myComp.numLayers; i++){
myLayers.push(myComp.layer(i));
}
shuffleArray(myLayers);
for (var i = 0; i < myLayers.length; i++){
myLayers[i].moveToBeginning();
}
}
shuffleLayers();
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
is there any free website that can convert my script into JSX so i can add it in my script pannel
Copy link to clipboard
Copied
it's working with the method you suggested
Copy link to clipboard
Copied
Maybe try this file downloader
Find more inspiration, events, and resources on the new Adobe Community
Explore Now