From e9b4b6560ee911555958fe907cc59cb331def95a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 22 Aug 2024 18:29:27 +0500 Subject: [PATCH] drawing.create_camera not to assign camera to the scene collection Noticed that added drawing camera was linked to the scene collection and after collector.assign it was linked to the 2 collections instead of just 1 - it's own drawing collection and the scene collection. --- src/bonsai/bonsai/tool/drawing.py | 1 - src/bonsai/test/tool/test_drawing.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/tool/drawing.py b/src/bonsai/bonsai/tool/drawing.py index b05858e926..9e5eee0a96 100644 --- a/src/bonsai/bonsai/tool/drawing.py +++ b/src/bonsai/bonsai/tool/drawing.py @@ -265,7 +265,6 @@ class Drawing(bonsai.core.tool.Drawing): else: camera.data.BIMCameraProperties.diagram_scale = "1:100|1/100" camera.matrix_world = matrix - bpy.context.scene.collection.objects.link(camera) return camera @classmethod diff --git a/src/bonsai/test/tool/test_drawing.py b/src/bonsai/test/tool/test_drawing.py index 4397d3ff24..ac522ab8cf 100644 --- a/src/bonsai/test/tool/test_drawing.py +++ b/src/bonsai/test/tool/test_drawing.py @@ -61,7 +61,7 @@ class TestCreateCamera(NewFile): assert obj.data.type == "PERSP" assert obj.data.ortho_scale == 50 assert obj.data.clip_end == 10 - assert obj.users_collection[0] == bpy.context.scene.collection + assert obj.users_collection == tuple() class TestCreateSvgSheet(NewFile):