mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +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
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
props = context.scene.BIMPatchProperties
|
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:
|
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.")
|
cls.poll_message_set("Select an IFC file or use 'load from memory' if it's loaded in Bonsai.")
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ def get_ifcpatch_recipes(self, context):
|
|||||||
global ifcpatchrecipes_enum
|
global ifcpatchrecipes_enum
|
||||||
if len(ifcpatchrecipes_enum) < 1:
|
if len(ifcpatchrecipes_enum) < 1:
|
||||||
ifcpatchrecipes_enum.clear()
|
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])
|
ifcpatch_path = Path(importlib.util.find_spec("ifcpatch").submodule_search_locations[0])
|
||||||
for filename in ifcpatch_path.joinpath("recipes").glob("*.py"):
|
for filename in ifcpatch_path.joinpath("recipes").glob("*.py"):
|
||||||
f = str(filename.stem)
|
f = str(filename.stem)
|
||||||
|
|||||||
Reference in New Issue
Block a user