For some reason in the scene properties context.object returns None even if an object is active in the viewport, so ifc modifiers would randomly throw errors. AFAIK functionally they are supposed to point to the same thing, but active_object seems to be the superior one and context.object deprecated and kept for legacy reasons. Couldn't find dev quote but I'm sure I saw it at some point
Works similarly to tagging, example - https://imgur.com/a/Atr0nYE
This feature also can be useful in the future if we integrate revision clouds with ifcgit
Bugs were:
1) svg print ZeroDivisionError if there was less than 1 pattern segment
2) svg drawing wasn't preserving edge direction if there was less than 1 pattern segment
In the past, we used undo_pre and redo_pre and a bunch of complex commit_link and rollback_link tracking to figure out what IDs and GUIDs were added / removed during transactions and how to handle invalidated objects in the id/guid maps.
I really don't know why I made it that complex.
Now we simply treat all data as bad and rebuild the either map. This means slower undos / redos for large projects, but in theory the maps will never invalidate.
This either fixes a lot of things or breaks a lot of things :) Watch out!
Noticed an error if you connect wall and slab, then remove the slab and try to regenerate the wall - error occured because connection to that slab wasn't removed.
The error was:
Error: Python: Traceback (most recent call last):
File "\3.6\scripts\addons\blenderbim\bim\module\model\workspace.py", line 381, in invoke
return self.execute(context)
File "\3.6\scripts\addons\blenderbim\tool\ifc.py", line 136, in execute
IfcStore.execute_ifc_operator(self, context)
File "\3.6\scripts\addons\blenderbim\bim\ifc.py", line 421, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "\3.6\scripts\addons\blenderbim\bim\module\model\workspace.py", line 373, in _execute
getattr(self, f"hotkey_{self.hotkey}")()
File "\3.6\scripts\addons\blenderbim\bim\module\model\workspace.py", line 465, in hotkey_S_E
bpy.ops.bim.join_wall(join_type="T")
File "C:\software\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py", line 113, in __call__
ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
File "\3.6\scripts\addons\blenderbim\tool\ifc.py", line 136, in execute
IfcStore.execute_ifc_operator(self, context)
File "\3.6\scripts\addons\blenderbim\bim\ifc.py", line 421, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "\3.6\scripts\addons\blenderbim\bim\module\model\wall.py", line 76, in _execute
joiner.join_E(context.active_object, context.scene.cursor.location)
File "\3.6\scripts\addons\blenderbim\bim\module\model\wall.py", line 1038, in join_E
self.recreate_wall(element1, wall1, axis, body)
File "\3.6\scripts\addons\blenderbim\bim\module\model\wall.py", line 1145, in recreate_wall
height = self.clip(obj, tool.Ifc.get_object(rel.RelatingElement))
File "\3.6\scripts\addons\blenderbim\tool\ifc.py", line 89, in get_object
return IfcStore.get_element(element.id())
AttributeError: 'NoneType' object has no attribute 'id'
The error was:
Traceback (most recent call last):
File "\3.6\scripts\addons\blenderbim\bim\module\style\prop.py", line 99, in update_shading_style
tool.Style.set_surface_style_props(blender_material)
File "\3.6\scripts\addons\blenderbim\tool\style.py", line 174, in set_surface_style_props
style_data["DiffuseColour"] = style_data["DiffuseColour"][1]
TypeError: 'NoneType' object is not subscriptable
Since we do not update representation for railing / roofs and just mark them wtih `tool.Ifc.edit(obj)` their previous representation may still be incorrect. So we restore the previous representation just using bmesh update method.
For example if create a new roof, enter editing roof properties mode and then cancel editing, then it would result in "Failed to process a shape" because roof still had just empty Body/PointCloud representation.