From da68feb0cadae4ba8d9dafb2e78dead66d7fe02c Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 17 Sep 2021 00:26:51 +0200 Subject: [PATCH] Print a warning if a 3D editor gizmo has no name defined Unnamed gizmos should be avoided, so this should help editor plugin authors resolve issues with gizmo naming if they forgot to override the function. (cherry picked from commit e5406ba952085985d1269a0dff9112c138be6bff) --- editor/plugins/spatial_editor_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 78926bb91a2..ce55037c772 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -6947,7 +6947,8 @@ String EditorSpatialGizmoPlugin::get_name() const { if (get_script_instance() && get_script_instance()->has_method("get_name")) { return get_script_instance()->call("get_name"); } - return TTR("Nameless gizmo"); + WARN_PRINT_ONCE("A 3D editor gizmo has no name defined (it will appear as \"Unnamed Gizmo\" in the \"View > Gizmos\" menu). To resolve this, override the `get_name()` function to return a String in the script that extends EditorSpatialGizmoPlugin."); + return TTR("Unnamed Gizmo"); } int EditorSpatialGizmoPlugin::get_priority() const {