mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
fix generate space and covering where objects weren't created in the right location
This commit is contained in:
committed by
Massimo Fabbro
parent
bf43efe509
commit
a99529cb1e
@@ -164,7 +164,7 @@ def generate_space(ifc, spatial, model, Type):
|
|||||||
else:
|
else:
|
||||||
name = "Space"
|
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.set_obj_origin_to_cursor_position(obj)
|
||||||
spatial.link_obj_to_active_collection(obj)
|
spatial.link_obj_to_active_collection(obj)
|
||||||
spatial.assign_ifcspace_class_to_obj(obj)
|
spatial.assign_ifcspace_class_to_obj(obj)
|
||||||
|
|||||||
@@ -525,9 +525,6 @@ class Spatial(blenderbim.core.tool.Spatial):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_named_obj_from_mesh(cls, name, mesh):
|
def get_named_obj_from_mesh(cls, name, mesh):
|
||||||
obj = bpy.data.objects.new(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
|
return obj
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -566,7 +563,6 @@ class Spatial(blenderbim.core.tool.Spatial):
|
|||||||
mat = obj.matrix_world
|
mat = obj.matrix_world
|
||||||
inverted = mat.inverted()
|
inverted = mat.inverted()
|
||||||
|
|
||||||
|
|
||||||
collection = bpy.context.view_layer.active_layer_collection.collection
|
collection = bpy.context.view_layer.active_layer_collection.collection
|
||||||
collection_obj = collection.BIMCollectionProperties.obj
|
collection_obj = collection.BIMCollectionProperties.obj
|
||||||
x, y = bpy.context.scene.cursor.location.xy
|
x, y = bpy.context.scene.cursor.location.xy
|
||||||
|
|||||||
Reference in New Issue
Block a user