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

Fix transform gizmo local space mode when multiple nodes are selected #102176

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryevdokimov
Copy link
Contributor

The basis of the gizmo did not update correctly when switching to local space mode and multiple nodes are selected. Note in the before video that despite the gizmo still being rotated for global space, the transform was computed in local space. I'm not sure why the limitation to a single selected node existed in the first place, it seems to be deliberately added, but I can't find any issues removing it during testing.

Before:

2025-01-30.09-56-29.mp4

After:

2025-01-30.09-54-40.mp4

@ryevdokimov ryevdokimov requested a review from a team as a code owner January 30, 2025 06:10
@fire
Copy link
Member

fire commented Jan 30, 2025

According to when I asked, this was to match Blender behaviour #68804

So, it is intended, and to avoid behaviour breakage, we can't change it.

I'll ask @TokageItLab

@Chaosus Chaosus added this to the 4.x milestone Jan 30, 2025
@Chaosus Chaosus added bug and removed enhancement labels Jan 30, 2025
@Chaosus Chaosus modified the milestones: 4.x, 4.4 Jan 30, 2025
Copy link
Member

@TokageItLab TokageItLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might okay to handle this in cases where all selected objects are in the same direction, but it makes no sense in other cases.

For example, if object A's local +Z axis points to +Z in the world and object B's local +Z axis points to -Z in the world, a move to +Z with multiple selection in local mode will move each in the opposite direction.

So from a GUI perspective, it may be appropriate not to move Gizmo out of place when moving. At this time, I assume that the movement of translation can be calculated using averaging, but basis cannot be averaged. Therefor the only way at this stage for consistent behavior is to use the world visually.

The best way would be to visually duplicate TransformGizmo for the number of selected objects IMO, but this would require a fair amount of overhaul work.

Another way I can think of is to decide/select (in a way that the user can explicitly handle it) on one leader for multiple selections and use that basis, as in Blender, but this case does not solve the visual problem when each has a different local basis. This will also make it tempting to implement a new mode that ignores each local axis.

@TokageItLab TokageItLab modified the milestones: 4.4, 4.x Jan 30, 2025
@ryevdokimov ryevdokimov marked this pull request as draft January 30, 2025 11:09
@ryevdokimov ryevdokimov marked this pull request as draft January 30, 2025 11:09
@ryevdokimov
Copy link
Contributor Author

ryevdokimov commented Jan 30, 2025

Yes, I see now that although it does select a leader in the gizmo basis, the computation of the transform is still independent which leads to unintuitive behavior. I will see if I can solve the approach of having the computed transform match the leader.

@ryevdokimov ryevdokimov force-pushed the fix-local-space-gizmo-basis branch from 36f8360 to 3bae8f7 Compare January 31, 2025 07:38
@ryevdokimov ryevdokimov changed the title Fix transform gizmo local space mode basis when multiple nodes are selected Fix transform gizmo local space mode when multiple nodes are selected Jan 31, 2025
@ryevdokimov ryevdokimov force-pushed the fix-local-space-gizmo-basis branch from 3bae8f7 to 4e6eafe Compare January 31, 2025 07:43
@ryevdokimov ryevdokimov force-pushed the fix-local-space-gizmo-basis branch from 4e6eafe to b5ddc1c Compare January 31, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants