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/editors
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/editors')
-rw-r--r--source/blender/editors/interface/interface_draw.c2
-rw-r--r--source/blender/editors/object/object_modifier.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c6
-rw-r--r--source/blender/editors/render/render_preview.c4
-rw-r--r--source/blender/editors/render/render_shading.c6
-rw-r--r--source/blender/editors/screen/screendump.c3
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c3
-rw-r--r--source/blender/editors/space_file/file_draw.c5
-rw-r--r--source/blender/editors/space_file/file_ops.c15
-rw-r--r--source/blender/editors/space_file/filelist.c8
-rw-r--r--source/blender/editors/space_file/filesel.c7
-rw-r--r--source/blender/editors/space_file/writeimage.c5
-rw-r--r--source/blender/editors/space_image/image_ops.c12
-rw-r--r--source/blender/editors/space_info/info_ops.c8
-rw-r--r--source/blender/editors/space_outliner/outliner.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c2
-rw-r--r--source/blender/editors/space_text/text_ops.c12
18 files changed, 56 insertions, 50 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 855ca45f61a..81b04fea062 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -564,7 +564,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
int err;
strcpy(tmpStr, G.selfont->name);
- BLI_path_abs(tmpStr, G.sce);
+ BLI_path_abs(tmpStr, G.main->name);
err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0);
}
}
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 3bdf202aca9..c273b375a06 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1058,7 +1058,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", path);
if(relative)
- BLI_path_rel(path, G.sce);
+ BLI_path_rel(path, G.main->name);
CustomData_external_add(&me->fdata, &me->id, CD_MDISPS, me->totface, path);
CustomData_external_write(&me->fdata, &me->id, CD_MASK_MESH, me->totface, 0);
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 6dc4684d815..b1c373e7a91 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -639,7 +639,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
// prepare names...
strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR);
strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR);
- BLI_path_abs(targetDir, G.sce); // fixed #frame-no
+ BLI_path_abs(targetDir, G.main->name); // fixed #frame-no
strcpy(targetFile, targetDir);
strcat(targetFile, suffixConfig);
@@ -663,7 +663,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
char blendFile[FILE_MAXDIR+FILE_MAXFILE];
// invalid dir, reset to current/previous
- strcpy(blendDir, G.sce);
+ strcpy(blendDir, G.main->name);
BLI_splitdirstring(blendDir, blendFile);
if(strlen(blendFile)>6){
int len = strlen(blendFile);
@@ -694,7 +694,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
if(selection<1) return 0; // 0 from menu, or -1 aborted
strcpy(targetDir, newSurfdataPath);
strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR);
- BLI_path_abs(targetDir, G.sce); // fixed #frame-no
+ BLI_path_abs(targetDir, G.main->name); // fixed #frame-no
}
#endif
return outStringsChanged;
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 21f10d936bf..0e8587e4642 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -111,7 +111,7 @@ ImBuf* get_brush_icon(Brush *brush)
// first use the path directly to try and load the file
BLI_strncpy(path, brush->icon_filepath, sizeof(brush->icon_filepath));
- BLI_path_abs(path, G.sce);
+ BLI_path_abs(path, G.main->name);
brush->icon_imbuf= IMB_loadiffname(path, flags);
@@ -121,7 +121,7 @@ ImBuf* get_brush_icon(Brush *brush)
path[0]= 0;
- BLI_make_file_string(G.sce, path, folder, brush->icon_filepath);
+ BLI_make_file_string(G.main->name, path, folder, brush->icon_filepath);
if (path[0])
brush->icon_imbuf= IMB_loadiffname(path, flags);
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index bca8100a809..9db15ee43e5 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -852,7 +852,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int
ibuf->profile = IB_PROFILE_LINEAR_RGB;
/* to save, we first get absolute path */
- BLI_path_abs(str, G.sce);
+ BLI_path_abs(str, G.main->name);
if (BKE_write_ibuf(scene, ibuf, str, imtype, scene->r.subimtype, scene->r.quality)) {
retval = OPERATOR_FINISHED;
@@ -863,7 +863,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int
}
/* in case we were saving with relative paths, change back again */
if(relative)
- BLI_path_rel(str, G.sce);
+ BLI_path_rel(str, G.main->name);
IMB_freeImBuf(ibuf);
ibuf = NULL;
@@ -908,7 +908,7 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event
//RNA_enum_set(op->ptr, "file_type", scene->r.imtype);
- RNA_string_set(op->ptr, "filepath", G.sce);
+ RNA_string_set(op->ptr, "filepath", G.main->name);
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 937441a6e43..082c9f2f721 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -42,6 +42,7 @@
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_main.h"
#include "BKE_image.h"
#include "BKE_report.h"
#include "BKE_writeavi.h"
@@ -77,7 +78,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", path);
strcpy(G.ima, path);
- BLI_path_abs(path, G.sce);
+ BLI_path_abs(path, G.main->name);
/* BKE_add_image_extension() checks for if extension was already set */
if(scene->r.scemode & R_EXTENSION)
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index 2573470e8df..e72446366fe 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -39,6 +39,7 @@
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_main.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -104,7 +105,7 @@ static int file_browse_exec(bContext *C, wmOperator *op)
/* add slash for directories, important for some properties */
if(RNA_property_subtype(fbo->prop) == PROP_DIRPATH) {
id = fbo->ptr.id.data;
- base = (id && id->lib)? id->lib->filepath: G.sce;
+ base = (id && id->lib)? id->lib->filepath: G.main->name;
BLI_strncpy(path, str, FILE_MAX);
BLI_path_abs(path, base);
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 421b14e5bbe..65415d382ec 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -40,6 +40,7 @@
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_main.h"
#include "BLF_api.h"
@@ -445,9 +446,9 @@ static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname)
struct direntry *file = (struct direntry *)arg1;
#endif
- BLI_make_file_string(G.sce, orgname, sfile->params->dir, oldname);
+ BLI_make_file_string(G.main->name, orgname, sfile->params->dir, oldname);
BLI_strncpy(filename, sfile->params->renameedit, sizeof(filename));
- BLI_make_file_string(G.sce, newname, sfile->params->dir, filename);
+ BLI_make_file_string(G.main->name, newname, sfile->params->dir, filename);
if( strcmp(orgname, newname) != 0 ) {
if (!BLI_exists(newname)) {
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 6dfdcfd430a..1af8e9d14be 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -30,6 +30,7 @@
#include "BKE_screen.h"
#include "BKE_global.h"
#include "BKE_report.h"
+#include "BKE_main.h"
#include "BLI_blenlib.h"
#include "BLI_storage_types.h"
@@ -190,7 +191,7 @@ static FileSelect file_select(bContext* C, const rcti* rect, short selecting, sh
/* avoids /../../ */
BLI_parent_dir(params->dir);
} else {
- BLI_cleanup_dir(G.sce, params->dir);
+ BLI_cleanup_dir(G.main->name, params->dir);
strcat(params->dir, file->relname);
BLI_add_slash(params->dir);
}
@@ -361,7 +362,7 @@ static int bookmark_select_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "dir", entry);
BLI_strncpy(params->dir, entry, sizeof(params->dir));
- BLI_cleanup_dir(G.sce, params->dir);
+ BLI_cleanup_dir(G.main->name, params->dir);
file_change_dir(C, 1);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
@@ -544,7 +545,7 @@ void file_sfile_to_operator(wmOperator *op, SpaceFile *sfile, char *filepath)
BLI_join_dirfile(filepath, sfile->params->dir, sfile->params->file);
if(RNA_struct_find_property(op->ptr, "relative_path")) {
if(RNA_boolean_get(op->ptr, "relative_path")) {
- BLI_path_rel(filepath, G.sce);
+ BLI_path_rel(filepath, G.main->name);
}
}
@@ -680,7 +681,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
file_sfile_to_operator(op, sfile, filepath);
fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir,0, 1);
- BLI_make_file_string(G.sce, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+ BLI_make_file_string(G.main->name, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu_get(), filepath);
WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC);
@@ -711,7 +712,7 @@ int file_parent_exec(bContext *C, wmOperator *UNUSED(unused))
if(sfile->params) {
if (BLI_has_parent(sfile->params->dir)) {
BLI_parent_dir(sfile->params->dir);
- BLI_cleanup_dir(G.sce, sfile->params->dir);
+ BLI_cleanup_dir(G.main->name, sfile->params->dir);
file_change_dir(C, 0);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
}
@@ -1010,7 +1011,7 @@ int file_directory_exec(bContext *C, wmOperator *UNUSED(unused))
if (sfile->params->dir[0] == '\0')
get_default_root(sfile->params->dir);
#endif
- BLI_cleanup_dir(G.sce, sfile->params->dir);
+ BLI_cleanup_dir(G.main->name, sfile->params->dir);
BLI_add_slash(sfile->params->dir);
file_change_dir(C, 1);
@@ -1240,7 +1241,7 @@ int file_delete_exec(bContext *C, wmOperator *UNUSED(op))
file = filelist_file(sfile->files, sfile->params->active_file);
- BLI_make_file_string(G.sce, str, sfile->params->dir, file->relname);
+ BLI_make_file_string(G.main->name, str, sfile->params->dir, file->relname);
BLI_delete(str, 0, 0);
ED_fileselect_clear(C, sfile);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 68a93d39062..43d5d54805d 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -730,7 +730,7 @@ static void filelist_read_dir(struct FileList* filelist)
BLI_getwdN(wdir);
- BLI_cleanup_dir(G.sce, filelist->dir);
+ BLI_cleanup_dir(G.main->name, filelist->dir);
filelist->numfiles = BLI_getdir(filelist->dir, &(filelist->filelist));
if(!chdir(wdir)) {} /* fix warning about not checking return value */
@@ -747,7 +747,7 @@ static void filelist_read_main(struct FileList* filelist)
static void filelist_read_library(struct FileList* filelist)
{
if (!filelist) return;
- BLI_cleanup_dir(G.sce, filelist->dir);
+ BLI_cleanup_dir(G.main->name, filelist->dir);
filelist_from_library(filelist);
if(!filelist->libfiledata) {
int num;
@@ -912,7 +912,7 @@ void filelist_from_library(struct FileList* filelist)
return;
}
- BLI_strncpy(filename, G.sce, sizeof(filename)); // G.sce = last file loaded, for UI
+ BLI_strncpy(filename, G.main->name, sizeof(filename));
/* there we go */
/* for the time being only read filedata when libfiledata==0 */
@@ -979,7 +979,7 @@ void filelist_from_library(struct FileList* filelist)
filelist_sort(filelist, FILE_SORT_ALPHA);
- BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change
+ BLI_strncpy(G.main->name, filename, sizeof(filename)); // prevent G.main->name to change
filelist->filter = 0;
filelist_filter(filelist);
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index b36cfe66a36..8ad3ef08e85 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -64,6 +64,7 @@
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_main.h"
#include "BLF_api.h"
@@ -104,7 +105,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
if (!sfile->params) {
sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams");
/* set path to most recently opened .blend */
- BLI_split_dirfile(G.sce, sfile->params->dir, sfile->params->file);
+ BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file);
sfile->params->filter_glob[0] = '\0';
}
@@ -142,8 +143,8 @@ short ED_fileselect_set_params(SpaceFile *sfile)
}
if(params->dir[0]) {
- BLI_cleanup_dir(G.sce, params->dir);
- BLI_path_abs(params->dir, G.sce);
+ BLI_cleanup_dir(G.main->name, params->dir);
+ BLI_path_abs(params->dir, G.main->name);
}
params->filter = 0;
diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c
index f5ce5a818d7..750cf98727a 100644
--- a/source/blender/editors/space_file/writeimage.c
+++ b/source/blender/editors/space_file/writeimage.c
@@ -41,6 +41,7 @@
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_main.h"
#include "BKE_image.h"
#include "RE_pipeline.h"
@@ -75,7 +76,7 @@ static void save_rendered_image_cb_real(char *name, int confirm)
BKE_add_image_extension(name, scene->r.imtype);
strcpy(str, name);
- BLI_path_abs(str, G.sce);
+ BLI_path_abs(str, G.main->name);
if (confirm)
overwrite = saveover(str);
@@ -218,7 +219,7 @@ void BIF_save_rendered_image_fs(Scene *scene)
char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2];
if(G.ima[0]==0) {
- strcpy(dir, G.sce);
+ strcpy(dir, G.main->name);
BLI_splitdirstring(dir, str);
strcpy(G.ima, dir);
}
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);
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index c87b25877b4..aeb32cda6bd 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -191,7 +191,7 @@ static int make_paths_relative_exec(bContext *UNUSED(C), wmOperator *op)
return OPERATOR_CANCELLED;
}
- makeFilesRelative(G.sce, op->reports);
+ makeFilesRelative(G.main->name, op->reports);
return OPERATOR_FINISHED;
}
@@ -218,7 +218,7 @@ static int make_paths_absolute_exec(bContext *UNUSED(C), wmOperator *op)
return OPERATOR_CANCELLED;
}
- makeFilesAbsolute(G.sce, op->reports);
+ makeFilesAbsolute(G.main->name, op->reports);
return OPERATOR_FINISHED;
}
@@ -244,7 +244,7 @@ static int report_missing_files_exec(bContext *UNUSED(C), wmOperator *op)
txtname[0] = '\0';
/* run the missing file check */
- checkMissingFiles(G.sce, op->reports);
+ checkMissingFiles(G.main->name, op->reports);
return OPERATOR_FINISHED;
}
@@ -269,7 +269,7 @@ static int find_missing_files_exec(bContext *UNUSED(C), wmOperator *op)
char *path;
path= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
- findMissingFiles(path, G.sce);
+ findMissingFiles(path, G.main->name);
MEM_freeN(path);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 6040b755e30..1f0725c5458 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -5035,7 +5035,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
if (te->idcode == ID_LI) {
char expanded[FILE_MAXDIR + FILE_MAXFILE];
BLI_strncpy(expanded, ((Library *)tselem->id)->name, FILE_MAXDIR + FILE_MAXFILE);
- BLI_path_abs(expanded, G.sce);
+ BLI_path_abs(expanded, G.main->name);
if (!BLI_exists(expanded)) {
error("This path does not exist, correct this before saving");
}
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index b9db18f7850..5f0693dc43c 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -101,7 +101,7 @@ static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op,
if(last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) {
char path[sizeof(last_seq->strip->dir)];
BLI_strncpy(path, last_seq->strip->dir, sizeof(path));
- BLI_path_abs(path, G.sce);
+ BLI_path_abs(path, G.main->name);
RNA_string_set(op->ptr, identifier, path);
}
}
@@ -152,7 +152,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
}
if((is_file != -1) && relative)
- BLI_path_rel(seq_load->path, G.sce);
+ BLI_path_rel(seq_load->path, G.main->name);
if (RNA_struct_find_property(op->ptr, "frame_end")) {
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index bd53615feda..35f27953633 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -992,7 +992,7 @@ void touch_seq_files(Scene *scene)
if(seq->flag & SELECT) {
if(seq->type==SEQ_MOVIE) {
if(seq->strip && seq->strip->stripdata) {
- BLI_make_file_string(G.sce, str, seq->strip->dir, seq->strip->stripdata->name);
+ BLI_make_file_string(G.main->name, str, seq->strip->dir, seq->strip->stripdata->name);
BLI_touch(seq->name);
}
}
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 90fab7b2902..8d4f3f87f66 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -221,7 +221,7 @@ static int open_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", str);
- text= add_text(str, G.sce);
+ text= add_text(str, G.main->name);
if(!text) {
if(op->customdata) MEM_freeN(op->customdata);
@@ -266,7 +266,7 @@ static int open_exec(bContext *C, wmOperator *op)
static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
Text *text= CTX_data_edit_text(C);
- char *path= (text && text->name)? text->name: G.sce;
+ char *path= (text && text->name)? text->name: G.main->name;
if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op);
@@ -438,7 +438,7 @@ static void txt_write_file(Text *text, ReportList *reports)
char file[FILE_MAXDIR+FILE_MAXFILE];
BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
- BLI_path_abs(file, G.sce);
+ BLI_path_abs(file, G.main->name);
fp= fopen(file, "w");
if(fp==NULL) {
@@ -524,7 +524,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
else if(text->flags & TXT_ISMEM)
str= text->id.name+2;
else
- str= G.sce;
+ str= G.main->name;
RNA_string_set(op->ptr, "filepath", str);
WM_event_add_fileselect(C, op);
@@ -2860,7 +2860,7 @@ int text_file_modified(Text *text)
return 0;
BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
- BLI_path_abs(file, G.sce);
+ BLI_path_abs(file, G.main->name);
if(!BLI_exists(file))
return 2;
@@ -2888,7 +2888,7 @@ static void text_ignore_modified(Text *text)
if(!text || !text->name) return;
BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
- BLI_path_abs(file, G.sce);
+ BLI_path_abs(file, G.main->name);
if(!BLI_exists(file)) return;