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 4 years, 7 months ago 7 Members · 24 Replies
-
Dan Ebberts
July 13, 2016 at 8:13 pm>I tried placing it in Ae Scripts folder
That should work. You have to restart AE though. Then it should just be File > Scripts > select your script from the list.
Dan
-
Roei Tzoref
July 13, 2016 at 8:18 pmI thought so too… tried it again and it works. probably I did something wrong before.
thank you Dan you did it again.
BTW I also posted a feature request to make copy layer markers to comp marker a feature. hope someone will notice. doing my little part. and of course If I ever come across somebody looking for a way to copy layer markers to comp markers – will give him that Jsx.
thanks.
-
Roei Tzoref
November 6, 2017 at 12:24 pmHi Dan and everyone.
returning to this thread after a while. 5 months after the initial post, Ae released the November update (Ae CC 2017 14.0) with extended scripting support to various things including Comp Markers.
so surely now there’s a way to copy layer markers to comp markers and retain the comment, right? if I may be so bold to ask you to revise the script. of course if you feel this is a tool worth publishing and getting paid for, i would buy that tool but no scripting tool available.
Thank you.
Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com -
Dan Ebberts
November 6, 2017 at 4:51 pmI fleshed it out a little:
function CopyLayerMarkersToComp(){
var theComp = app.project.activeItem;
if ((theComp == null) || ! (theComp instanceof CompItem)){
alert ("No comp active.");
return;
}
if (theComp.selectedLayers.length == 0){
alert("No layer selected.");
return;
}
var theLayer = theComp.selectedLayers[0];
var theMarker = new MarkerValue("");
var theTime;
for (var i = 1; i <= theLayer.property("Marker").numKeys; i++){
theTime = theLayer.property("Marker").keyTime(i);
theMarker = theLayer.property("Marker").keyValue(i);
theComp.markerProperty.setValueAtTime(theTime,theMarker);
}
}
CopyLayerMarkersToComp();
Dan
-
Roei Tzoref
November 6, 2017 at 8:13 pmGreat. thanks Dan for putting this out there.
Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com -
Fernando Almeida
October 27, 2018 at 7:27 pmIs it possible invert this action?
Send comp markers to marker layer. -
Dan Ebberts
October 27, 2018 at 7:52 pmSomething like this:
var myComp = app.project.activeItem;
var myLayer = myComp.selectedLayers[0];var sourceProp = myComp.markerProperty;
var destProp = myLayer.property("Marker");for (var i = 1; i <= sourceProp.numKeys; i++){
destProp.setValueAtTime(sourceProp.keyTime(i),sourceProp.keyValue(i));
}
Dan
-
Fernando Almeida
October 28, 2018 at 2:37 amDan Thanks very much for your help!
Very very useful script, Congrats
See you -
Dan Ebberts
April 22, 2020 at 3:32 pmThis should work:
function CopyLayerMarkersToComp(){
var theComp = app.project.activeItem;
if ((theComp == null) || ! (theComp instanceof CompItem)){
alert ("No comp active.");
return;
}
if (theComp.selectedLayers.length == 0){
alert("No layer selected.");
return;
}
var theLayers = theComp.selectedLayers;
var theLayer;
var theMarker = new MarkerValue("");
var theTime;
for (var i = 0; i < theLayers.length;i++){
theLayer = theLayers[i];
for (var j = 1; j <= theLayer.property("Marker").numKeys; j++){
theTime = theLayer.property("Marker").keyTime(j);
theMarker = theLayer.property("Marker").keyValue(j);
theComp.markerProperty.setValueAtTime(theTime,theMarker);
}
}
}
CopyLayerMarkersToComp();
Of course only one comp marker can exist at a given time, so if two selected layers have markers at the same time, the layer selected last wins.
Dan
Reply to this Discussion! Login or Sign Up