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.
This commit is contained in:
parent
d42530824e
commit
cd6250c220
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue