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
3 changed files with 24 additions and 5 deletions
Showing only changes of commit eef16cf6a1 - Show all commits

View File

@ -90,3 +90,20 @@ RES_DIR_PATH = Path(os.path.abspath(__file__)).parent.joinpath("res")
SCENE_NAME_PLAYBLAST = "playblast_playback" SCENE_NAME_PLAYBLAST = "playblast_playback"
PLAYBLAST_DEFAULT_STATUS = "Todo" PLAYBLAST_DEFAULT_STATUS = "Todo"
###########################
# Shot Builder Properties
###########################
OUTPUT_COL_CREATE = {
"anim": True,
"comp": False,
"fx": True,
"layout": True,
"lighting": True,
"previz": True,
"rendering": False,
"smear_to_mesh": False,
"storyboard": True,
}

View File

@ -141,7 +141,7 @@ def link_camera_rig(
scene.camera = camera scene.camera = camera
def task_type_anim_output_collection( def task_type_output_collection(
scene: bpy.types.Scene, shot: Shot, task_type: TaskType scene: bpy.types.Scene, shot: Shot, task_type: TaskType
) -> bpy.types.Collection: ) -> bpy.types.Collection:
collections = bpy.data.collections collections = bpy.data.collections

View File

@ -1,4 +1,5 @@
import bpy import bpy
from .. import bkglobals
from pathlib import Path from pathlib import Path
from typing import List, Any, Tuple, Set, cast from typing import List, Any, Tuple, Set, cast
from .. import prefs, cache from .. import prefs, cache
@ -6,7 +7,7 @@ from .core import (
get_file_dir, get_file_dir,
set_render_engine, set_render_engine,
link_camera_rig, link_camera_rig,
task_type_anim_output_collection, task_type_output_collection,
set_shot_scene, set_shot_scene,
set_resolution_and_fps, set_resolution_and_fps,
set_frame_range, set_frame_range,
@ -132,6 +133,7 @@ class KITSU_OT_build_new_shot(bpy.types.Operator):
seq = active_project.get_sequence(self.seq_id) seq = active_project.get_sequence(self.seq_id)
shot = active_project.get_shot(self.shot_id) shot = active_project.get_shot(self.shot_id)
task_type = self._get_task_type_for_shot(context, shot) task_type = self._get_task_type_for_shot(context, shot)
task_short_name = task_type.get_short_name()
# Set Up Scene + Naming # Set Up Scene + Naming
shot_task_name = shot.get_shot_task_name(task_type) shot_task_name = shot.get_shot_task_name(task_type)
@ -146,14 +148,14 @@ class KITSU_OT_build_new_shot(bpy.types.Operator):
# Set Render Settings # Set Render Settings
if ( if (
task_type.get_short_name() == 'anim' task_short_name == 'anim'
): # TODO get anim from a constant instead ): # TODO get anim from a constant instead
set_render_engine(context.scene, 'BLENDER_WORKBENCH') set_render_engine(context.scene, 'BLENDER_WORKBENCH')
else: else:
set_render_engine(context.scene) set_render_engine(context.scene)
output_col = task_type_anim_output_collection(context.scene, shot, task_type) if bkglobals.OUTPUT_COL_CREATE.get(task_short_name):
link_camera_rig(context.scene, output_col) output_col = task_type_output_collection(context.scene, shot, task_type)
print("Create shot with the following details") # TODO Remove print("Create shot with the following details") # TODO Remove
print(f"Seq Name: '{seq.name}' Seq ID: '{self.seq_id}'") print(f"Seq Name: '{seq.name}' Seq ID: '{self.seq_id}'")