From 345ac83c18475cef378e212bcaf8f8de9e27c874 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 14 Jul 2015 23:37:27 -0400 Subject: [PATCH] Only allow python refreshing if the file exists --- korman/nodes/node_python.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/korman/nodes/node_python.py b/korman/nodes/node_python.py index 9ffd3d9..a46ade6 100644 --- a/korman/nodes/node_python.py +++ b/korman/nodes/node_python.py @@ -149,9 +149,10 @@ class PlasmaPythonFileNode(PlasmaNodeBase, bpy.types.Node): row = layout.row(align=True) if self.filename: row.prop(self, "filename") - operator = row.operator("node.plasma_attributes_to_node", icon="FILE_REFRESH", text="") - operator.python_path = self.filepath - operator.node_path = self.node_path + if os.path.isfile(self.filepath): + operator = row.operator("node.plasma_attributes_to_node", icon="FILE_REFRESH", text="") + operator.python_path = self.filepath + operator.node_path = self.node_path op_text = "" if self.filename else "Select" operator = row.operator("file.plasma_file_picker", icon="SCRIPT", text=op_text)