On appending in posemoding, Blender could crash.
Found out the new 'select appended' also sets the 'active base/object'.
This isn't OK on that level of the code, 'active' exists (and needs to be
set) on UI code level in src/, not in the middle of file reading function.

Also removed weird negative bitflag that enforced 'select appended' to
be default. If you want that, set the flag itself in do_versions or so.
In my opinion it is best saved in .B.blend instead. Another time...
This commit is contained in:
Ton Roosendaal
2004-11-21 13:25:54 +00:00
parent 9b9f9fc038
commit 7d7acbf6bd
2 changed files with 5 additions and 5 deletions

View File

@@ -5282,10 +5282,10 @@ static void append_named_part(FileData *fd, Main *mainvar, Scene *scene, char *n
base->object= ob;
ob->id.us++;
if(!(flag & FILE_AUTOSELECT)) { /* inverse logic here, because we want it to be the default action */
if(flag & FILE_AUTOSELECT) {
base->flag |= SELECT;
base->object->flag = base->flag;
G.scene->basact = base;
/* do NOT make base active here! screws up GUI stuff, if you want it do it on src/ level */
}
}
afbreek= 1;
@@ -5388,7 +5388,7 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
}
/* now we have or selected, or an indicated file */
if(!(sfile->flag & FILE_AUTOSELECT)) scene_deselect_all(G.scene);
if(sfile->flag & FILE_AUTOSELECT) scene_deselect_all(G.scene);
mainlist.first= mainlist.last= G.main;
G.main->next= NULL;

View File

@@ -149,11 +149,11 @@ void file_buttons(void)
uiDefButS(block, TOG|BIT|2, B_REDR, "Link", xco+=100,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Creates a link to selected data from current project");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
uiDefButS(block, TOGN|BIT|4, B_REDR, "Autosel", xco+=125,0,65,YIC, &sfile->flag, 0, 0, 0, 0, "Autoselect imported objects");
uiDefButS(block, TOG|BIT|4, B_REDR, "Autosel", xco+=125,0,65,YIC, &sfile->flag, 0, 0, 0, 0, "Autoselect imported objects");
uiDefButS(block, TOG|BIT|5, B_REDR, "Active Layer", xco+=65,0,80,YIC, &sfile->flag, 0, 0, 0, 0, "Append object(s) in active layer");
uiDefButS(block, TOG|BIT|6, B_REDR, "At Cursor", xco+=80,0,65,YIC, &sfile->flag, 0, 0, 0, 0, "Append object(s) at cursor, use centroid if more than one object is selected");
uiBlockEndAlign(block);
} else {
} else if(sfile->type==FILE_BLENDER) {
uiDefButI(block, TOGN|BIT|10, B_REDR, "Load UI", xco+=XIC,0,80,YIC, &G.fileflags, 0, 0, 0, 0, "Load the UI setup as well as the scene data");
xco+=100;
}