diff --git a/__init__.py b/__init__.py index a38388e..18df43f 100644 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,7 @@ bl_info = { "name": "Background plane manager", "description": "Manage the background image planes and grease pencil object relative to a camera", "author": "Samuel Bernou", - "version": (0, 5, 1), + "version": (0, 5, 2), "blender": (3, 5, 0), "location": "View3D", "warning": "", diff --git a/operators/manage_objects.py b/operators/manage_objects.py index 45e7e61..3acf120 100644 --- a/operators/manage_objects.py +++ b/operators/manage_objects.py @@ -348,7 +348,10 @@ class BPM_OT_create_and_place_in_camera(Operator): l = gp_data.layers.new('GP_Layer') 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 new_item = context.scene.bg_props.planes.add()