diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-21 16:58:28 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-21 17:00:39 +0300 |
commit | cd6250c220e33bfc2131b78826163ccc069f2a30 (patch) | |
tree | 7a7f1854c1f4fa34f86baab71e1a1e73d64f012f /source/blender/editors | |
parent | d42530824e434fcc4c8d5394dd65f44cf3e8c16f (diff) |
Fix (unreported) broken code in recent override operator enhancements.
When overriding a whole linked collection from a single object in
3DView, said 'reference' object would be removed by code. We only want
that behavior when overriding from an instanciating Empty.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 7d40b48dd83..17370b88861 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2303,6 +2303,7 @@ static int make_override_library_exec(bContext *C, wmOperator *op) ViewLayer *view_layer = CTX_data_view_layer(C); Object *obact = CTX_data_active_object(C); ID *id_root = NULL; + bool is_override_instancing_object = false; if (!ID_IS_LINKED(obact) && obact->instance_collection != NULL && ID_IS_LINKED(obact->instance_collection)) { @@ -2315,6 +2316,7 @@ static int make_override_library_exec(bContext *C, wmOperator *op) } id_root = &obact->instance_collection->id; + is_override_instancing_object = true; } else if (!make_override_library_ovject_overridable_check(bmain, obact)) { const int i = RNA_property_enum_get(op->ptr, op->type->prop); @@ -2352,7 +2354,7 @@ static int make_override_library_exec(bContext *C, wmOperator *op) /* Remove the instance empty from this scene, the items now have an overridden collection * instead. */ - if (success && id_root != &obact->id) { + if (success && is_override_instancing_object) { ED_object_base_free_and_unlink(bmain, scene, obact); } |