From 67740a5f79085dfea99ebdff15b7a481979eed3e Mon Sep 17 00:00:00 2001 From: Gorgious Date: Tue, 3 Aug 2021 20:30:30 +0200 Subject: [PATCH] Fix error due to trying to patch non-existent file --- src/blenderbim/blenderbim/bim/module/patch/operator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/patch/operator.py b/src/blenderbim/blenderbim/bim/module/patch/operator.py index 6060c7a76d..5015942931 100644 --- a/src/blenderbim/blenderbim/bim/module/patch/operator.py +++ b/src/blenderbim/blenderbim/bim/module/patch/operator.py @@ -40,6 +40,11 @@ class ExecuteIfcPatch(bpy.types.Operator): bl_label = "Execute IFCPatch" file_format: bpy.props.StringProperty() + @classmethod + def poll(cls, context): + input_file = context.scene.BIMPatchProperties.ifc_patch_input + return os.path.isfile(input_file) and "ifc" in os.path.splitext(input_file)[1] + def execute(self, context): import ifcpatch