Wanted to see if anyone has any experience using the .overwrite() and insert() methods? I’ve been getting very strange and inconsistent results with them where the edit is being made at a totally different frame than the PyTime object I’m passing to it.
Here’s the script I’m trying to write. I want it to cut in reference for any unlinked clips it finds on the timeline. When I run it in the console it fetches the reference just fine but all the overwrites are done on a seemingly arbitrary frame.
import flame
tl = flame.projects.current_project.current_workspace.desktop.reel_groups[0].reels[0].sequences[-1]
ref_layer = tl.versions[0].tracks[0]
main_layers = tl.versions[1]
ref = flame.find_by_name(ref_layer.segments[1].name.get_value())[0]
for track in main_layers.tracks :
for segment in track.segments :
if segment.type == 'Unlinked Video' :
ref.in_mark = segment.record_in
ref.out_mark = segment.record_out + 1
tl.overwrite(ref, segment.record_in, track)
For what it’s worth, I rewrote it using execute_shortcut() to trigger a normal overwrite like this and it works fine, but executes very slowly:
import flame
tl = flame.projects.current_project.current_workspace.desktop.reel_groups[0].reels[0].sequences[-1]
ref_layer = tl.versions[0].tracks[0]
main_layers = tl.versions[1]
ref = flame.find_by_name(ref_layer.segments[1].name.get_value())[0]
for track in main_layers.tracks :
for segment in track.segments :
if segment.type == 'Unlinked Video' :
tl.in_mark = segment.record_in
tl.primary_track = track
ref.in_mark = segment.record_in
ref.out_mark = segment.record_out + 1
flame.execute_shortcut('Overwrite Edit')
Any idea what might be causing the first one to behave so unpredictably? is the overwrite() method maybe just busted?