diff --git a/src/blenderbim/blenderbim/core/spatial.py b/src/blenderbim/blenderbim/core/spatial.py index 1d7c79246b..139eeef46a 100644 --- a/src/blenderbim/blenderbim/core/spatial.py +++ b/src/blenderbim/blenderbim/core/spatial.py @@ -189,7 +189,8 @@ def generate_space(ifc, spatial, model, Type): name = "Space" obj = spatial.get_named_obj_from_mesh(name, mesh) - spatial.set_obj_origin_to_cursor_position(obj) + spatial.set_obj_origin_to_cursor_position_and_zero_elevation(obj) + spatial.traslate_obj_to_z_location(obj, z) spatial.link_obj_to_active_collection(obj) spatial.assign_ifcspace_class_to_obj(obj) diff --git a/src/blenderbim/blenderbim/core/tool.py b/src/blenderbim/blenderbim/core/tool.py index 470987661a..d832bae89b 100644 --- a/src/blenderbim/blenderbim/core/tool.py +++ b/src/blenderbim/blenderbim/core/tool.py @@ -873,7 +873,7 @@ class Spatial: def edit_active_space_obj_from_mesh(cls, mesh): pass def set_obj_origin_to_bboxcenter(cls, obj): pass def set_obj_origin_to_bboxcenter_and_zero_elevation(cls, obj): pass - def set_obj_origin_to_cursor_position(cls, obj): pass + def set_obj_origin_to_cursor_position_and_zero_elevation(cls, obj): pass def get_selected_objects(cls): pass def get_active_obj(cls): pass def get_active_obj_z(cls): pass diff --git a/src/blenderbim/blenderbim/tool/spatial.py b/src/blenderbim/blenderbim/tool/spatial.py index 0f2dc4d9c4..94fde8ab6e 100644 --- a/src/blenderbim/blenderbim/tool/spatial.py +++ b/src/blenderbim/blenderbim/tool/spatial.py @@ -601,14 +601,14 @@ class Spatial(blenderbim.core.tool.Spatial): obj.location = newLoc @classmethod - def set_obj_origin_to_cursor_position(cls, obj): + def set_obj_origin_to_cursor_position_and_zero_elevation(cls, obj): 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 - z = collection_obj.matrix_world.translation.z + z = 0 oldLoc = obj.location newLoc = Vector((x, y, z))