diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-08-29 19:05:34 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-08-29 19:11:12 +0300 |
commit | 5c7852ef9c6a77062adc3754258b181379e05f43 (patch) | |
tree | c99e63b0fef79499a6fca7a9147e27fe4f483354 /source/blender/editors/object/object_relations.c | |
parent | b9c400cee2ea34fc1d1a03bf27938d56785a11a5 (diff) |
LibOverride: Create override operator: various fixes.
* `make_override_library_exec` was not properly cleaning `LIB_TAG_DOIT`
from all IDs in the Main DB.
* `BKE_override_library_create_from_tag` was doing dangerous things
(like iterating over a BMain listbase while adding items to it...).
* It would remap *all* local usages of overridden linked IDs to new
overriding local IDs, which was very inconvinient.
New handling of remapping now allows to only remap inside of the group
of IDs that is being overridden, in other words you can still have e.g.
other empties still instancing the same linked collection...
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 67364f275dd..df684bfc210 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2426,6 +2426,8 @@ static int make_override_library_exec(bContext *C, wmOperator *op) if (!ID_IS_LINKED(obact) && obact->instance_collection != NULL && ID_IS_LINKED(obact->instance_collection)) { + BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); + Object *obcollection = obact; Collection *collection = obcollection->instance_collection; @@ -2503,7 +2505,7 @@ static int make_override_library_exec(bContext *C, wmOperator *op) /* Cleanup. */ BKE_main_id_clear_newpoins(bmain); - BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, false); + BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); } /* Else, poll func ensures us that ID_IS_LINKED(obact) is true. */ else if (obact->type == OB_ARMATURE) { @@ -2522,7 +2524,7 @@ static int make_override_library_exec(bContext *C, wmOperator *op) /* Cleanup. */ BKE_main_id_clear_newpoins(bmain); - BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, false); + BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); } /* TODO: probably more cases where we want to do automated smart things in the future! */ else { |