From 30fa917e69a3bc2ade29e063d780612018e24b2b Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 15 Dec 2023 23:09:20 +1100 Subject: [PATCH] Patch recipes can now be performed in-place and are sorted in the UI. --- src/blenderbim/blenderbim/bim/module/patch/operator.py | 2 +- src/blenderbim/blenderbim/bim/module/patch/prop.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/patch/operator.py b/src/blenderbim/blenderbim/bim/module/patch/operator.py index c78ea435b8..9c30142e22 100644 --- a/src/blenderbim/blenderbim/bim/module/patch/operator.py +++ b/src/blenderbim/blenderbim/bim/module/patch/operator.py @@ -88,7 +88,7 @@ class ExecuteIfcPatch(bpy.types.Operator): file = ifcopenshell.open(props.ifc_patch_input) # Store this in case the patch recipe resets the Blender session, such as by loading a new project. - ifc_patch_output = props.ifc_patch_output + ifc_patch_output = props.ifc_patch_output or props.ifc_patch_input output = ifcpatch.execute( { diff --git a/src/blenderbim/blenderbim/bim/module/patch/prop.py b/src/blenderbim/blenderbim/bim/module/patch/prop.py index af80c35e95..1fd91dc973 100644 --- a/src/blenderbim/blenderbim/bim/module/patch/prop.py +++ b/src/blenderbim/blenderbim/bim/module/patch/prop.py @@ -53,7 +53,7 @@ def get_ifcpatch_recipes(self, context): continue docs = ifcpatch.extract_docs(f, "Patcher", "__init__", ("src", "file", "logger", "args")) ifcpatchrecipes_enum.append((f, f, docs.get("description", "") if docs else "")) - return ifcpatchrecipes_enum + return sorted(ifcpatchrecipes_enum, key=lambda x: x[0]) def update_ifc_patch_recipe(self, context):