Script-generated markers not snapping to whole frames
Hello, I'm running a custom script through ExtendScript Developer Tools that creates markers to match clips/graphics on a specified track. It matches the in point and duration, and pulls the name from an element of the graphic.
//PLUS DURATION, MATCH BURN NAME:
var markers = app.project.activeSequence.markers;
var track = app.project.activeSequence.videoTracks[3];
var numClips = track.clips.numItems;
for(a=0;a<numClips;a++){
var labelName = (track.clips[a].components[3].instanceName);
var newMark = markers.createMarker(track.clips[a].start.seconds);
newMark.end = (track.clips[a].start.seconds)+(track.clips[a].duration.seconds);
newMark.name = 'LAM_119_'+labelName;
}
I then use another script I to export clips from those markers. I didn't write this second script so I don't exactly know what it's doing, but it gives me an error saying "MARKERS NOT ON WHOLE FRAMES" and "start not snapped" or "end not snapped" Once I go through and manually snap them it works fine. But that is incredibly tedious.
I've tried modifying my marker creation script to round up (see below), but I still get errors. It doesn't make sense why the markers would be placing points not on whole frames, since the edits are definitely falling on them.
// SNAP ATTEMPT
var markers = app.project.activeSequence.markers;
var track = app.project.activeSequence.videoTracks[3];
var numClips = track.clips.numItems;
for (var a = 0; a < numClips; a++) {
var labelName = track.clips[a].components[3].instanceName;
var start = track.clips[a].start.seconds;
var duration = track.clips[a].duration.seconds;
// Round start and duration to the nearest tenth
start = Math.round(start * 10) / 10; // Round start to the nearest tenth
duration = Math.round(duration * 10) / 10; // Round duration to the nearest tenth
var newMark = markers.createMarker(start);
newMark.end = start + duration;
newMark.name = 'LAM_107_' + labelName;
}
Thanks in advance!
