Don't create orientation slots for all spaces

Trying to create orientation slots for all spaces could potentially
involve a lot of duplicate method calls because blender has no way to
query the list of existing orientation slots, so we can't check to see
if setting a slot is necessary.

So this patch now simply creates/overwrites and uses a single
orientation slot whenever the user switches the default spatial
container, and then only if the spatial orientation is non-world.
This commit is contained in:
Bruno Postle
2025-03-14 19:17:50 +00:00
parent 14f5aa7c4f
commit 7d4a017c15
2 changed files with 0 additions and 6 deletions
@@ -239,7 +239,6 @@ class ImportSpatialDecomposition(bpy.types.Operator):
def execute(self, context):
core.import_spatial_decomposition(tool.Spatial)
core.create_orientation_slots(ifc=tool.Ifc, spatial=tool.Spatial)
return {"FINISHED"}
-5
View File
@@ -121,11 +121,6 @@ def import_spatial_decomposition(spatial: tool.Spatial) -> None:
spatial.import_spatial_decomposition()
def create_orientation_slots(ifc: tool.Ifc, spatial: tool.Spatial) -> None:
products = ifc.get().by_type("IfcSpatialElement")
spatial.create_orientation_slots(products, use=False)
def set_orientation_slot(spatial: tool.Spatial, product: ifcopenshell.entity_instance) -> None:
spatial.create_orientation_slots([product], use=True)