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>2010-10-18 10:41:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-18 10:41:16 +0400
commit4d37cf90b9d9d8ed2f0339c8ccd72481e29a4514 (patch)
tree8442faaffb762a79497a45d90f503ccedc4cd0b4 /source/blender/blenkernel/intern/image.c
parentb3afc3618db09942f83d4a3ac62834e7b925d5d7 (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/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 8ba7cde519d..09622b2acfe 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -338,7 +338,7 @@ Image *BKE_add_image_file(const char *name)
char str[FILE_MAX], strtest[FILE_MAX];
BLI_strncpy(str, name, sizeof(str));
- BLI_path_abs(str, G.sce);
+ BLI_path_abs(str, G.main->name);
/* exists? */
file= open(str, O_BINARY|O_RDONLY);
@@ -349,7 +349,7 @@ Image *BKE_add_image_file(const char *name)
for(ima= G.main->image.first; ima; ima= ima->id.next) {
if(ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) {
BLI_strncpy(strtest, ima->name, sizeof(ima->name));
- BLI_path_abs(strtest, G.sce);
+ BLI_path_abs(strtest, G.main->name);
if( strcmp(strtest, str)==0 ) {
if(ima->anim==NULL || ima->id.us==0) {
@@ -861,8 +861,8 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
if (scene->r.stamp & R_STAMP_FILENAME) {
if (G.relbase_valid) {
- if (do_prefix) sprintf(stamp_data->file, "File %s", G.sce);
- else sprintf(stamp_data->file, "%s", G.sce);
+ if (do_prefix) sprintf(stamp_data->file, "File %s", G.main->name);
+ else sprintf(stamp_data->file, "%s", G.main->name);
} else {
if (do_prefix) strcpy(stamp_data->file, "File <untitled>");
else strcpy(stamp_data->file, "<untitled>");
@@ -1311,7 +1311,7 @@ void BKE_makepicstring(char *string, char *base, int frame, int imtype, int use_
{
if (string==NULL) return;
BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */
- BLI_path_abs(string, G.sce);
+ BLI_path_abs(string, G.main->name);
BLI_path_frame(string, frame, 4);
if(use_ext)
@@ -1609,7 +1609,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
if(ima->id.lib)
BLI_path_abs(name, ima->id.lib->filepath);
else
- BLI_path_abs(name, G.sce);
+ BLI_path_abs(name, G.main->name);
flag= IB_rect|IB_multilayer;
if(ima->flag & IMA_DO_PREMUL)
@@ -1717,7 +1717,7 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
if(ima->id.lib)
BLI_path_abs(str, ima->id.lib->filepath);
else
- BLI_path_abs(str, G.sce);
+ BLI_path_abs(str, G.main->name);
ima->anim = openanim(str, IB_rect);
@@ -1778,7 +1778,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
if(ima->id.lib)
BLI_path_abs(str, ima->id.lib->filepath);
else
- BLI_path_abs(str, G.sce);
+ BLI_path_abs(str, G.main->name);
/* read ibuf */
ibuf = IMB_loadiffname(str, flag);