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:
authorMatt Ebb <matt@mke3.net>2010-04-07 13:07:06 +0400
committerMatt Ebb <matt@mke3.net>2010-04-07 13:07:06 +0400
commit9acba540dbc3114e7d2d236684d6cd8b308e0a37 (patch)
tree107ec942e9e06203c27fa41ee80d5766be25fe0e /release
parent45ce1c003d7d28b2beb5dbf465f523c5bc41bc55 (diff)
Fix [#21756] Texture paint "quick edit" sending wrong path on unsaved scenes
* Made it use the temp directory in user preferences when the .blend file hasn't been saved yet * Made bmain->name (wrapped as bpy.data.filename) contain an empty string when there's no .B25.blend and no file saved, rather than "<memory2>". This is a good candidate for consistent file path api, retrieving temp dirs / project- specific temp dirs / etc...
Diffstat (limited to 'release')
-rw-r--r--release/scripts/op/image.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py
index f362f55d37e..e043e7dad61 100644
--- a/release/scripts/op/image.py
+++ b/release/scripts/op/image.py
@@ -133,8 +133,10 @@ class ProjectEdit(bpy.types.Operator):
filename = os.path.splitext(filename)[0]
# filename = bpy.utils.clean_name(filename) # fixes <memory> rubbish, needs checking
- if filename.startswith("."): # TODO, have a way to check if the file is saved, assuem .B25.blend
- filename = os.path.join(os.path.dirname(bpy.data.filename), filename)
+ if filename.startswith(".") or filename == "":
+ # TODO, have a way to check if the file is saved, assume .B25.blend
+ tmpdir = context.user_preferences.filepaths.temporary_directory
+ filename = os.path.join(tmpdir, "project_edit")
else:
filename = "//" + filename