diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-16 21:22:54 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-16 21:22:54 +0200 |
commit | 7ca579cb2742e3a7f758903736cc53b9c8ae2c2d (patch) | |
tree | 1411f167eeb0091a238f04e95d6677a7e36baa5d /editor/plugins/gizmos/decal_gizmo_plugin.cpp | |
parent | 51f67ea4c51109d23eda29d68ae83e532fb01cbc (diff) | |
parent | 5345cf3e756e3084c227a823a1e31a8b9716d584 (diff) | |
download | redot-engine-7ca579cb2742e3a7f758903736cc53b9c8ae2c2d.tar.gz |
Merge pull request #81554 from Calinou/editor-gizmos-add-decal
Add 3D editor gizmo icons for Decal, LightmapProbe and FogVolume
Diffstat (limited to 'editor/plugins/gizmos/decal_gizmo_plugin.cpp')
-rw-r--r-- | editor/plugins/gizmos/decal_gizmo_plugin.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/gizmos/decal_gizmo_plugin.cpp b/editor/plugins/gizmos/decal_gizmo_plugin.cpp index 68206a7ee5..7572e1dcd5 100644 --- a/editor/plugins/gizmos/decal_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/decal_gizmo_plugin.cpp @@ -30,7 +30,9 @@ #include "decal_gizmo_plugin.h" +#include "editor/editor_node.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/gizmos/gizmo_3d_helper.h" #include "editor/plugins/node_3d_editor_plugin.h" @@ -40,6 +42,8 @@ DecalGizmoPlugin::DecalGizmoPlugin() { helper.instantiate(); Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/decal", Color(0.6, 0.5, 1.0)); + create_icon_material("decal_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoDecal"), EditorStringName(EditorIcons))); + create_material("decal_material", gizmo_color); create_handle_material("handles"); @@ -124,7 +128,9 @@ void DecalGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Vector<Vector3> handles = helper->box_get_handles(decal->get_size()); Ref<Material> material = get_material("decal_material", p_gizmo); + const Ref<Material> icon = get_material("decal_icon", p_gizmo); p_gizmo->add_lines(lines, material); + p_gizmo->add_unscaled_billboard(icon, 0.05); p_gizmo->add_handles(handles, get_material("handles")); } |