fix for issue #2 in report: [#26695] Two fail cases with modifiers targeting linked assets

also fix for scene.objects.link() not setting library data as being directly used.
This commit is contained in:
Campbell Barton
2011-03-31 08:49:52 +00:00
parent 278e2bc3a4
commit d7dd2154a1
2 changed files with 6 additions and 3 deletions

View File

@@ -437,9 +437,12 @@ static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRN
{
Object *ob= value.data;
if(!self || ob != self)
if(!ob || type == OB_EMPTY || ob->type == type)
if(!self || ob != self) {
if(!ob || type == OB_EMPTY || ob->type == type) {
id_lib_extern((ID *)ob);
*ob_p= ob;
}
}
}
static void rna_LatticeModifier_object_set(PointerRNA *ptr, PointerRNA value)

View File

@@ -222,7 +222,7 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report
}
base= scene_add_base(scene, ob);
ob->id.us++;
id_us_plus(&ob->id);
/* this is similar to what object_add_type and add_object do */
base->lay= scene->lay;