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-12-06 03:52:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-06 03:52:30 +0300
commit60063d538389d4ad2e4a268da2ba058baf768807 (patch)
tree78c1ec1098f701a8e61cf55bc4f145a680b72a3a /source/blender/editors/space_info/info_ops.c
parent2f366d1544ecc5618d7190b779ccc75f2f144d0a (diff)
- converted path cleaning on file load to use bPath Iterator functions - image & font and sequence paths were being cleaned but not multires, voxel & sound paths.
- skip fixing file paths on undo. - simplify bpath alloc and free functions, also pass Main structure so as not to rely on G.main, (needed for file load).
Diffstat (limited to 'source/blender/editors/space_info/info_ops.c')
-rw-r--r--source/blender/editors/space_info/info_ops.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index c45e4d3acf0..a5e47e7bb1d 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -184,14 +184,16 @@ void FILE_OT_unpack_all(wmOperatorType *ot)
/********************* make paths relative operator *********************/
-static int make_paths_relative_exec(bContext *UNUSED(C), wmOperator *op)
+static int make_paths_relative_exec(bContext *C, wmOperator *op)
{
+ Main *bmain= CTX_data_main(C);
+
if(!G.relbase_valid) {
BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file.");
return OPERATOR_CANCELLED;
}
- makeFilesRelative(G.main->name, op->reports);
+ makeFilesRelative(bmain, bmain->name, op->reports);
/* redraw everything so any changed paths register */
WM_main_add_notifier(NC_WINDOW, NULL);
@@ -214,14 +216,16 @@ void FILE_OT_make_paths_relative(wmOperatorType *ot)
/********************* make paths absolute operator *********************/
-static int make_paths_absolute_exec(bContext *UNUSED(C), wmOperator *op)
+static int make_paths_absolute_exec(bContext *C, wmOperator *op)
{
+ Main *bmain= CTX_data_main(C);
+
if(!G.relbase_valid) {
BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file.");
return OPERATOR_CANCELLED;
}
- makeFilesAbsolute(G.main->name, op->reports);
+ makeFilesAbsolute(bmain, bmain->name, op->reports);
/* redraw everything so any changed paths register */
WM_main_add_notifier(NC_WINDOW, NULL);
@@ -251,7 +255,7 @@ static int report_missing_files_exec(bContext *UNUSED(C), wmOperator *op)
txtname[0] = '\0';
/* run the missing file check */
- checkMissingFiles(G.main->name, op->reports);
+ checkMissingFiles(G.main, op->reports);
return OPERATOR_FINISHED;
}
@@ -276,7 +280,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(G.main->name, path);
+ findMissingFiles(G.main, path);
MEM_freeN(path);
return OPERATOR_FINISHED;