export background

This commit is contained in:
“christopheseux”
2023-05-19 11:51:05 +02:00
parent 48dddb1905
commit beb85721a9
10 changed files with 416 additions and 120 deletions
+12 -17
View File
@@ -137,7 +137,7 @@ def get_strip_render_path(strip, template):
strip_data = parse(strip.name, template=project.shot_template)
print(strip_data)
#print(strip_data)
index = int(strip_data['index'])
@@ -234,36 +234,31 @@ def render_strips(strips, template):
scn.render.filepath = render_path
'''
def render_strips(strips, template):
def render_strip(strip, output):
output = os.path.abspath(bpy.path.abspath(output))
scn = bpy.context.scene
scene_start = scn.frame_start
scene_end = scn.frame_end
scene_current = scn.frame_current
render_path = scn.render.filepath
for strip in strips:
scn.frame_start = strip.frame_final_start
scn.frame_end = strip.frame_final_end - 1
scn.render.filepath = str(get_strip_render_path(strip, template))
scn.frame_start = strip.frame_final_start
scn.frame_end = strip.frame_final_end - 1
scn.render.filepath = output
print(f'Render Strip to {scn.render.filepath}')
bpy.ops.render.opengl(animation=True, sequencer=True)
print(f'Render Strip to {scn.render.filepath}')
bpy.ops.render.opengl(animation=True, sequencer=True)
scn.frame_start = scene_start
scn.frame_end = scene_end
scn.frame_current = scene_current
scn.render.filepath = render_path
def import_edit(filepath, adapter="cmx_3600", channel='Shots'):
opentimelineio = install_module('opentimelineio')
from opentimelineio.schema import (
Clip,
ExternalReference,
Gap,
ImageSequenceReference,
Stack,
Timeline,
Track,
)
from opentimelineio.schema import Clip
scn = bpy.context.scene
sequencer = scn.sequence_editor.sequences