diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-18 10:41:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-18 10:41:16 +0400 |
commit | 4d37cf90b9d9d8ed2f0339c8ccd72481e29a4514 (patch) | |
tree | 8442faaffb762a79497a45d90f503ccedc4cd0b4 /source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | |
parent | b3afc3618db09942f83d4a3ac62834e7b925d5d7 (diff) |
remove G.sce, use G.main->name instead.
Both stored the filename of the blend file, but G.sce stored the last opened file.
This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore).
Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend.
Diffstat (limited to 'source/gameengine/BlenderRoutines/KX_BlenderGL.cpp')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index e1cd1c6d488..5e1e213c570 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -67,6 +67,7 @@ extern "C" { #include "DNA_windowmanager_types.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_bmfont.h" #include "BKE_image.h" @@ -247,7 +248,7 @@ void BL_MakeScreenShot(ScrArea *curarea, const char* filename) dumprect= screenshot(curarea, &dumpsx, &dumpsy); if(dumprect) { ImBuf *ibuf; - BLI_path_abs(path, G.sce); + BLI_path_abs(path, G.main->name); /* BKE_add_image_extension() checks for if extension was already set */ BKE_add_image_extension(path, R_PNG); /* scene->r.imtype */ ibuf= IMB_allocImBuf(dumpsx, dumpsy, 24, 0); |