Hide output path for ifcpatch without output #4721

This commit is contained in:
Andrej730
2024-12-05 17:22:24 +05:00
parent 939cc63cae
commit 538365885b
3 changed files with 10 additions and 4 deletions
@@ -105,7 +105,8 @@ class ExecuteIfcPatch(bpy.types.Operator):
"log": os.path.join(context.scene.BIMProperties.data_dir, "process.log"),
}
)
ifcpatch.write(output, ifc_patch_output)
if tool.Patch.does_patch_has_output(props.ifc_patch_recipes):
ifcpatch.write(output, ifc_patch_output)
self.report({"INFO"}, f"{props.ifc_patch_recipes} patch executed successfully")
return {"FINISHED"}
+4 -3
View File
@@ -50,9 +50,10 @@ class BIM_PT_patch(bpy.types.Panel):
row.prop(props, "ifc_patch_input")
row.operator("bim.select_ifc_patch_input", icon="FILE_FOLDER", text="")
row = layout.row(align=True)
row.prop(props, "ifc_patch_output")
row.operator("bim.select_ifc_patch_output", icon="FILE_FOLDER", text="")
if tool.Patch.does_patch_has_output(props.ifc_patch_recipes):
row = layout.row(align=True)
row.prop(props, "ifc_patch_output")
row.operator("bim.select_ifc_patch_output", icon="FILE_FOLDER", text="")
if props.ifc_patch_args_attr:
draw_attributes(props.ifc_patch_args_attr, layout)
+4
View File
@@ -36,3 +36,7 @@ class Patch(bonsai.core.tool.Patch):
# Should mark them as such in the patches documentation
# and process it later.
return recipe == "SplitByBuildingStorey" and arg_name == "output_dir"
@classmethod
def does_patch_has_output(cls, recipe: str) -> bool:
return recipe != "SplitByBuildingStorey"