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

Add a link/unlink option for subproperties like "scale" #144

Closed
golddotasksquestions opened this issue Oct 10, 2019 · 9 comments · Fixed by godotengine/godot#59125
Closed
Milestone

Comments

@golddotasksquestions
Copy link

golddotasksquestions commented Oct 10, 2019

Describe the project you are working on:
2D action game, card game

Describe the problem or limitation you are having in your project:
Throughout the day I change properties like scale in the editor many, many times. Which already can be quite annoying because of godotengine/godot#28618.
In 95% of the cases I want to change properties like scale proportionally. So I have to first set the x, then the y value, both to the same value. Because the editor does not offer to link those properties, all those operations have to be done twice ... every ... single ... time.

Describe how this feature / enhancement will help you overcome this problem or limitation:
A small clickable link/unlink icon next to values that would often be set proportionally.
A small mouseover text explaining what it does, for those unsure about the meaning of the icon, similar to mouseover on properties.
I would expect scale to be linked by default, others may be unlinked by default.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
linked_properties

Describe implementation detail for your proposal (in code), if possible:
I'm C++ illiterate.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
It's so common everywhere else, people are used to that level of comfort. I expect it to be used a lot.

Is there a reason why this should be core and not an add-on in the asset library?:
Noone will/would/should download addons for such small UI quality of life improvements.

@willnationsdev
Copy link
Contributor

This sounds like something one would have to program into the EditorProperty type that renders any Vector2/Vector3 value. Contained in /editor/editor_properties.h. I would add a ToolButton in between the label and the editable field on the top row and give it a tooltip. Then you just track a bool in the EditorProperty, write a public method to set it, bind that method to the ClassDB and connect to the ToolButton's "pressed" signal to set its value.

@Calinou
Copy link
Member

Calinou commented Oct 10, 2019

There are cases where linking values doesn't make sense (e.g. default gravity), so it should probably be defined in a property hint somehow. Likewise, position properties generally have no need to expose a "linked" option.

@rcorre
Copy link

rcorre commented Nov 14, 2019

For the specific case of scale, can you shift+click+drag in the corner of the gizmo?

out

That gif isn't showing my cursor, but I'm clicking in a corner between the red and green gizmo bits. The same thing works in 3D.

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Nov 14, 2019

@rcorre Yes, shift+LMB+drag when scale tool is selected (kinda) works to uniformly scale, though I think it behaves very unpredictably.

Anyway, this proposal is not about eyeballing with the scale tool, it's about putting in a precise numerical value in the inspector, and not having to do it twice or trice all the time.

If we had this feature, and you linked the subproperties in beforehand, I would assume you could select the scale tool, and LMB drag without shift just either one of the axis and you would get uniform scale. Or maybe not and we want the scale tool to act independently from the inspector link feature. ¯_(ツ)_/¯

Another option, (maybe easier to implement?) could be to make the inspector scale behave more like the viewport scale tool: When entering a new value in the inspector and simultaneously holding shift, the same value is applied to all axis.

@Calinou
Copy link
Member

Calinou commented Jul 8, 2020

Another option, (maybe easier to implement?) could be to make the inspector scale behave more like the viewport scale tool: When entering a new value in the inspector and simultaneously holding shift, the same value is applied to all axis.

I remember this being available back in the Godot 1.x days, but I think it was removed because it was too easy to accidentally do it when using an AZERTY keyboard layout (where entering numbers without a numpad requires holding Shift).

We could probably reimplement this, but using the Ctrl modifier instead.

@Calinou Calinou changed the title Link/Unlink option for subproperties like "scale" Add a link/unlink option for subproperties like "scale" Jul 8, 2020
@nathanfranke
Copy link

A few questions:

  1. Would a side button be better? The link button in the middle of x and y puts too much noise in that area.
    Here is my mockup:
    image

  2. Should this be made to work with other types, such as Vector3? What about odd types, that still have a similar format, such as Rect2?

  3. How exactly should the linking behave? Should it always snap both values to be the same, or attempt to maintain aspect ratio?

Calinou added a commit to Calinou/godot that referenced this issue Aug 27, 2020
For Rect2, Rect2i and AABB, this only applies to the size,
not the position.

This closes godotengine/godot-proposals#144.
@golddotasksquestions
Copy link
Author

golddotasksquestions commented Aug 27, 2020

@nathanfranke
I would think this would be really needed for the scale property first and foremost (and probably just in editor), not necessarily any Vectors data types.
As for behavior, what I imagined was when the scale is linked, whatever value the user changes, gets immediately copied to the other value. So if the user changes x 1 to x 0.5, y would immediately become 0.5 too. In case of 3D scale it would behave exactly the same, only this time instead of one, two other values would immediately change. So if the user changes x 1 to x 0.5, both z and y would jump to 0.5.

As for symbol placement, having where you proposed surely would be good as well. Having it close to the values might help to illustrate was it does intuitively. Otherwise moving the link symbol next to the property text might be a possibility too:
linked_scale2

@nathanfranke
Copy link

I originally also wanted it closer to the name, but the inspector isn't really designed to place things next to the name.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 13, 2022

WIP
godot windows tools 64_0vVp2dypAz

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