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>2007-03-19 04:51:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-03-19 04:51:54 +0300
commit8eb0544f08324cc836988e230a518458f40582a7 (patch)
treeea976ac96f51181ebce85d4f40c7bd82a1ab0401 /source/blender/python/api2_2x/Blender.c
parent5297123de1b0e64788a0c21d102f21296a392ec4 (diff)
[ #4227 ] Determine the "real" current filename via Python
applied. tested and this is how "filename" should work, so changed Blender.Get("filename") to return None instead of the last opened file.
Diffstat (limited to 'source/blender/python/api2_2x/Blender.c')
-rw-r--r--source/blender/python/api2_2x/Blender.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c
index a18faf6ac99..859cd32d670 100644
--- a/source/blender/python/api2_2x/Blender.c
+++ b/source/blender/python/api2_2x/Blender.c
@@ -306,8 +306,12 @@ static PyObject *Blender_Get( PyObject * self, PyObject * args )
ret = PyInt_FromLong( G.scene->r.sfra );
else if( StringEqual( str, "endframe" ) )
ret = PyInt_FromLong( G.scene->r.efra );
- else if( StringEqual( str, "filename" ) )
- ret = PyString_FromString( G.sce );
+ else if( StringEqual( str, "filename" ) ) {
+ if ( strstr(G.main->name, ".B.blend") != 0)
+ ret = EXPP_incr_ret( Py_None );
+ else
+ ret = PyString_FromString(G.main->name);
+ }
else if( StringEqual( str, "homedir" ) ) {
char *hdir = bpy_gethome(0);
if( hdir && BLI_exists( hdir ))