Add pipette (eyedropper) brush mode and wire it into the HUD
Pipette samples all painted channel values (albedo, metallic, smoothness, occlusion, emission) at the clicked texel and adopts them into the brush with every opacity forced to 1, instead of painting. The screen raycast is extracted into a shared TryRaycastPaintMesh helper used by painting, preview and the pipette. A pipette toggle is added to the HUD panel prefab and wired in PaintHud. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
cdeebf9243
commit
24a36c0e61
5 files changed
+509
-12
No files matched your search
@@ -48,6 +48,7 @@ public class PaintHud : MonoBehaviour
|
||||
private const string ToggleOcclusion = "Toggle_Occlusion";
|
||||
private const string ToggleEmission = "Toggle_Emission";
|
||||
private const string ToggleSpray = "Toggle_Spray";
|
||||
private const string TogglePipette = "Toggle_Pipette";
|
||||
private const string PickerAlbedo = "Picker_Albedo";
|
||||
private const string PickerEmission = "Picker_Emission";
|
||||
private const string SliderMetallic = "Slider_Metallic";
|
||||
@@ -169,6 +170,7 @@ public class PaintHud : MonoBehaviour
|
||||
WireToggle(panel, ToggleOcclusion, painter && painter.paintOcclusion, v => { if (painter) painter.paintOcclusion = v; });
|
||||
WireToggle(panel, ToggleEmission, painter && painter.paintEmission, v => { if (painter) painter.paintEmission = v; });
|
||||
WireToggle(panel, ToggleSpray, painter && painter.spray, v => { if (painter) painter.spray = v; });
|
||||
WireToggle(panel, TogglePipette, painter && painter.pipette, v => { if (painter) painter.pipette = v; });
|
||||
|
||||
// Dim a channel panel to 0.5 alpha while its toggle is off, full alpha while on.
|
||||
WirePanelFade(panel, PanelAlbedo, ToggleAlbedo);
|
||||
|
||||
Reference in new issue
Block a user