Report messages from override ID template to the UI.

Previously these were only written to the console with no UI feedback
whatsoever. Just a bit nicer to give the user some info that something
went wrong.

See also T102495.

Differential Revision: https://developer.blender.org/D15732
This commit is contained in:
Philipp Oeser 2022-11-15 15:53:06 +01:00 committed by Bastien Montagne
parent bcb20e9a29
commit 2459a3c9b1
1 changed files with 7 additions and 6 deletions

View File

@ -686,7 +686,7 @@ ID *ui_template_id_liboverride_hierarchy_make(
* 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 overridable", id->name);
WM_reportf(RPT_ERROR, "The data-block %s is not overridable", id->name);
return NULL;
}
@ -846,18 +846,19 @@ ID *ui_template_id_liboverride_hierarchy_make(
case ID_MA:
case ID_TE:
case ID_IM:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
WM_reportf(RPT_WARNING, "The type of data-block %s is not yet implemented", id->name);
break;
case ID_WO:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
WM_reportf(RPT_WARNING, "The type of data-block %s is not yet implemented", id->name);
break;
case ID_PA:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
WM_reportf(RPT_WARNING, "The type of data-block %s is not yet implemented", id->name);
break;
default:
RNA_warning("The type of data-block %s could not yet implemented", id->name);
WM_reportf(RPT_WARNING, "The type of data-block %s is not yet implemented", id->name);
break;
}
if (id_override != NULL) {
id_override->override_library->flag &= ~IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED;
*r_undo_push_label = "Make Library Override Hierarchy";
@ -901,7 +902,7 @@ static void template_id_liboverride_hierarchy_make(bContext *C,
}
}
else {
WM_reportf(RPT_WARNING, "The data-block %s could not be overridden", id->name);
WM_reportf(RPT_ERROR, "The data-block %s could not be overridden", id->name);
}
}