Cut layer through Marker

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
HariVu
Posts: 2
Joined: March 23rd, 2017, 8:58 pm

March 28th, 2017, 4:35 am

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">
HariVu
Posts: 2
Joined: March 23rd, 2017, 8:58 pm

March 29th, 2017, 7:33 pm

Anyone can tell me the answer? 
runegan
Posts: 22
Joined: November 4th, 2016, 3:18 pm
Contact:

March 30th, 2017, 1:29 am

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
Post Reply