mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Bonsai - fix issues with default ifcpatch recipe is not loading properly #5540
This commit is contained in:
@@ -67,6 +67,9 @@ class ExecuteIfcPatch(bpy.types.Operator):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
props = context.scene.BIMPatchProperties
|
||||
if props.ifc_patch_recipes == "-":
|
||||
cls.poll_message_set("No recipe selected.")
|
||||
return False
|
||||
if not props.should_load_from_memory and not props.ifc_patch_input:
|
||||
cls.poll_message_set("Select an IFC file or use 'load from memory' if it's loaded in Bonsai.")
|
||||
return False
|
||||
|
||||
@@ -47,6 +47,10 @@ def get_ifcpatch_recipes(self, context):
|
||||
global ifcpatchrecipes_enum
|
||||
if len(ifcpatchrecipes_enum) < 1:
|
||||
ifcpatchrecipes_enum.clear()
|
||||
# Have to add a blank entry because otherwise default recipe might be not loaded
|
||||
# properly (need to ensure bim.update_ifc_patch_arguments will be called). See #5540.
|
||||
ifcpatchrecipes_enum.append(("-", "-", ""))
|
||||
|
||||
ifcpatch_path = Path(importlib.util.find_spec("ifcpatch").submodule_search_locations[0])
|
||||
for filename in ifcpatch_path.joinpath("recipes").glob("*.py"):
|
||||
f = str(filename.stem)
|
||||
|
||||
Reference in New Issue
Block a user