Blender Kitsu: Refactor Shot Builder #183

Merged
Nick Alberelli merged 55 commits from TinyNick/blender-studio-pipeline:feature/shot-builder-2 into main 2023-12-21 23:58:21 +01:00
2 changed files with 12 additions and 6 deletions
Showing only changes of commit bba3209067 - Show all commits

View File

@ -84,13 +84,18 @@ def set_resolution_and_fps(project: Project, scene: bpy.types.Scene):
scene.render.resolution_percentage = 100
def get_3d_start(shot: Shot):
if shot.data and shot.data.get("3d_start"): # shot.data and
return int(shot.data.get("3d_start"))
else:
return 101 # TODO Set in Constants
def set_frame_range(shot: Shot, scene: bpy.types.Scene):
start_3d = (
int(shot.data.get("3d_start"))
if shot.data.get("3d_start")
else 101 # TODO Set in Constants
)
start_3d = get_3d_start(shot)
scene.frame_start = start_3d
if not shot.nb_frames:
raise Exception(f"{shot.name} has missing frame duration information")
scene.frame_end = start_3d + shot.nb_frames - 1

View File

@ -2,6 +2,7 @@ import bpy
from .. import prefs
from pathlib import Path
import re
from .core import get_3d_start
def editorial_export_get_latest(
@ -40,7 +41,7 @@ def editorial_export_get_latest(
# Update shift frame range prop.
frame_in = shot.data.get("frame_in")
frame_3d_start = shot.data.get("3d_start")
frame_3d_start = get_3d_start(shot)
frame_3d_offset = frame_3d_start - addon_prefs.shot_builder_frame_offset
edit_export_offset = addon_prefs.edit_export_frame_offset