Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-13 01:11:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-13 01:11:48 +0400
commit7413ab8f1f4521f3ae2828cb0aa3bbf3bc1c0e2a (patch)
treec973efd7762dc77313e24dd45b4ddbf33806721c
parentb224cbe6b6fd4fcfee08be4f8287d9931a7eb605 (diff)
fix [#31428] bpy.ops.wm.path_open only works once
-rw-r--r--release/scripts/startup/bl_operators/wm.py9
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):