Fix #5939. Fix #2751. IfcPatch no longer needs the (rarely used) input src arg by default.

This commit is contained in:
Dion Moult
2025-01-10 16:59:45 +11:00
parent 83add56e6c
commit cac3d7f699
33 changed files with 58 additions and 119 deletions
@@ -98,12 +98,6 @@ class ExecuteIfcPatch(bpy.types.Operator):
if props.should_load_from_memory and tool.Ifc.get():
args["file"] = tool.Ifc.get()
if ifcpatch.get_patch_input_argument_use(recipe_name) == "REQUIRED":
self.report(
{"ERROR"},
f"The recipe '{recipe_name}' is not currently supported if file is loaded from memory.",
)
return {"CANCELLED"}
else:
args["input"] = cast(str, props.ifc_patch_input)
args["file"] = cast(ifcopenshell.file, ifcopenshell.open(props.ifc_patch_input))
+2 -4
View File
@@ -33,10 +33,8 @@ class Patch(bonsai.core.tool.Patch):
@classmethod
def is_filepath_argument(cls, recipe: str, arg_name: str) -> bool:
# TODO: Temporary hack to identify filepath arguments.
# Should mark them as such in the patches documentation
# and process it later.
return recipe == "SplitByBuildingStorey" and arg_name == "output_dir"
# There is probably a more explicit way to do this
return "filepath" in arg_name
@classmethod
def does_patch_has_output(cls, recipe: str) -> bool: