Page 1 of 1

Cut layer through Marker

Posted: March 28th, 2017, 4:35 am
by HariVu
I'm trying to cut layer through markers in buttom layer.
But It's startTime at each marker only, not inPoint.
I know inPoint must equal a number, but i don't know how to fix it. Anyone help me out with it?
Thanks a lot!
I have this:
var thisComp = app.project.activeItem;
var myLayer = thisComp.selectedLayers[0];   

var numMarkers = myLayer.marker.numKeys; 

for (i = 1; i <= numMarkers; i++) {
    thisComp.layer(i).inPoint = myLayer.marker.keyTime(i);
    }
Image">

Re: Cut layer through Marker

Posted: March 29th, 2017, 7:33 pm
by HariVu
Anyone can tell me the answer? 

Re: Cut layer through Marker

Posted: March 30th, 2017, 1:29 am
by runegan
I'm guessing you are trying to set the inPoint of the layers without moving the outPoint?
Your code works when used on comp/footage layers, but when used on solids the outpoint is also moved, but any keyframes stay in place, so the only thing you have to do is store the outPoint before setting the inPoint, then set the outPoint to the saved value.

Code: Select all

var thisComp = app.project.activeItem;
var myLayer = thisComp.selectedLayers[0];

var numMarkers = myLayer.marker.numKeys;

for (i = 1; i <= numMarkers; i++) {
  var layer = thisComp.layer(i);
  var outPoint = layer.outPoint;
  layer.inPoint = myLayer.marker.keyTime(i);
  layer.outPoint = outPoint;
}
Hope that helps