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 21 additions and 0 deletions
Showing only changes of commit 339e340a26 - Show all commits

View File

@ -39,3 +39,23 @@ def set_render_engine(scene: bpy.types.Scene, engine='CYCLES'):
""" """
scene.render.engine = engine scene.render.engine = engine
def task_type_anim_output_collection(
scene: bpy.types.Scene, shot: Shot, task_type: TaskType
) -> bpy.types.Collection:
collections = bpy.data.collections
output_col_name = shot.get_output_collection_name(task_type)
if not collections.get(output_col_name):
bpy.data.collections.new(name=output_col_name)
output_collection = collections.get(output_col_name)
output_collection.use_fake_user = True
if not scene.collection.children.get(output_col_name):
scene.collection.children.link(output_collection)
for view_layer in scene.view_layers:
view_layer_output_collection = view_layer.layer_collection.children.get(
output_col_name
)
view_layer_output_collection.exclude = True
return output_collection

View File

@ -142,6 +142,7 @@ class KITSU_OT_build_new_shot(bpy.types.Operator):
else: else:
set_render_engine(context.scene) set_render_engine(context.scene)
output_col = task_type_anim_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}'")
print(f"Shot Name: '{shot.name}' Shot ID: '{self.shot_id}'") print(f"Shot Name: '{shot.name}' Shot ID: '{self.shot_id}'")