-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Fix grid snapping for box shape gizmos #82381
Conversation
Shouldn't the gizmos get snapped to the grid? godot.windows.editor.dev.x86_64_QZiiSPkNMR.mp4They move in correct increments, but not sure if this is intended. |
I'm quite new to Godot, so I'm not sure myself if it's intended or not, but AFAIK all translation ops with grid snapping just force target property to change in integer increments (0.1 increments if shifted). I think that makes sense for box sizing, though because when I'm working with several CSG shapes I find it handy if they all snap like this, so they can fit together even then their origin is not on grid. |
On the other hand, I think it would be quite simple to make it always snap to visual grid. This would cause size property to deviate from being integer, but it always could be corrected by pulling the other side of the box. However, this would be inconsistent with translation gizmo behavior, and also would be a change from original behavior of this specific gizmo, so I assume even if it is desired, it shouldn't be a part of this PR? |
Yeah, I guess. |
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.
Seems fine.
CC @Calinou You might want to test the fixed behavior.
Could you squash the commits? See PR workflow for instructions. |
"Extruding" box face (i.e. moving it without holding Alt key) will now always snap new box size exactly to the nearest snap step.
Thanks! And congrats for your first merged Godot contribution 🎉 |
Thanks for merging! |
Thanks so much, just tested it and it seems to work well. This will make grey-boxing levels so much easier! |
Fixes #81916
I've rewritten Gizmo3DHelper logic for its box "extrusion" mode. In this version it applies snapping directly to box size and then adjusts box position by ensuring that opposite end of the box doesn't move as result of the operation. This way box size doesn't deviate from the snap grid.
Position (origin) adjustment logic is thus: