fix new collection not being added in scene

master
pullusb 2024-07-08 12:25:18 +02:00
parent 129ecb72cf
commit d0a413b4bf
2 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,7 @@ bl_info = {
"name": "Background plane manager", "name": "Background plane manager",
"description": "Manage the background image planes and grease pencil object relative to a camera", "description": "Manage the background image planes and grease pencil object relative to a camera",
"author": "Samuel Bernou", "author": "Samuel Bernou",
"version": (0, 5, 1), "version": (0, 5, 2),
"blender": (3, 5, 0), "blender": (3, 5, 0),
"location": "View3D", "location": "View3D",
"warning": "", "warning": "",

View File

@ -348,7 +348,10 @@ class BPM_OT_create_and_place_in_camera(Operator):
l = gp_data.layers.new('GP_Layer') l = gp_data.layers.new('GP_Layer')
l.frames.new(context.scene.frame_current) l.frames.new(context.scene.frame_current)
core.set_collection(ob, 'GP') # Gpencils gp_col = core.set_collection(ob, 'GP') # Gpencils
## Add Collection to current scene
if not gp_col in context.scene.collection.children_recursive:
context.scene.collection.children.link(gp_col)
# Add to bg_plane collection # Add to bg_plane collection
new_item = context.scene.bg_props.planes.add() new_item = context.scene.bg_props.planes.add()