From 4ce22517175124d656d90f24a2354aa7a9f88ccd Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 3 Sep 2024 10:19:35 +1000 Subject: [PATCH] See #5269. Minor tweak to show warning if manual mode changes detected. --- src/bonsai/bonsai/bim/ui.py | 65 +++++++++++++--------- src/bonsai/docs/guides/troubleshooting.rst | 21 ++++++- 2 files changed, 59 insertions(+), 27 deletions(-) diff --git a/src/bonsai/bonsai/bim/ui.py b/src/bonsai/bonsai/bim/ui.py index d96b3e4762..045f253d67 100644 --- a/src/bonsai/bonsai/bim/ui.py +++ b/src/bonsai/bonsai/bim/ui.py @@ -421,34 +421,49 @@ class BIM_PT_tabs(Panel): row = self.layout.row(align=True) row.prop(aprops, "tab", text="") - - if bonsai.REINSTALLED_BBIM_VERSION: - box = self.layout.box() - box.alert = True - - box.label(text="Bonsai requires Blender to restart.", icon="ERROR") - box.label(text="Bonsai was reinstalled in the current session:") - box.label(text=f"{bonsai.FIRST_INSTALLED_BBIM_VERSION} -> {bonsai.REINSTALLED_BBIM_VERSION}") - box.label(text="Please restart Blender to avoid potential issues.") - box.operator("bim.restart_blender", text="Restart Blender", icon="BLENDER") - - if bonsai.last_error: - box = self.layout.box() - box.alert = True - row = box.row(align=True) - row.label(text="Bonsai experienced an error :(", icon="ERROR") - row.operator("bim.close_error", text="", icon="CANCEL") - if platform.system() == "Windows": - box.operator("wm.console_toggle", text="View the console for full logs.", icon="CONSOLE") - else: - box.label(text="View the console for full logs.", icon="CONSOLE") - box.operator("bim.copy_debug_information", text="Copy Error Message To Clipboard") - op = box.operator("bim.open_uri", text="How Can I Fix This?") - op.uri = "https://docs.bonsaibim.org/users/troubleshooting.html" - except: pass # Prior to load_post, we may not have any area properties setup + if bonsai.REINSTALLED_BBIM_VERSION: + box = self.layout.box() + box.alert = True + box.label(text="Bonsai requires Blender to restart.", icon="ERROR") + box.label(text="Bonsai was reinstalled in the current session:") + box.label(text=f"{bonsai.FIRST_INSTALLED_BBIM_VERSION} -> {bonsai.REINSTALLED_BBIM_VERSION}") + box.operator("bim.restart_blender", text="Restart Blender", icon="BLENDER") + + if bonsai.last_error: + box = self.layout.box() + box.alert = True + row = box.row(align=True) + row.label(text="Bonsai experienced an error :(", icon="ERROR") + row.operator("bim.close_error", text="", icon="CANCEL") + if platform.system() == "Windows": + box.operator("wm.console_toggle", text="View the console for full logs.", icon="CONSOLE") + else: + box.label(text="View the console for full logs.", icon="CONSOLE") + box.operator("bim.copy_debug_information", text="Copy Error Message To Clipboard") + op = box.operator("bim.open_uri", text="How Can I Fix This?") + op.uri = "https://docs.bonsaibim.org/users/troubleshooting.html" + + props = context.scene.BIMProperties + if (tool.Ifc.get() or props.ifc_file) and props.has_blend_warning: + box = self.layout.box() + box.alert = True + row = box.row(align=True) + row.label(text="Your model may be outdated", icon="ERROR") + op = row.operator("bim.open_uri", text="", icon="QUESTION") + op.uri = "https://docs.bonsaibim.org/users/troubleshooting.html#saving-and-loading-blend-files" + row.operator("bim.close_blend_warning", text="", icon="CANCEL") + + if context.mode != context.scene.BIMGeometryProperties.mode: + box = self.layout.box() + box.alert = True + row = box.row(align=True) + row.label(text="Geometry changes will be lost", icon="ERROR") + op = row.operator("bim.open_uri", text="", icon="QUESTION") + op.uri = "https://docs.bonsaibim.org/users/troubleshooting.html#incompatible-blender-features" + def draw_tab_entry(self, row, icon, tab_name, enabled=True, highlight=False): tab_entry = row.row(align=True) tab_entry.operator("bim.set_tab", text="", emboss=highlight, icon=icon, depress=True).tab = tab_name diff --git a/src/bonsai/docs/guides/troubleshooting.rst b/src/bonsai/docs/guides/troubleshooting.rst index 9a87577b65..3bf3f7be32 100644 --- a/src/bonsai/docs/guides/troubleshooting.rst +++ b/src/bonsai/docs/guides/troubleshooting.rst @@ -58,10 +58,10 @@ can `report a bug `_ or with factory settings. To quickly test in a clean environment, first :ref:`find your Blender - configuration folder`. Rename the folder from ``X.XX`` to something else like ``X.XX_backup``, then restart Blender and try follow the :doc:`installation - instructions` again. + instructions` again. If this fixes your issue, consider disabling other add-ons one by one until you find a conflict as a next step to isolating the issue. @@ -100,6 +100,23 @@ create unpredictable, and sometimes unrecoverable errors. To avoid this issue, only open and save IFCs. +Incompatible Blender features +----------------------------- + +Blender offers features such as animation, sculpting, modifiers, and more that +are not available in IFC. As :ref:`Bonsai uses IFC as its native data +store`, using these +incompatible features may result in data loss. + +1. **Manual geometry editing**. Manually changing the mode to Edit or Object + mode in the :menuselection:`3D Viewport` top left dropdown menu. This + changes the Blender mesh editing mode, but any changes may be incompatible + with the IFC geometry. This is because IFC geometry may not be a mesh, or + have parametric constraints. Any changes made in this manner may have + unpredictable effects and changes may be discarded. Instead, always use the + :kbd:`Tab` key to toggle object editing, or use the IFC Object / Edit mode + toggle in the top right of the :menuselection:`3D Viewport`. + Where is the add-on installed? ------------------------------