-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Improve editing of min/max particle properties #81260
Improve editing of min/max particle properties #81260
Conversation
Looks great! For those wondering, you can change deviation without unfolding the inspector by holding Shift before dragging from anywhere with the left mouse button (you don't have to aim for the min/max icon).
We can add a tooltip when hovering the slider at the very least, similar to EditorSpinSlider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial lookover. I believe we need to decouple this from particles and just call it MinMaxPropertyEditor. I'll post UX suggestions as a comment in a bit.
This is a downgrade for me personally, as I usually use the line edits to write my values. I suggest we change this: I think instead of numbers, we should have two EditorSpinSliders that can be edited while you're not using the widget. This means that this could be simplified: Instead, the arrow could popup a context menu with the two options - Range, Pivot - to change which values are shown. This would save A LOT of vertical space. What if you want to see min/max easily while editing pivot mode, for example? IMO, this should be a tooltip while you're hovering the slider. Speaking of hovering, the slider needs hovering and dragging feedback. In general, I suggest making the colors similar to scrollbars in the editor. I think the grabbers to the side of the slider are way too big and could be confused for part of the range. In my opinion, shrink their width, and expand the click area only programmatically. Make them a different darker color, maybe. Edit: The arrow doesn't even have to be an arrow if this is done, it can just be a toggle button that changes between the two methods, this would make it even easier to use. |
6535686
to
de6f566
Compare
de6f566
to
39df870
Compare
I'm back to working on this PR. Pushed a fix for EditorProperty. @MewPurPur How do you imagine replacing the labels with EditorSpinSliders? There is enough space only to display min/max, with pivot/deviation it would get extremely cramped. Unless the sliders are displayed in 2 rows, which would mean that the editor would take 3 rows by default (currently it takes two). I wanted it to take as small vertical space as possible. |
Then I'd need icons for min, max, pivot and deviation. Not sure if |
If you think this is a good direction to pursue, just ping me when you need the icons |
Looks fantastic IMO! The next thing I think needs to be done in terms of GUI is to:
Ugly mock-up with the right handle being hovered: |
39df870
to
3859ffe
Compare
Pushed the new layout (still need to apply other changes). |
716bca0
to
14d2983
Compare
Finished. godot.windows.editor.dev.x86_64_XBCh54XPgb.mp4EDIT: godot.windows.editor.dev.x86_64_nsO8pGigdE.mp4Does it make sense? The "active" color is the same as the middle bar, so not sure. |
@QbieShay, @TheRensei and I discussed the naming of the parameters again and settled with value and the plus-minus sign ( Disclaimer: The following wasn't part of the discussion |
fafde43
to
a424439
Compare
Something like that? godot.windows.editor.dev.x86_64_sAw10cDTAR.mp4I removed the modifier. Now clicking anything outside arrows will move the center. |
a424439
to
dd74dc5
Compare
dd74dc5
to
c0e37ce
Compare
I tested again and i had concerns about the backwards compatibility with animation player possibly animating min-max properties, but im happy to report it works now (it's also not a common usecase as far as i know). Not necessary for this PR, but i think that the shift modifier for making smaller change would help also this feature 👍 |
c0e37ce
to
e7dc615
Compare
Going below limit with avg +- doesn't work, there's some quirks there. also the slider of the +- is being funny when moved 🤔 |
Not sure what do you mean by that.
That's because the max value adjusts to be within the range. |
Sorry - I shoudl articulate better. In the avg mode (not minmax), i think the sliders are clamped to the min or max, even if the property specifies I don't think it's a blocking issue anyway. |
Ok I made lesser/greater allowed in the second mode. However the max value of ± can't be greater than max - min of the property. Also ± only allows "or greater" when both min and max can go outside range. |
e7dc615
to
ce9fec9
Compare
just tested, NICE 👌 I can't approve again but i APPROVE |
background_color = dark_theme ? Color(0.3, 0.3, 0.3) : Color(0.7, 0.7, 0.7); | ||
normal_color = dark_theme ? Color(0.5, 0.5, 0.5) : Color(0.8, 0.8, 0.8); | ||
hovered_color = dark_theme ? Color(0.8, 0.8, 0.8) : Color(0.6, 0.6, 0.6); | ||
drag_color = hovered_color.lerp(accent_color, 0.8); | ||
midpoint_color = dark_theme ? Color(1, 1, 1) : Color(0, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to put stuff like this into the editor theme. But we don't have a good reference how to do this in an organized manner. A task for another day...
hb->add_child(toggle_mode_button); | ||
toggle_mode_button->connect(SNAME("toggled"), callable_mp(this, &ParticleProcessMaterialMinMaxPropertyEditor::_toggle_mode)); | ||
|
||
set_bottom_editor(content_vb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mark the range widget as focusable with add_focusable
? Or can it not be controlled with the keyboard at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be done in a follow-up, if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not controllable with keyboard. Focus would help with #81260 (comment) (last point), but it's a plain Control and has no focus style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! Amazing usability improvement for particles 🌟 |
This is really fantastic to use!! What a great UI improvement! Thanks KoBeWi and thanks also to everyone commenting with improvement suggestions, especially MewPurPur! I would really love to use this slider (in countless places really) in my projects. Both for exported values in the Inspector as well as Control node. I tried to figure out if it is already available outside the GPUParticle node, but it seems to be it is not. Would it make sense to open a proposal? |
I think this could be exposed using a special property hint. The only problem is that right now it's basically hard-coded into the particle material, so the new editor needs some internal rework. It's not very difficult to replicate in GDScript though, I did a prototype before opening the PR. But yeah, opening a proposal wouldn't hurt. |
Adds this fancy widget for particles:
f4KJJapiWI.mp4
It can edit min and max as part of the one slider, including dragging them together and scaling. Old sliders are still provided for more precise values and values outside the default range. There is also a new slider mode where you can edit pivot and deviation instead of min and max.
This required some internal changes to ParticleProcessMaterial, namely the min/max properties have now third property, which is a vector of both min and max. This was needed to add inspector plugin. The linked properties are editor only, while the old properties are code-only and stored in scene. I added a convenience macro to make binding min/max properties easier.
Closes godotengine/godot-proposals#7583
Closes godotengine/godot-proposals#4315
Builds on top of #79527, so putting as draft until that PR is merged.
EDIT:
Here's new style:
Ea6ledp2yv.mp4
Production edit: closes godotengine/godot-roadmap#17