Flame PyTime in a sequence

I’m trying to learn from an existing script (John Geehreng’s ‘Set In Point at Two Sec’)

He uses flame.PyTime(61) to set the in mark two seconds in. Is it possible to set the marker at a specific timecode? Not sure how it would work with timecode like 1:00:00.


The PyTime has 3 constructors one of which take a timecode and frame_rate
So you could use flame.PyTime(“00:01:00:00”, clip.frame_rate)


Brilliant Philippe! It looks like I needed the full timecode/frame rate.

Now is there a way to set a mark relative to the end of the sequence? I can get a frame relative to the beginning but I’m trying to set the out mark at the last frame minus 24 frames.

something in this one should help you:

Postings_IO.py (1.1 KB)

Thanks John! I’ll dig in to it this weekend.

Couple things I learned thanks to John’s post:

If you’re going to do something like:

clip.out_mark = int(clip.duration.frame)-23

You need to first clear the In Marker if you want to consider the whole duration of the clip. If there’s an in mark, the duration will be different from the ‘whole’ duration. So it’s good to start with:

clip.in_mark = None
clip.out_mark = None

And then, from cutting and pasting code, I realized I had ‘clip’ in some places and ‘sequence’ in others. I had to clean that up and make it all consistent.

Thanks for the help guys. I have one script now that will set in/out on all selected clips depending on whether I am posting for approval or delivering with slates.


1 Like