Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Color Customization and Visibility Toggle for GridMap Editor Gridlines #11483

Open
gdevgodot opened this issue Jan 3, 2025 · 1 comment

Comments

@gdevgodot
Copy link

gdevgodot commented Jan 3, 2025

Describe the project you are working on

I am working on a 3D level editor using Godot Engine’s GridMap tool to create tile-based environments efficiently. The project requires precise and adaptable tools to design visually appealing and functional 3D maps.

Describe the problem or limitation you are having in your project

The GridMap editor lacks the ability to customize the gridline color or toggle their visibility.

  • The default gridline color can blend with tiles or backgrounds, making it hard to differentiate between gridlines and other visual elements.
  • Gridlines can also be distracting or obstructive when fine-tuning visual details in certain workflows.

This limitation impacts the usability and accessibility of the GridMap editor.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The proposed enhancement involves two features:

  1. Gridline Color Customization:
    Allow users to adjust the color of gridlines through a color picker in the Editor Settings. This would ensure that the gridlines are always visible and suitable for the current scene.

  2. Gridline Visibility Toggle:
    Provide an option to hide or show the gridlines via a toggle in the GridMap toolbar or as a setting in the Editor Settings. This would help users focus on specific visual details when gridlines are unnecessary.

These enhancements would significantly improve usability, accessibility, and flexibility in the GridMap editor, enabling more efficient workflows.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Here is a high-level overview of how these features can be implemented:

  1. Gridline Color Customization:

    • Add a new setting in Editor Settings > Editors > GridMap for gridline color.
    • Use a color picker UI element to allow users to select their desired color.
    • Update the gridline rendering logic in the GridMap editor to use the selected color.

    Pseudo-code:

var gridline_color = ProjectSettings.get("editor/editors/gridmap/gridline_color")
var show_gridlines = true

func _draw_grid():
    draw_line(start, end, gridline_color, width) 
  
func _draw_grid():
    if show_gridlines:
          draw_gridlines()

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, this enhancement cannot easily be worked around. Gridline rendering is handled internally by the GridMap editor, and there is no direct way to adjust the gridline color or visibility without modifying the core editor.

Is there a reason why this should be core and not an add-on in the asset library?

This feature directly affects the usability of a core Godot tool (GridMap editor). Including it in the core ensures consistent behavior and accessibility for all users. As it involves editor-level changes, implementing it as a plugin would be cumbersome and less efficient compared to integrating it into the engine’s core functionality.

@Calinou
Copy link
Member

Calinou commented Jan 3, 2025

The grid color is currently hardcoded here:

https://github.com/godotengine/godot/blob/bdf625bd54958c737fa6b7213b07581cc91059ad/modules/gridmap/editor/grid_map_editor_plugin.cpp#L1716

Regarding the visibility of 3D editor gizmos in general, see #9299 and #3322.

Edit: I've opened a PR that adds an editor setting for the GridMap grid color: godotengine/godot#101101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants