Blender Kitsu: Refactor Shot Builder #183
@ -45,8 +45,26 @@ def set_render_engine(scene: bpy.types.Scene, engine='CYCLES'):
|
||||
scene.render.engine = engine
|
||||
|
||||
|
||||
def remove_all_data():
|
||||
for lib in bpy.data.libraries:
|
||||
bpy.data.libraries.remove(lib)
|
||||
|
||||
for col in bpy.data.collections:
|
||||
bpy.data.collections.remove(col)
|
||||
|
||||
for obj in bpy.data.objects:
|
||||
bpy.data.objects.remove(obj)
|
||||
|
||||
bpy.ops.outliner.orphans_purge(
|
||||
do_local_ids=True, do_linked_ids=True, do_recursive=True
|
||||
)
|
||||
|
||||
|
||||
def set_shot_scene(context: bpy.types.Context, scene_name: str) -> bpy.types.Scene:
|
||||
print(f"create scene with name {scene_name}")
|
||||
for scene in bpy.data.scenes:
|
||||
scene.name = 'REMOVE-' + scene.name
|
||||
|
||||
keep_scene = bpy.data.scenes.new(name=scene_name)
|
||||
for scene in bpy.data.scenes:
|
||||
if scene.name == scene_name:
|
||||
|
@ -148,6 +148,7 @@ class KITSU_OT_build_new_shot(bpy.types.Operator):
|
||||
# Set Up Scene + Naming
|
||||
shot_task_name = shot.get_shot_task_name(task_type)
|
||||
scene = set_shot_scene(context, shot_task_name)
|
||||
remove_all_data()
|
||||
set_resolution_and_fps(active_project, scene)
|
||||
set_frame_range(shot, scene)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user