Skip to main content
Participant
December 14, 2023
Answered

Set duration of marker with PPro CEP

  • December 14, 2023
  • 2 replies
  • 369 views

I'm working on a CEP extension and I need to add sequence markers. I am able to create markers, but I can't make them have a duration. I've tried using .start and .end, both with setting ticks and seconds. Here's my code right now, everything works except the marker still being a single point:

 

openDocument : function(timestamp, colorIndex) {
		var activeSequence = app.project.activeSequence;
		if (activeSequence) {
			var markers = activeSequence.markers;
			var tempTime = new Time(); // Use a local time object to take care of all the tick math
			var newCommentMarker = markers.createMarker(12.345);
			
			newCommentMarker.name = 'Marker created by PProPanel.';
			newCommentMarker.comments = 'Here are some comments, inserted by PProPanel.';
			
			tempTime.seconds = 15.6789;
			newCommentMarker.end.ticks = tempTime.ticks
			tempTime.seconds = 11.6789;
			newCommentMarker.start.ticks = tempTime.ticks
			newCommentMarker.setColorByIndex(colorIndex);
		}
	}

 

Does anyone know how to get this to work? I want this

and not this.

Thanks in advance!

This topic has been closed for replies.
Correct answer GRADY34215535o5gk

Fixed with this post!

openDocument : function(timestamp, colorIndex) {
		var activeSequence = app.project.activeSequence;
		if (activeSequence) {
			var markers = activeSequence.markers;
			if (markers){
				var newCommentMarker      = markers.createMarker(timestamp);
				newCommentMarker.name     = "Name"
				newCommentMarker.comments = "Comments"
				newCommentMarker.end      = (newCommentMarker.start.seconds + 5.0);
				newCommentMarker.setColorByIndex(colorIndex);
			}
		}
	}

 

2 replies

Mathias Moehl
Community Expert
Community Expert
December 14, 2023

For me it works if I set the end time in seconds, like

newCommentMarker.end = tempTime.seconds
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
GRADY34215535o5gkAuthorCorrect answer
Participant
December 14, 2023

Fixed with this post!

openDocument : function(timestamp, colorIndex) {
		var activeSequence = app.project.activeSequence;
		if (activeSequence) {
			var markers = activeSequence.markers;
			if (markers){
				var newCommentMarker      = markers.createMarker(timestamp);
				newCommentMarker.name     = "Name"
				newCommentMarker.comments = "Comments"
				newCommentMarker.end      = (newCommentMarker.start.seconds + 5.0);
				newCommentMarker.setColorByIndex(colorIndex);
			}
		}
	}