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/blender/editors/space_image | |
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/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index a44258351ce..429ba64ed0f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -133,7 +133,7 @@ static int space_image_file_exists_poll(bContext *C) ibuf= ED_space_image_acquire_buffer(sima, &lock); if(ibuf) { BLI_strncpy(name, ibuf->name, FILE_MAX); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); poll= (BLI_exists(name) && BLI_is_writable(name)); } ED_space_image_release_buffer(sima, lock); @@ -856,7 +856,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera int relative= (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path")); int save_copy= (RNA_struct_find_property(op->ptr, "copy") && RNA_boolean_get(op->ptr, "copy")); - BLI_path_abs(path, G.sce); + BLI_path_abs(path, G.main->name); if(scene->r.scemode & R_EXTENSION) { BKE_add_image_extension(path, sima->imtypenr); @@ -876,7 +876,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera RE_WriteRenderResult(rr, path, scene->r.quality); if(relative) - BLI_path_rel(path, G.sce); /* only after saving */ + BLI_path_rel(path, G.main->name); /* only after saving */ if(!save_copy) { if(do_newpath) { @@ -896,7 +896,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera else if (BKE_write_ibuf(scene, ibuf, path, sima->imtypenr, scene->r.subimtype, scene->r.quality)) { if(relative) - BLI_path_rel(path, G.sce); /* only after saving */ + BLI_path_rel(path, G.main->name); /* only after saving */ if(!save_copy) { if(do_newpath) { @@ -1071,7 +1071,7 @@ static int save_exec(bContext *C, wmOperator *op) if(name[0]==0) BLI_strncpy(name, G.ima, FILE_MAX); else - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); if(BLI_exists(name) && BLI_is_writable(name)) { rr= BKE_image_acquire_renderresult(scene, ima); @@ -1157,7 +1157,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; BLI_strncpy(name, ibuf->name, sizeof(name)); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) { BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s.", name); |