Fix T100412: LibOverride: shift click on the modifier link button do not create override

Add support for the (geometry)node tree case.

Also add warning about not being implemented for other types.
This commit is contained in:
Bastien Montagne 2022-08-16 14:36:58 +02:00
parent a93f6a5429
commit 8aa094263b
Notes: blender-bot 2023-02-13 14:42:48 +01:00
Referenced by issue #100476, Shift click to create overrides on objects not working
Referenced by issue #100412, Regression: shift click on the modifier link button do not create override
1 changed files with 10 additions and 1 deletions

View File

@ -684,6 +684,7 @@ static void template_id_liboverride_hierarchy_create(bContext *C,
* NOTE: do not attempt to perform such hierarchy override at all cost, if there is not enough
* context, better to abort than create random overrides all over the place. */
if (!ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(id)) {
RNA_warning("The data-block %s is not direclty overridable", id->name);
return;
}
@ -816,7 +817,8 @@ static void template_id_liboverride_hierarchy_create(bContext *C,
case ID_CV:
case ID_PT:
case ID_VO:
if (object_active != NULL && object_active->data == id) {
case ID_NT: /* Essentially geometry nodes from modifier currently. */
if (object_active != NULL) {
if (collection_active != NULL &&
BKE_collection_has_object_recursive(collection_active, object_active)) {
template_id_liboverride_hierarchy_collections_tag_recursive(collection_active, id, true);
@ -850,12 +852,16 @@ static void template_id_liboverride_hierarchy_create(bContext *C,
case ID_MA:
case ID_TE:
case ID_IM:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
break;
case ID_WO:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
break;
case ID_PA:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
break;
default:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
break;
}
if (id_override != NULL) {
@ -868,6 +874,9 @@ static void template_id_liboverride_hierarchy_create(bContext *C,
* above). */
RNA_id_pointer_create(id_override, idptr);
}
else {
RNA_warning("The data-block %s could not be overridden", id->name);
}
}
static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)