mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Fix create space from cursor bug where spaces were created always in zero elevation
This commit is contained in:
committed by
Massimo Fabbro
parent
f021041b31
commit
74da327803
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user