godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.1k stars 69 forks source link

Hold down the Shift key while dragging to fine-tune values and sliders #8410

Closed ikonnow closed 9 months ago

ikonnow commented 9 months ago

Describe the project you are working on

A glasshouse in XR to test Godot 4 rendering abilities

Describe the problem or limitation you are having in your project

Currently, when editing values and sliders in the Godot editor, there is no way to adjust them with more precision and efficiency. The value changes by a fixed amount (the step) every time the slider is moved or the arrow keys are pressed. This can be inconvenient and frustrating when trying to set a specific value or make a small adjustment. For example, if the step is 1 and the user wants to set the value to 0.5, they have to type it manually or use the mouse wheel, which is not very intuitive or ergonomic.

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

I propose to add the option to fine tune values and sliders in Godot by holding down the Shift key, similar to Blender. This would allow for more precise and efficient adjustments of parameters, such as rotation, scale, position, etc. When holding down Shift, the value would change by a fraction of the step (the fine_tune_ratio), which would give more control and accuracy.

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

I think this feature will require modifying the code of the EditorSpinSlider class, which is used to display and edit values and sliders in the editor. The idea is to add a new property called fine_tune_ratio, which will determine how much the value changes when holding down the Shift key. For example, if the fine_tune_ratio is 0.1, then holding down Shift will make the value change 10 times slower than normal. The default value of fine_tune_ratio could be 0.1, but it could also be exposed as an editor setting for users to customize.

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

This enhancement cannot be worked around with a few lines of script, as it requires modifying the internal behavior of the EditorSpinSlider class. A possible workaround would be to create a custom editor plugin that replaces all EditorSpinSliders with custom ones that implement this feature, but this would be cumbersome and inefficient.

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

I think this feature should be part of the core engine because it affects a fundamental aspect of the editor interface, which is the editing of values and sliders. It is not something that can be easily added or modified by an add-on, as it requires changing the code of a core class (EditorSpinSlider). Moreover, this feature would benefit all users who work with values and sliders in the editor, regardless of their specific use case or project type. It would also make Godot more consistent with Blender, which is a widely used tool in the game development community.

ikonnow commented 9 months ago

Realized it is already possible!