From a99529cb1e5cc8070a60bd8e1d52b71306fae8fb Mon Sep 17 00:00:00 2001 From: Massimo Fabbro Date: Wed, 11 Oct 2023 21:51:15 +0200 Subject: [PATCH] fix generate space and covering where objects weren't created in the right location --- src/blenderbim/blenderbim/core/spatial.py | 2 +- src/blenderbim/blenderbim/tool/spatial.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/blenderbim/blenderbim/core/spatial.py b/src/blenderbim/blenderbim/core/spatial.py index 3f3b5cdb42..41307096c3 100644 --- a/src/blenderbim/blenderbim/core/spatial.py +++ b/src/blenderbim/blenderbim/core/spatial.py @@ -164,7 +164,7 @@ def generate_space(ifc, spatial, model, Type): else: name = "Space" - obj = spatial.get_named_obj_from_mesh(name, mesh) ##mat + obj = spatial.get_named_obj_from_mesh(name, mesh) spatial.set_obj_origin_to_cursor_position(obj) spatial.link_obj_to_active_collection(obj) spatial.assign_ifcspace_class_to_obj(obj) diff --git a/src/blenderbim/blenderbim/tool/spatial.py b/src/blenderbim/blenderbim/tool/spatial.py index d7e51404c8..95ee9bffbc 100644 --- a/src/blenderbim/blenderbim/tool/spatial.py +++ b/src/blenderbim/blenderbim/tool/spatial.py @@ -525,9 +525,6 @@ class Spatial(blenderbim.core.tool.Spatial): @classmethod def get_named_obj_from_mesh(cls, name, mesh): obj = bpy.data.objects.new(name, mesh) - if bpy.context.active_object: - mat = bpy.context.active_object.matrix_world - obj.matrix_world = mat return obj @classmethod @@ -566,7 +563,6 @@ class Spatial(blenderbim.core.tool.Spatial): mat = obj.matrix_world inverted = mat.inverted() - collection = bpy.context.view_layer.active_layer_collection.collection collection_obj = collection.BIMCollectionProperties.obj x, y = bpy.context.scene.cursor.location.xy