Fix #21992: linked objects could be in edit/particle/paint/sculpt mode,

not allowed, so disable mode on append and don't enable it on load.
This commit is contained in:
Brecht Van Lommel 2010-07-05 13:14:14 +00:00
parent feefb4d2d2
commit d89d1aa098
2 changed files with 4 additions and 1 deletions

@ -12136,6 +12136,7 @@ static void append_named_part(const bContext *C, Main *mainl, FileData *fd, char
ob->lay = scene->lay;
}
}
ob->mode= 0;
base->lay= ob->lay;
base->object= ob;
ob->id.us++;

@ -56,6 +56,7 @@ void ED_editors_init(bContext *C)
Main *bmain= CTX_data_main(C);
Scene *sce= CTX_data_scene(C);
Object *ob, *obact= (sce && sce->basact)? sce->basact->object: NULL;
ID *data;
/* toggle on modes for objects that were saved with these enabled. for
e.g. linked objects we have to ensure that they are actually the
@ -65,8 +66,9 @@ void ED_editors_init(bContext *C)
if(mode && (mode != OB_MODE_POSE)) {
ob->mode= 0;
data= ob->data;
if(ob == obact)
if(ob == obact && !ob->id.lib && !(data && data->lib))
ED_object_toggle_modes(C, mode);
}
}