diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-12-31 15:03:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-12-31 15:03:26 +0300 |
commit | 5e4d32a9ffa7157a40bbd4d1d821c6dad860af0d (patch) | |
tree | 66caad4b06353342a3933b0287255b1d95d3b7dd /source/blender/src/header_info.c | |
parent | d00d1f1c89f217e485e18020ff0bac087ffcd77f (diff) |
Improvements to File->External Data->Make Paths Relative & Make Paths Absolute,
made when testing peach blend files wont have path issues when sent to the renderfarm.
* log failed path conversions
* clean the path so //foo/../foo/ is removed (not sure why but some peach files had this problem)
Also added a function to util.c
BLI_cleanup_file, same as BLI_cleanup_dir but dosnt add a slash at the end.
Diffstat (limited to 'source/blender/src/header_info.c')
-rw-r--r-- | source/blender/src/header_info.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 552201445d1..97b5341fda1 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -956,8 +956,11 @@ static void do_info_externalfiles(void *arg, int event) if (G.relbase_valid) { int tot,changed,failed,linked; char str[512]; - makeFilesRelative(&tot, &changed, &failed, &linked); - sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + char txtname[24]; /* text block name */ + txtname[0] = '\0'; + makeFilesRelative(txtname, &tot, &changed, &failed, &linked); + if (failed) sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); + else sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); pupmenu(str); } else { pupmenu("Can't set relative paths with an unsaved blend file"); @@ -967,22 +970,30 @@ static void do_info_externalfiles(void *arg, int event) { int tot,changed,failed,linked; char str[512]; - makeFilesAbsolute(&tot, &changed, &failed, &linked); + char txtname[24]; /* text block name */ + txtname[0] = '\0'; + makeFilesAbsolute(txtname, &tot, &changed, &failed, &linked); sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + if (failed) sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); + else sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + pupmenu(str); } break; case 12: /* check images exist */ { - /* Its really text but only care about the name */ - ID *btxt = (ID *)checkMissingFiles(); + char txtname[24]; /* text block name */ + txtname[0] = '\0'; + + /* run the missing file check */ + checkMissingFiles( txtname ); - if (btxt) { + if (txtname == '\0') { + okee("No external files missing"); + } else { char str[128]; - sprintf(str, "Missing files listed in Text \"%s\"", btxt->name+2); + sprintf(str, "Missing files listed in Text \"%s\"", txtname ); error(str); - } else { - okee("No external files missing"); } } break; |