From 31f14862f7d058df9c31a2ff8edd81c679c96c31 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 18 Jan 2008 23:31:18 +0000 Subject: [PATCH] don't display relative paths button when loading files. this was silly anyway since it always gave an error. --- source/blender/makesdna/DNA_space_types.h | 2 +- source/blender/src/editimasel.c | 2 +- source/blender/src/filesel.c | 2 +- source/blender/src/header_filesel.c | 11 +++++++---- source/blender/src/header_imasel.c | 10 +++++++--- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 2250e6e43ab..569a6ffc8aa 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -421,7 +421,7 @@ typedef struct SpaceImaSel { /* filesel types */ #define FILE_UNIX 8 -#define FILE_BLENDER 8 +#define FILE_BLENDER 8 /* dont display relative paths */ #define FILE_SPECIAL 9 #define FILE_LOADLIB 1 diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c index cf6a86917b7..ed630af2088 100644 --- a/source/blender/src/editimasel.c +++ b/source/blender/src/editimasel.c @@ -195,7 +195,7 @@ static void activate_imageselect_(int type, char *title, char *file, short *menu simasel->files = BIF_filelist_new(); } - if(G.relbase_valid && BLI_convertstringcode(name, G.sce, G.scene->r.cfra)) + if(G.relbase_valid && U.flag & USER_RELPATHS && type != FILE_BLENDER) simasel->flag |= FILE_STRINGCODE; else simasel->flag &= ~FILE_STRINGCODE; diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index 33f0fe5788e..8a9b5b4d2b8 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -1192,7 +1192,7 @@ static void activate_fileselect_(int type, char *title, char *file, short *menup /* sfile->act is used for databrowse: double names of library objects */ sfile->act= -1; - if(G.relbase_valid && U.flag & USER_RELPATHS) + if(G.relbase_valid && U.flag & USER_RELPATHS && type != FILE_BLENDER) sfile->flag |= FILE_STRINGCODE; else sfile->flag &= ~FILE_STRINGCODE; diff --git a/source/blender/src/header_filesel.c b/source/blender/src/header_filesel.c index 999fa2733af..7591a6e7e21 100644 --- a/source/blender/src/header_filesel.c +++ b/source/blender/src/header_filesel.c @@ -136,10 +136,13 @@ void file_buttons(void) uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Hides dot files"); uiBlockEndAlign(block); - uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file"); - - xco+=90; - + if(sfile->type==FILE_BLENDER) { + xco+=20; + } else { + uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file"); + xco+=90; + } + if(sfile->type==FILE_LOADLIB) { uiBlockBeginAlign(block); uiDefButBitS(block, TOGN, FILE_LINK, B_REDR, "Append", xco+=XIC,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Copies selected data into current project"); diff --git a/source/blender/src/header_imasel.c b/source/blender/src/header_imasel.c index 3968cff4757..bd09416e1ba 100644 --- a/source/blender/src/header_imasel.c +++ b/source/blender/src/header_imasel.c @@ -181,9 +181,13 @@ void imasel_buttons(void) uiBlockEndAlign(block); } } - - uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file"); - xco+=90; + + if(simasel->type==FILE_BLENDER) { + xco+=20; + } else { + uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file"); + xco+=90; + } if(simasel->type==FILE_LOADLIB) { uiBlockBeginAlign(block);