Blender Kitsu: Refactor Shot Builder #183
@ -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
|
||||||
|
@ -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}'")
|
||||||
|
Loading…
Reference in New Issue
Block a user