No support for setting up blender orientation slots for multiple
containers or for non-spatial elements. Setting the default container
switches to an appropriate orientation slot if the orientation of this
container isn't global.
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.
create_orientation_slots() can be given an element and it will find the
highest matching parent product orientation via elements and/or
spatial elements
relating_type_id now relies on type_elements which relies on ifc_class_current and they wasn't updated when ifc_class was changed.
Typical failing test looked like "TypeError: bpy_struct: item.attr = val: expected a string enum, not int".
If data was already loaded for BIMTool ("all") this ` elif ifc_element_type == "all" and AuthoringData.data["ifc_element_type"] is not None:` would always fail and this `AuthoringData.data["ifc_element_type"] != ifc_element_type` would always result to True, constantly recalculating data on every draw call.
This may uncover some issues that were hidden by the constant update (e.g. the bug fixed in the next commit).
Simplified it so now ifc_element_type is almost always referring to either ifc class or None. It's still using "all" in the BIMTool itself but then it's converted to None when passed to draw methods.
Currently you can edit container name directly from spatial manager, so this operator is no longer needed (and it also was missing from UI either way).
Blender supports named UCS coordinate systems. Refreshing the spatial
decomposition panel now creates orientation slots for each unique
spatial element orientation.
Additionally, setting the default spatial container selects an
appropriate orientation slot. eg. if a building is rotated, selecting to
work in a storey will set the orientation to the building orientation.
These slots are only created/updated in the spatial decomposition panel,
maybe they should also be created when loading the file and other
places.
The blender API doesn't currently allow listing custom orientation slots
for deletion, so if a spatial element is deleted or renamed, the old
orientation slot will persist for the rest of the session.
When locked to a plane, the mouse will be loosely locked to and angle
that is divided by 15 degrees. This was not working properly for "XZ"
and "YZ" planes.
As a result if all elements were assigned to sublibrary, it was showing that library itself has 0 assets and wasn't allowing to expand to see the sublibraries.
Previously if there was library A and it had sublibrary B and then some element were directly assigned to library A, UI still wouldn't show this element and would show only elements assigned to the B, the last library in the hierarchy