Hi folks, I’ve recently improved our BoundingBoxGizmo based scaling feature to support center based mirrored scaling when ctrl/opt is pressed and the default one-sided scaling when it’s not.
One limitation though is that it only applies the scalePivot going forward and not retroactively. In many apps, the scale would automatically be recomputed and applied when ctrl/opt is (un)pressed to reflect the scaling change as if the key was (un)pressed all along. You can see a video below, the issue is shown at the end when we toggle ctrl/opt while dragging.
I’ve tried to track the initial position and scale, compute the delta when the key and pressed, and apply changes to the mesh manually, but it breaks and seems to conflict with some internal mesh tracking (maybe _anchorMesh?)
So i’m wondering if this is something that can be implemented in userland, or if this should be considered a feature request. Tagging @Cedric as I understand you’re the master of gizmos.
I think it makes the most sense to add the feature in onScaleBoxDragObservable . That’s where the _anchorMesh position is changed. So keeping its position and changing the scale would result in expected manipulation.It needs proper testing as missing 1 node in the hiearchy would break transforms or add jittering. Anyway, I’d start looking in that code block and would not try to do it in user land.