Add Shift brush controls to paint mode

Hold Shift to momentarily enable the pipette (restores prior state on
release) and Shift+Scroll to resize the brush. The orbit zoom ignores the
wheel while Shift is held so it does not zoom and resize at once. The HUD
brush-size slider follows live via a BrushSizeChanged event, and the brush
preview now stays visible while Shift is held (drawn before the pipette
early-return) so the new size is visible while scrubbing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-28 16:20:25 +02:00
1 parent 4e27b1e729
commit b6aaf69235
3 files changed
+120 -9

No files matched your search

+16 -1
View File
@@ -133,7 +133,9 @@ public class ThirdPersonOrbitInput : MonoBehaviour
_zoomInit = true;
}
float scroll = ReadScroll();
// Shift+wheel is reserved for the paint brush resize (MeshPainter), so the orbit camera
// ignores the wheel while Shift is held - otherwise it would zoom and resize at once.
float scroll = ShiftHeld() ? 0f : ReadScroll();
if (!Mathf.Approximately(scroll, 0f))
{
// One wheel notch = one zoom step (sign only), independent of the
@@ -199,6 +201,19 @@ public class ThirdPersonOrbitInput : MonoBehaviour
#endif
}
static bool ShiftHeld()
{
#if ENABLE_INPUT_SYSTEM
var kb = Keyboard.current;
if (kb != null) return kb.leftShiftKey.isPressed || kb.rightShiftKey.isPressed;
#endif
#if ENABLE_LEGACY_INPUT_MANAGER
return Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
#else
return false;
#endif
}
Vector2 ReadMouseDelta()
{
#if ENABLE_INPUT_SYSTEM