preserve clip
parent
afb8826a72
commit
0cb0ace891
|
@ -237,7 +237,7 @@ def render_strips(strips, template):
|
||||||
scn.frame_end = scene_end
|
scn.frame_end = scene_end
|
||||||
scn.render.filepath = render_path
|
scn.render.filepath = render_path
|
||||||
|
|
||||||
def import_edit(filepath, adapter="cmx_3600", clean_sequencer=False):
|
def import_edit(filepath, adapter="cmx_3600", clear=False):
|
||||||
import opentimelineio as otio
|
import opentimelineio as otio
|
||||||
from opentimelineio.schema import (
|
from opentimelineio.schema import (
|
||||||
Clip,
|
Clip,
|
||||||
|
@ -250,15 +250,11 @@ def import_edit(filepath, adapter="cmx_3600", clean_sequencer=False):
|
||||||
)
|
)
|
||||||
|
|
||||||
scn = bpy.context.scene
|
scn = bpy.context.scene
|
||||||
sequences = scn.sequence_editor.sequences
|
sequencer = scn.sequence_editor.sequences
|
||||||
|
|
||||||
if clean_sequencer:
|
if clear:
|
||||||
movie = get_strips(channel='Movie')
|
for strip in get_strips(channel='Shots'):
|
||||||
audio = get_strips(channel='Audio')
|
sequencer.remove(strip)
|
||||||
|
|
||||||
for strip in sequences:
|
|
||||||
if strip not in (movie+audio):
|
|
||||||
sequences.remove(strip)
|
|
||||||
|
|
||||||
edl = Path(filepath)
|
edl = Path(filepath)
|
||||||
try:
|
try:
|
||||||
|
@ -293,6 +289,14 @@ def import_edit(filepath, adapter="cmx_3600", clean_sequencer=False):
|
||||||
child.range_in_parent().duration)
|
child.range_in_parent().duration)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
strip = next((s for s in sequencer.sequences if s.vsetb_strip_settings.source_name == child.name))
|
||||||
|
if strip:
|
||||||
|
if frame_start != strip.frame_final_start or frame_end !=strip.frame_final_end:
|
||||||
|
self.report({'INFO'}, f'The strip {strip.name} is updated with new range')
|
||||||
|
|
||||||
|
strip.frame_final_start = frame_start
|
||||||
|
strip.frame_final_end = frame_end
|
||||||
|
else:
|
||||||
strip = sequences.new_effect(
|
strip = sequences.new_effect(
|
||||||
name=child.name,
|
name=child.name,
|
||||||
type='COLOR',
|
type='COLOR',
|
||||||
|
@ -300,6 +304,7 @@ def import_edit(filepath, adapter="cmx_3600", clean_sequencer=False):
|
||||||
frame_start=frame_start,
|
frame_start=frame_start,
|
||||||
frame_end=frame_end,
|
frame_end=frame_end,
|
||||||
)
|
)
|
||||||
|
|
||||||
strip.blend_alpha = 0.0
|
strip.blend_alpha = 0.0
|
||||||
strip.select = False
|
strip.select = False
|
||||||
strip.vsetb_strip_settings.source_name = child.name
|
strip.vsetb_strip_settings.source_name = child.name
|
||||||
|
|
Loading…
Reference in New Issue