-
Notifications
You must be signed in to change notification settings - Fork 105
Gizmo overhaul for translate/rotate/scale #1428
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
Conversation
* Update PlayCanvas dependency to version 2.10.3 and refine type declarations for 'pc' and 'pcx' in types.d.ts * feat: replaced translate gizmo with engine one * refactor: simplify layer creation and entity attachment in translate gizmo * feat: added history management to gizmo * fix: preserve history state in setTRS function * fix: update history management in gizmo-translate to use cache instead of store * fix: rename state variable to action for clarity in history management * fix: update action structure for history management in gizmo-translate * feat: replaced old gizmos with new scale and rotate gizmos * feat: combined all transform gizmos into one class * fix: allow for switching cameras for gizmos * fix: add write permission check to gizmo update logic * feat: add snapping functionality to gizmos with configurable increment * feat: add custom theme to gizmos to match the look of existing ones * feat: set gizmo opacity to 0.7 * feat: update gizmo theme structure and add guideOccluded color settings * feat: add xyz color settings for guideOccluded in gizmo initialization * feat: update guideOccluded settings to guideOcclusion for improved clarity * feat: simplify color settings in initGizmo by removing opacity and enabling orbit rotation for RotateGizmo * feat: override picker to reset node and picked if gizmo is being hovered * feat: update initGizmo to disable axis shapes for improved scaling intuitiveness * feat: set dragMode to 'hide' for RotateGizmo in initGizmo for improved user experience * feat: toggle camera and viewport pick state during gizmo initialization * fix: update drag mode for RotateGizmo to 'selected' * feat: add angle guide thickness to gizmo initialization * fix: rename parameter in gizmo:coordSystem event for clarity * fix: update gizmo initialization to hide center sphere and rotation ball * fix: update playcanvas version to 2.11.1 and adjust Node.js engine requirement * fix: update playcanvas version to 2.11.2 * fix: unify gizmo visibility handling by replacing individual calls with a single event emission * fix: improve visibility handling in update function by separating write permission check * fix: refactor gizmo update handling to use reflow for visibility and selection changes * fix: update gizmo enable logic to depend on write state and visibility * fix: update gizmo visibility handling by emitting events on handle changes * fix: update gizmo event handling to track hover state and trigger viewport render on updates * fix: integrate FORCE_PICK_TAG into gizmo entity creation and viewport picking logic
|
This PR changes visuals and most importantly mechanics of how gizmos behave. This is extremely undesirable, as users got intuition and comfort of using current gizmos, and just abruptly without any warning or choice forcing everyone to re-learn, without any benefits, with actual reduction in experience. Very very undesirable. Issues:
|
|
Please vote on this poll if these changes are desirable or will make you unhappy: https://x.com/mrmaxm/status/1966079197618847987 |
|
I'm not a huge fan of the axis flipping behaviour as a default setting as that's quite confusing. The other issues that Max has raised I personally don't see as deal breakers (colours could (and maybe should?)) be added as presets in settings but the axis flipping I personally find very confusing as I have to mentally flip the axis to know the orientation of the object when selected 11.Sep.2025.at.11.10.mp4Edit: The more I use the new rotation gizmo, I think it's fine but likely to need a sensitivity setting Edit2: Ah sorry, knee jerk reaction. Looks like there is a setting to switch between the two #1431 |
|
https://github.com/user-attachments/assets/c1ff51da-e3dd-46fa-ae30-196207129821
If i move entity right now, will my entity move like i drawn here? NOPE, i just rotated my camera around entity and coordinate changes will be exactly opposite
Yeah, I see that there is option to disable axes flipping, but this SHOULD NOT be default behaviour |
|
I usually use the arrows as an indication of which direction is a positive or negative axis in relation to the object. I can see it by selecting an entity. With flipping arrows, I would have to move the object to see how the values change in order to find out the same info. Not sure I like it, but not going to fuss about it either. A matter of habbit I guess. Scale and rotation are fine for me. |
|
The axis flipping was added so that the gizmos would still be reachable if covered by other parts (i.e.. the planes). The line connected to the center was removed to show direction but seems like its not clear enough. I am going to remove the axis flipping in favor of better positioning of planes (like how Blender and Unity handle it) |
|
When flying with WASDQE, raycasting is not happening, only when mouse is moved, leading to "croppy" movement of the gizmos. Video shows how it works currently (correct), and how it works with this PR (incorrect). 2025-10-22.15-10-46.mp4 |
|
Regression: It is not possible with a new Gizmo (this PR) to grab object, and use look around (right mouse button) while dragging the object. Video below shows current behavior, that allows to drag object, and re-orient camera while doing so, while the new gizmo, simply ignores right click, leading to inability to re-orient, which forces to release first, re-orient, and then grab again. We use look around with WASD in our projects pretty much everywhere, and this will be a regression in UX. 2025-10-22.15-15-16.mp4 |
|
Regression with multi-selection and local space gizmos. Currently, when multi-selecting, and using local space, gizmo will be positioned at the last selected entity, and will be rotated based on that entity. So manipulating that gizmo, behaving same as manipulating a single entity, no funky weird stuff. Other entities will transform in their local space. With this PR, the rotation of gizmo will be based on last selected entity, but the position will be based on center of selection's AABB - so when you interact with the gizmo, it does not follow mouse at all, and moves around in weird directions. Also when pointer up, the gizmo will not be where your mouse is, and be moved to another average place, with more complex selections, user has to "chase" the gizmo around. And won't be able to move objects where they expect. Video shows, how it is now (correct), and how it is with this PR: 2025-10-22.16-31-52.mp4 |
|
On Classic gizmos: A few new features that feels good:
Some that feels as downgrade in addition to logical described in messages above:
On "default" gizmos (new):
Why not make current (classic) gizmo behavior slightly better, and simply ship it, without complicating code-base with two versions of gizmos, and also splitting users with two versions of gizmos? Why complicating it all? |
|
@Maksims thanks again for the QA review 😄
|
|
Let us use this gizmos in work for a day, so we can battle test it, and see if we are all good. |
|
Minor one, but nonetheless: When using ortho camera, the rectangle in translate gizmo, is flipping around - this is actually a current behavior also. But other small bit, is when rectangle is flipped, the length of an arrow, is not extended to the middle of the gizmo: Notice that red (X) axis line, starts not from middle when rectangle is flipped, but from far away, making it non-hoverable from the middle. Also the line thickness feels like less than 1 pixel, making it very thing compared to other lines. Also rectangle style, I personally like the current one way more, than this solid one. |
@Maksims thanks for testing 🙂 . I will probably do some follow up PRs in the engine down the road to address the inconsistencies in the gizmo design like the line thickness, length and the rectangle opacity but this PR I just want to make sure they function at least as good as the existing ones. |






Continuation of #1367
Requires
What's changed
Testing
v2.12.4