feat: viewport gizmo grid snapping (translate, rotate, scale)#818
Open
yuripourre wants to merge 6 commits intoBabylonJS:masterfrom
Open
feat: viewport gizmo grid snapping (translate, rotate, scale)#818yuripourre wants to merge 6 commits intoBabylonJS:masterfrom
yuripourre wants to merge 6 commits intoBabylonJS:masterfrom
Conversation
Add localStorage-backed snap preferences, UE-style toolbar toggles with inspector-style scrub fields, and optional Edit Preferences section. Wire Babylon PositionGizmo, RotationGizmo, and ScaleGizmo snapDistance.
julien-moreau
requested changes
Mar 31, 2026
Contributor
julien-moreau
left a comment
There was a problem hiding this comment.
Thanks a lot !! It's a missing feature that I planned to do but you did it thanks a lot !!!
Just some comments, in order to prepare the future :)
julien-moreau
requested changes
Mar 31, 2026
julien-moreau
requested changes
Mar 31, 2026
added 2 commits
March 31, 2026 11:53
julien-moreau
requested changes
Apr 2, 2026
Contributor
julien-moreau
left a comment
There was a problem hiding this comment.
Just some new findings
editor/src/project/load/load.tsx
Outdated
| const directory = dirname(path); | ||
| const project = (await readJSON(path, "utf-8")) as IEditorProject; | ||
| const packageManager = project.packageManager ?? "yarn"; | ||
| const gizmoSnap = roundGizmoSnapSteps({ ...defaultGizmoSnapPreferences }); |
Contributor
There was a problem hiding this comment.
Should the argument no come from project? Because you save it in the project you should use it
editor/src/editor/main.tsx
Outdated
| /** | ||
| * Gizmo snap for the current session (translate, rotate, scale); not persisted in the project file. | ||
| */ | ||
| gizmoSnap: IGizmoSnapPreferences; |
Contributor
There was a problem hiding this comment.
Should be stored only in the Preview component. Does it have a sense to be global instead of being scoped to preview stuff?
Contributor
Author
There was a problem hiding this comment.
True! Those are left overs from before the last commit. Nice catch
Contributor
Author
|
@julien-moreau I've made some changes, please let me know if that's what you had in mind |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
UE-style toolbar toggles with inspector-style scrub fields
Summary
Changes Made
Benefits