diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 01:11:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 01:11:48 +0400 |
commit | 7413ab8f1f4521f3ae2828cb0aa3bbf3bc1c0e2a (patch) | |
tree | c973efd7762dc77313e24dd45b4ddbf33806721c /release | |
parent | b224cbe6b6fd4fcfee08be4f8287d9931a7eb605 (diff) |
fix [#31428] bpy.ops.wm.path_open only works once
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 926ad9b94f7..c3638da5814 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -764,6 +764,7 @@ class WM_OT_path_open(Operator): filepath = StringProperty( subtype='FILE_PATH', + options={'SKIP_SAVE'}, ) def execute(self, context): @@ -771,7 +772,13 @@ class WM_OT_path_open(Operator): import os import subprocess - filepath = bpy.path.abspath(self.filepath) + filepath = self.filepath + + if not filepath: + self.report({'ERROR'}, "File path was not set") + return {'CANCELLED'} + + filepath = bpy.path.abspath(filepath) filepath = os.path.normpath(filepath) if not os.path.exists(filepath): |