fix generate space and covering where objects weren't created in the right location

This commit is contained in:
Massimo Fabbro
2023-10-11 21:51:15 +02:00
committed by Massimo Fabbro
parent bf43efe509
commit a99529cb1e
2 changed files with 1 additions and 5 deletions
+1 -1
View File
@@ -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)
@@ -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