Activity › Forums › Adobe After Effects Expressions › copy markers from layer markers to comp markers
-
copy markers from layer markers to comp markers
Andrei Popa replied 2 years ago 7 Members · 24 Replies
-
Simone Maldini
November 5, 2020 at 5:05 amHi Dan, i am new in expression and it is the first time that i write and apply a script. i found your script for move markersLayer to markersComp. I need to change the target: create a compMarker for each inPoint layer selected that i have in the comp. I tryed to change your script but the new one works only for the first selected layer.
Can i ask you to help me understanding where is the error and how can i fix it?Thank you very much.
var theComp = app.project.activeItem;
var theLayer = theComp.selectedLayers[0];
var theTimes = [];
for (var i = 1; i <= theComp.numLayers; i++){
theTimes.push(theLayer.inPoint);
}
for (var i = 1; i <= theComp.numLayers; i++){
theComp.layer(i).selected = false;
}
for (var i = 0; i < theTimes.length; i++){
theComp.time = theTimes[i];
app.executeCommand(app.findMenuCommandId(“Add Marker”));
}
-
Dan Ebberts
November 5, 2020 at 8:03 amIt’s easier to do now that scripting has access to comp markers. Something like this should work:
var theComp = app.project.activeItem;
var theLayers = theComp.selectedLayers;
var theMarker = new MarkerValue("");
for (var i = 0; i < theLayers.length; i++){
theMarker.comment = theLayers[i].name;
theComp.markerProperty.setValueAtTime(theLayers[i].inPoint,theMarker);
}
-
Shashank Raghu
September 21, 2021 at 11:49 amHi Dan, is there a way to copy markers from one layer and move them to another layer?
-
Andrei Popa
September 21, 2021 at 12:36 pmHere is a script made by Jeff Almasol, that could be downloaded from his website, redefinery.com, when it was not offline.
https://www.dropbox.com/s/2adn48jkkpaqyus/rd_CopyMarkers.jsx?dl=0
Reply to this Discussion! Login or Sign Up