[Bf-blender-cvs] [0e7a592c3c1] blender2.8: WM: report error w/ unknown operator name
Campbell Barton
noreply at git.blender.org
Tue Oct 2 07:29:18 CEST 2018
Commit: 0e7a592c3c16bfb77ca9410a49d00d416406bdec
Author: Campbell Barton
Date: Tue Oct 2 15:28:14 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB0e7a592c3c16bfb77ca9410a49d00d416406bdec
WM: report error w/ unknown operator name
===================================================================
M source/blender/makesrna/intern/rna_workspace_api.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c
index aac38d05cd8..78e617450e8 100644
--- a/source/blender/makesrna/intern/rna_workspace_api.c
+++ b/source/blender/makesrna/intern/rna_workspace_api.c
@@ -117,6 +117,7 @@ static void rna_WorkspaceTool_refresh_from_context(
static PointerRNA rna_WorkspaceTool_operator_properties(
bToolRef *tref,
+ ReportList *reports,
const char *idname)
{
wmOperatorType *ot = WM_operatortype_find(idname, true);
@@ -126,6 +127,9 @@ static PointerRNA rna_WorkspaceTool_operator_properties(
WM_toolsystem_ref_properties_ensure(tref, ot, &ptr);
return ptr;
}
+ else {
+ BKE_reportf(reports, RPT_ERROR, "Operator '%s' not found!", idname);
+ }
return PointerRNA_NULL;
}
@@ -164,6 +168,7 @@ void RNA_api_workspace_tool(StructRNA *srna)
/* Access tool operator options (optionally create). */
func = RNA_def_function(srna, "operator_properties", "rna_WorkspaceTool_operator_properties");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_string(func, "operator", NULL, 0, "", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
/* return */
More information about the Bf-blender-cvs
mailing list