diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index a527701563f..aa2b8913df8 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -93,8 +93,11 @@ Ref editor_generate_icon(int p_index, bool dark_theme = true) { Ref icon = memnew(ImageTexture); Ref img = memnew(Image); + // dumb gizmo check + bool is_gizmo = String(editor_icons_names[p_index]).begins_with("Gizmo"); + ImageLoaderSVG::create_image_from_string(img, dark_theme ? editor_icons_sources[p_index] : editor_icons_sources_dark[p_index], EDSCALE, true); - if ((EDSCALE - (float)((int)EDSCALE)) > 0.0) + if ((EDSCALE - (float)((int)EDSCALE)) > 0.0 || is_gizmo) icon->create_from_image(img); // in this case filter really helps else icon->create_from_image(img, 0); diff --git a/editor/icons/dark/icon_gizmo_camera.svg b/editor/icons/dark/icon_gizmo_camera.svg new file mode 100644 index 00000000000..f6e5f885e76 --- /dev/null +++ b/editor/icons/dark/icon_gizmo_camera.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/dark/icon_gizmo_directional_light.svg b/editor/icons/dark/icon_gizmo_directional_light.svg index a8739a5a781..f7fa732501a 100644 --- a/editor/icons/dark/icon_gizmo_directional_light.svg +++ b/editor/icons/dark/icon_gizmo_directional_light.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/dark/icon_gizmo_g_i_probe.svg b/editor/icons/dark/icon_gizmo_g_i_probe.svg new file mode 100644 index 00000000000..7d3adf41965 --- /dev/null +++ b/editor/icons/dark/icon_gizmo_g_i_probe.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/dark/icon_gizmo_particles.svg b/editor/icons/dark/icon_gizmo_particles.svg new file mode 100644 index 00000000000..cc88a76cd4d --- /dev/null +++ b/editor/icons/dark/icon_gizmo_particles.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/editor/icons/dark/icon_gizmo_reflection_probe.svg b/editor/icons/dark/icon_gizmo_reflection_probe.svg new file mode 100644 index 00000000000..6d80e73b8c8 --- /dev/null +++ b/editor/icons/dark/icon_gizmo_reflection_probe.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/dark/icon_gizmo_spatial_sample_player.svg b/editor/icons/dark/icon_gizmo_spatial_sample_player.svg index d40fe230ac5..7dbb4744bea 100644 --- a/editor/icons/dark/icon_gizmo_spatial_sample_player.svg +++ b/editor/icons/dark/icon_gizmo_spatial_sample_player.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/dark/icon_gizmo_spot_light.svg b/editor/icons/dark/icon_gizmo_spot_light.svg new file mode 100644 index 00000000000..9b4ddadd17a --- /dev/null +++ b/editor/icons/dark/icon_gizmo_spot_light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/icon_gizmo_camera.svg b/editor/icons/icon_gizmo_camera.svg new file mode 100644 index 00000000000..f6e5f885e76 --- /dev/null +++ b/editor/icons/icon_gizmo_camera.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/icon_gizmo_directional_light.svg b/editor/icons/icon_gizmo_directional_light.svg index a8739a5a781..f7fa732501a 100644 --- a/editor/icons/icon_gizmo_directional_light.svg +++ b/editor/icons/icon_gizmo_directional_light.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/icon_gizmo_g_i_probe.svg b/editor/icons/icon_gizmo_g_i_probe.svg new file mode 100644 index 00000000000..7d3adf41965 --- /dev/null +++ b/editor/icons/icon_gizmo_g_i_probe.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/icon_gizmo_particles.svg b/editor/icons/icon_gizmo_particles.svg new file mode 100644 index 00000000000..cc88a76cd4d --- /dev/null +++ b/editor/icons/icon_gizmo_particles.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/editor/icons/icon_gizmo_reflection_probe.svg b/editor/icons/icon_gizmo_reflection_probe.svg new file mode 100644 index 00000000000..6d80e73b8c8 --- /dev/null +++ b/editor/icons/icon_gizmo_reflection_probe.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/icon_gizmo_spatial_sample_player.svg b/editor/icons/icon_gizmo_spatial_sample_player.svg index d40fe230ac5..7dbb4744bea 100644 --- a/editor/icons/icon_gizmo_spatial_sample_player.svg +++ b/editor/icons/icon_gizmo_spatial_sample_player.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/icon_gizmo_spot_light.svg b/editor/icons/icon_gizmo_spot_light.svg new file mode 100644 index 00000000000..9b4ddadd17a --- /dev/null +++ b/editor/icons/icon_gizmo_spot_light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index be30369dfed..722f6519591 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -176,10 +176,10 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref &p_material, vs.push_back(Vector3(p_scale, -p_scale, 0)); vs.push_back(Vector3(-p_scale, -p_scale, 0)); - uv.push_back(Vector2(1, 0)); uv.push_back(Vector2(0, 0)); - uv.push_back(Vector2(0, 1)); + uv.push_back(Vector2(1, 0)); uv.push_back(Vector2(1, 1)); + uv.push_back(Vector2(0, 1)); Ref mesh = memnew(ArrayMesh); Array a; @@ -855,7 +855,7 @@ void LightSpatialGizmo::redraw() { if (Object::cast_to(light)) { Ref material = create_material("light_spot_material", gizmo_color, true); - Ref icon = create_icon_material("light_spot_icon", SpatialEditor::get_singleton()->get_icon("GizmoLight", "EditorIcons")); + Ref icon = create_icon_material("light_spot_icon", SpatialEditor::get_singleton()->get_icon("GizmoSpotLight", "EditorIcons")); clear(); @@ -1145,6 +1145,7 @@ void CameraSpatialGizmo::redraw() { Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/camera"); Ref material = create_material("camera_material", gizmo_color); + Ref icon = create_icon_material("camera_icon", SpatialEditor::get_singleton()->get_icon("GizmoCamera", "EditorIcons")); switch (camera->get_projection()) { @@ -1215,6 +1216,7 @@ void CameraSpatialGizmo::redraw() { add_lines(lines, material); add_collision_segments(lines); + add_unscaled_billboard(icon, 0.05); add_handles(handles); } @@ -2340,6 +2342,7 @@ void ParticlesGizmo::redraw() { Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/particles"); Ref material = create_material("particles_material", gizmo_color); + Ref icon = create_icon_material("particles_icon", SpatialEditor::get_singleton()->get_icon("GizmoParticles", "EditorIcons")); add_lines(lines, material); add_collision_segments(lines); @@ -2352,6 +2355,7 @@ void ParticlesGizmo::redraw() { } //add_unscaled_billboard(SpatialEditorGizmos::singleton->visi,0.05); + add_unscaled_billboard(icon, 0.05); add_handles(handles); } ParticlesGizmo::ParticlesGizmo(Particles *p_particles) { @@ -2497,6 +2501,7 @@ void ReflectionProbeGizmo::redraw() { Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/reflection_probe"); Ref material = create_material("reflection_probe_material", gizmo_color); + Ref icon = create_icon_material("reflection_probe_icon", SpatialEditor::get_singleton()->get_icon("GizmoReflectionProbe", "EditorIcons")); Color gizmo_color_internal = gizmo_color; gizmo_color_internal.a = 0.5; @@ -2513,6 +2518,7 @@ void ReflectionProbeGizmo::redraw() { } //add_unscaled_billboard(SpatialEditorGizmos::singleton->visi,0.05); + add_unscaled_billboard(icon, 0.05); add_collision_segments(lines); add_handles(handles); } @@ -2586,6 +2592,7 @@ void GIProbeGizmo::redraw() { Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/gi_probe"); Ref material = create_material("gi_probe_material", gizmo_color); + Ref icon = create_icon_material("gi_probe_icon", SpatialEditor::get_singleton()->get_icon("GizmoGIProbe", "EditorIcons")); Color gizmo_color_internal = gizmo_color; gizmo_color_internal.a = 0.1; Ref material_internal = create_material("gi_probe_internal_material", gizmo_color_internal); @@ -2671,6 +2678,7 @@ void GIProbeGizmo::redraw() { add_solid_box(solid_material, aabb.get_size()); } + add_unscaled_billboard(icon, 0.05); add_handles(handles); } GIProbeGizmo::GIProbeGizmo(GIProbe *p_probe) {