individual split to scenes

1.4.0

- added: split selection to scenes individually
This commit is contained in:
pullusb
2023-06-26 18:11:17 +02:00
parent 771a481262
commit f6be9c056d
5 changed files with 39 additions and 13 deletions
+6 -4
View File
@@ -1512,12 +1512,14 @@ def remove_scene_nodes_by_obj_names(scn, name_list, negative=False):
if (n.parent and n.parent.label in name_list) or (n.type == 'FRAME' and n.label in name_list):
scn.node_tree.nodes.remove(n)
def split_object_to_scene():
def split_object_to_scene(objs=None, scene_name=None):
'''Create a new scene from object selection'''
active = bpy.context.object
scene_name = active.name
objs = [o for o in bpy.context.selected_objects]
if not scene_name:
active = bpy.context.object
scene_name = active.name
if not objs:
objs = [o for o in bpy.context.selected_objects]
if bpy.data.scenes.get(scene_name):
print(f'Scene "{scene_name}" Already Exists')