From 268d823025a1358f72428afa350371b133a45968 Mon Sep 17 00:00:00 2001 From: Bruno Fargnoli Date: Tue, 23 Jun 2026 20:31:58 +0200 Subject: [PATCH] MeshEditor : Added Wireframe toggle + removed duplicates workflows --- .../Edit Image with Qwen Image Edit.json | 222 ---------- comfyui_workflows/Flux2 Mesh Projection.json | 386 ------------------ .../Gen Image with Z Image Turbo.json | 127 ------ .../Qwen Image Edit Projected View.json | 301 -------------- src/components/meshEditor/EditorMesh.jsx | 48 ++- src/components/meshEditor/TexturedMesh.jsx | 24 +- src/pages/MeshEditorPage.jsx | 54 ++- 7 files changed, 103 insertions(+), 1059 deletions(-) delete mode 100644 comfyui_workflows/Edit Image with Qwen Image Edit.json delete mode 100644 comfyui_workflows/Flux2 Mesh Projection.json delete mode 100644 comfyui_workflows/Gen Image with Z Image Turbo.json delete mode 100644 comfyui_workflows/Qwen Image Edit Projected View.json diff --git a/comfyui_workflows/Edit Image with Qwen Image Edit.json b/comfyui_workflows/Edit Image with Qwen Image Edit.json deleted file mode 100644 index c7b2545..0000000 --- a/comfyui_workflows/Edit Image with Qwen Image Edit.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "139": { - "inputs": { - "shift": 3.1, - "model": [ - "152", - 0 - ] - }, - "class_type": "ModelSamplingAuraFlow", - "_meta": { - "title": "ModelSamplingAuraFlow" - } - }, - "140": { - "inputs": { - "strength": 1, - "model": [ - "139", - 0 - ] - }, - "class_type": "CFGNorm", - "_meta": { - "title": "CFGNorm" - } - }, - "141": { - "inputs": { - "prompt": "", - "clip": [ - "154", - 0 - ], - "vae": [ - "151", - 0 - ], - "image1": [ - "146", - 0 - ] - }, - "class_type": "TextEncodeQwenImageEditPlus", - "_meta": { - "title": "TextEncodeQwenImageEditPlus" - } - }, - "143": { - "inputs": { - "seed": 945859508372931, - "steps": 4, - "cfg": 1, - "sampler_name": "euler", - "scheduler": "simple", - "denoise": 1, - "model": [ - "140", - 0 - ], - "positive": [ - "149", - 0 - ], - "negative": [ - "150", - 0 - ], - "latent_image": [ - "153", - 0 - ] - }, - "class_type": "KSampler", - "_meta": { - "title": "KSampler" - } - }, - "145": { - "inputs": { - "unet_name": "qwen-image-edit-2511-Q4_K_M.gguf" - }, - "class_type": "UnetLoaderGGUF", - "_meta": { - "title": "Unet Loader (GGUF)" - } - }, - "146": { - "inputs": { - "image": "Image_1024_00126_.png" - }, - "class_type": "LoadImage", - "_meta": { - "title": "Load Image" - } - }, - "147": { - "inputs": { - "tile_size": 128, - "overlap": 64, - "temporal_size": 64, - "temporal_overlap": 8, - "samples": [ - "143", - 0 - ], - "vae": [ - "151", - 0 - ] - }, - "class_type": "VAEDecodeTiled", - "_meta": { - "title": "VAE Decode (Tiled)" - } - }, - "148": { - "inputs": { - "prompt": "Generate a highly detailed normal map of the image", - "clip": [ - "154", - 0 - ], - "vae": [ - "151", - 0 - ], - "image1": [ - "146", - 0 - ] - }, - "class_type": "TextEncodeQwenImageEditPlus", - "_meta": { - "title": "TextEncodeQwenImageEditPlus (Positive)" - } - }, - "149": { - "inputs": { - "reference_latents_method": "index_timestep_zero", - "conditioning": [ - "148", - 0 - ] - }, - "class_type": "FluxKontextMultiReferenceLatentMethod", - "_meta": { - "title": "Edit Model Reference Method" - } - }, - "150": { - "inputs": { - "reference_latents_method": "index_timestep_zero", - "conditioning": [ - "141", - 0 - ] - }, - "class_type": "FluxKontextMultiReferenceLatentMethod", - "_meta": { - "title": "Edit Model Reference Method" - } - }, - "151": { - "inputs": { - "vae_name": "qwen_image_vae.safetensors" - }, - "class_type": "VAELoader", - "_meta": { - "title": "Load VAE" - } - }, - "152": { - "inputs": { - "lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors", - "strength_model": 1, - "model": [ - "145", - 0 - ] - }, - "class_type": "LoraLoaderModelOnly", - "_meta": { - "title": "Load LoRA" - } - }, - "153": { - "inputs": { - "width": 1024, - "height": 1024, - "batch_size": 1 - }, - "class_type": "EmptyLatentImage", - "_meta": { - "title": "Empty Latent Image" - } - }, - "154": { - "inputs": { - "clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors", - "type": "qwen_image", - "device": "default" - }, - "class_type": "CLIPLoader", - "_meta": { - "title": "Load CLIP" - } - }, - "155": { - "inputs": { - "filename_prefix": "Images/Image", - "images": [ - "147", - 0 - ] - }, - "class_type": "SaveImage", - "_meta": { - "title": "Save Image" - } - } -} \ No newline at end of file diff --git a/comfyui_workflows/Flux2 Mesh Projection.json b/comfyui_workflows/Flux2 Mesh Projection.json deleted file mode 100644 index 55dba6d..0000000 --- a/comfyui_workflows/Flux2 Mesh Projection.json +++ /dev/null @@ -1,386 +0,0 @@ -{ - "6": { - "inputs": { - "text": "Generate the left side view", - "clip": [ - "38", - 0 - ] - }, - "class_type": "CLIPTextEncode", - "_meta": { - "title": "CLIP Text Encode (Positive Prompt)" - } - }, - "8": { - "inputs": { - "samples": [ - "13", - 0 - ], - "vae": [ - "10", - 0 - ] - }, - "class_type": "VAEDecode", - "_meta": { - "title": "VAE Decode" - } - }, - "9": { - "inputs": { - "filename_prefix": "Flux2", - "images": [ - "75", - 0 - ] - }, - "class_type": "SaveImage", - "_meta": { - "title": "Save Image" - } - }, - "10": { - "inputs": { - "vae_name": "flux2-vae.safetensors" - }, - "class_type": "VAELoader", - "_meta": { - "title": "Load VAE" - } - }, - "13": { - "inputs": { - "noise": [ - "25", - 0 - ], - "guider": [ - "22", - 0 - ], - "sampler": [ - "16", - 0 - ], - "sigmas": [ - "48", - 0 - ], - "latent_image": [ - "47", - 0 - ] - }, - "class_type": "SamplerCustomAdvanced", - "_meta": { - "title": "SamplerCustomAdvanced" - } - }, - "16": { - "inputs": { - "sampler_name": "euler" - }, - "class_type": "KSamplerSelect", - "_meta": { - "title": "KSamplerSelect" - } - }, - "22": { - "inputs": { - "model": [ - "67", - 0 - ], - "conditioning": [ - "72", - 0 - ] - }, - "class_type": "BasicGuider", - "_meta": { - "title": "BasicGuider" - } - }, - "25": { - "inputs": { - "noise_seed": 12345 - }, - "class_type": "RandomNoise", - "_meta": { - "title": "RandomNoise" - } - }, - "26": { - "inputs": { - "guidance": 4, - "conditioning": [ - "6", - 0 - ] - }, - "class_type": "FluxGuidance", - "_meta": { - "title": "FluxGuidance" - } - }, - "38": { - "inputs": { - "clip_name": "mistral_3_small_flux2_fp4_mixed.safetensors", - "type": "flux2", - "device": "default" - }, - "class_type": "CLIPLoader", - "_meta": { - "title": "Load CLIP" - } - }, - "39": { - "inputs": { - "conditioning": [ - "43", - 0 - ], - "latent": [ - "40", - 0 - ] - }, - "class_type": "ReferenceLatent", - "_meta": { - "title": "ReferenceLatent" - } - }, - "40": { - "inputs": { - "pixels": [ - "74", - 0 - ], - "vae": [ - "10", - 0 - ] - }, - "class_type": "VAEEncode", - "_meta": { - "title": "VAE Encode" - } - }, - "42": { - "inputs": { - "image": "Ortho_00002_.png" - }, - "class_type": "LoadImage", - "_meta": { - "title": "Position Image" - } - }, - "43": { - "inputs": { - "conditioning": [ - "26", - 0 - ], - "latent": [ - "44", - 0 - ] - }, - "class_type": "ReferenceLatent", - "_meta": { - "title": "ReferenceLatent" - } - }, - "44": { - "inputs": { - "pixels": [ - "46", - 0 - ], - "vae": [ - "10", - 0 - ] - }, - "class_type": "VAEEncode", - "_meta": { - "title": "VAE Encode" - } - }, - "46": { - "inputs": { - "image": "Image_1024_00182_.png" - }, - "class_type": "LoadImage", - "_meta": { - "title": "Reference Image" - } - }, - "47": { - "inputs": { - "width": [ - "76", - 0 - ], - "height": [ - "76", - 0 - ], - "batch_size": 1 - }, - "class_type": "EmptyFlux2LatentImage", - "_meta": { - "title": "Empty Flux 2 Latent" - } - }, - "48": { - "inputs": { - "steps": 4, - "width": [ - "76", - 0 - ], - "height": [ - "76", - 0 - ] - }, - "class_type": "Flux2Scheduler", - "_meta": { - "title": "Flux2Scheduler" - } - }, - "67": { - "inputs": { - "lora_name": "Flux_2-Turbo-LoRA_comfyui.safetensors", - "strength_model": 1, - "model": [ - "68", - 0 - ] - }, - "class_type": "LoraLoaderModelOnly", - "_meta": { - "title": "Load LoRA" - } - }, - "68": { - "inputs": { - "unet_name": "flux2-dev-Q2_K.gguf" - }, - "class_type": "UnetLoaderGGUF", - "_meta": { - "title": "Unet Loader (GGUF)" - } - }, - "70": { - "inputs": { - "rgthree_comparer": { - "images": [ - { - "name": "A", - "selected": true, - "url": "/api/view?filename=rgthree.compare._temp_npqyg_00003_.png&type=temp&subfolder=&rand=0.2221026949754732" - }, - { - "name": "B", - "selected": true, - "url": "/api/view?filename=rgthree.compare._temp_npqyg_00004_.png&type=temp&subfolder=&rand=0.8474962319220829" - } - ] - }, - "image_a": [ - "74", - 0 - ], - "image_b": [ - "8", - 0 - ] - }, - "class_type": "Image Comparer (rgthree)", - "_meta": { - "title": "Image Comparer (rgthree)" - } - }, - "71": { - "inputs": { - "controlnet_name": "FLUX.2-dev-Fun-Controlnet-Union.safetensors" - }, - "class_type": "Flux2FunControlNetLoader", - "_meta": { - "title": "Load Flux2 Fun ControlNet" - } - }, - "72": { - "inputs": { - "strength": 1, - "conditioning": [ - "43", - 0 - ], - "controlnet": [ - "71", - 0 - ], - "vae": [ - "10", - 0 - ], - "control_image": [ - "74", - 0 - ] - }, - "class_type": "Flux2FunControlNetApply", - "_meta": { - "title": "Apply Flux2 Fun ControlNet" - } - }, - "74": { - "inputs": { - "low_threshold": 0.05, - "high_threshold": 0.25, - "image": [ - "42", - 0 - ] - }, - "class_type": "Canny", - "_meta": { - "title": "Canny" - } - }, - "75": { - "inputs": { - "model": "RMBG-2.0", - "sensitivity": 1, - "process_res": 1024, - "mask_blur": 0, - "mask_offset": 0, - "invert_output": false, - "refine_foreground": false, - "background": "Alpha", - "background_color": "#222222", - "image": [ - "8", - 0 - ] - }, - "class_type": "RMBG", - "_meta": { - "title": "Remove Background (RMBG)" - } - }, - "76": { - "inputs": { - "value": 1024 - }, - "class_type": "PrimitiveInt", - "_meta": { - "title": "Image Resolution" - } - } -} \ No newline at end of file diff --git a/comfyui_workflows/Gen Image with Z Image Turbo.json b/comfyui_workflows/Gen Image with Z Image Turbo.json deleted file mode 100644 index c0a8095..0000000 --- a/comfyui_workflows/Gen Image with Z Image Turbo.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "43": { - "inputs": { - "filename_prefix": "z-image", - "images": [ - "34:8", - 0 - ] - }, - "class_type": "SaveImage", - "_meta": { - "title": "Save Image" - } - }, - "34:29": { - "inputs": { - "vae_name": "ae.safetensors" - }, - "class_type": "VAELoader", - "_meta": { - "title": "Load VAE" - } - }, - "34:33": { - "inputs": { - "conditioning": [ - "34:27", - 0 - ] - }, - "class_type": "ConditioningZeroOut", - "_meta": { - "title": "ConditioningZeroOut" - } - }, - "34:8": { - "inputs": { - "samples": [ - "34:3", - 0 - ], - "vae": [ - "34:29", - 0 - ] - }, - "class_type": "VAEDecode", - "_meta": { - "title": "VAE Decode" - } - }, - "34:27": { - "inputs": { - "text": "A highly detailed elf sorcerer in A-Pose, front view, gray background", - "clip": [ - "34:30", - 0 - ] - }, - "class_type": "CLIPTextEncode", - "_meta": { - "title": "CLIP Text Encode (Prompt)" - } - }, - "34:13": { - "inputs": { - "width": 1024, - "height": 1024, - "batch_size": 1 - }, - "class_type": "EmptySD3LatentImage", - "_meta": { - "title": "EmptySD3LatentImage" - } - }, - "34:30": { - "inputs": { - "clip_name": "qwen_3_4b.safetensors", - "type": "lumina2", - "device": "default" - }, - "class_type": "CLIPLoader", - "_meta": { - "title": "Load CLIP" - } - }, - "34:46": { - "inputs": { - "unet_name": "z_image_turbo_bf16.safetensors", - "weight_dtype": "default" - }, - "class_type": "UNETLoader", - "_meta": { - "title": "Load Diffusion Model" - } - }, - "34:3": { - "inputs": { - "seed": 91319876217533, - "steps": 10, - "cfg": 1, - "sampler_name": "euler", - "scheduler": "linear_quadratic", - "denoise": 1, - "model": [ - "34:46", - 0 - ], - "positive": [ - "34:27", - 0 - ], - "negative": [ - "34:33", - 0 - ], - "latent_image": [ - "34:13", - 0 - ] - }, - "class_type": "KSampler", - "_meta": { - "title": "KSampler" - } - } -} \ No newline at end of file diff --git a/comfyui_workflows/Qwen Image Edit Projected View.json b/comfyui_workflows/Qwen Image Edit Projected View.json deleted file mode 100644 index f0e2365..0000000 --- a/comfyui_workflows/Qwen Image Edit Projected View.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "1": { - "inputs": { - "shift": 3.1, - "model": [ - "15", - 0 - ] - }, - "class_type": "ModelSamplingAuraFlow", - "_meta": { - "title": "ModelSamplingAuraFlow" - } - }, - "2": { - "inputs": { - "tile_size": 128, - "overlap": 64, - "temporal_size": 64, - "temporal_overlap": 8, - "samples": [ - "20", - 0 - ], - "vae": [ - "17", - 0 - ] - }, - "class_type": "VAEDecodeTiled", - "_meta": { - "title": "VAE Decode (Tiled)" - } - }, - "3": { - "inputs": { - "conditioning": [ - "9", - 0 - ], - "latent": [ - "12", - 0 - ] - }, - "class_type": "ReferenceLatent", - "_meta": { - "title": "ReferenceLatent" - } - }, - "4": { - "inputs": { - "pixels": [ - "22", - 0 - ], - "vae": [ - "17", - 0 - ] - }, - "class_type": "VAEEncode", - "_meta": { - "title": "VAE Encode" - } - }, - "5": { - "inputs": { - "strength": 1, - "model": [ - "1", - 0 - ] - }, - "class_type": "CFGNorm", - "_meta": { - "title": "CFGNorm" - } - }, - "6": { - "inputs": { - "width": 1024, - "height": 1024, - "batch_size": 1 - }, - "class_type": "EmptyLatentImage", - "_meta": { - "title": "Empty Latent Image" - } - }, - "7": { - "inputs": { - "conditioning": [ - "8", - 0 - ], - "latent": [ - "12", - 0 - ] - }, - "class_type": "ReferenceLatent", - "_meta": { - "title": "ReferenceLatent" - } - }, - "8": { - "inputs": { - "prompt": "Generate the front view", - "clip": [ - "16", - 0 - ], - "vae": [ - "17", - 0 - ], - "image1": [ - "23", - 0 - ] - }, - "class_type": "TextEncodeQwenImageEditPlus", - "_meta": { - "title": "TextEncodeQwenImageEditPlus (Positive)" - } - }, - "9": { - "inputs": { - "prompt": "", - "clip": [ - "16", - 0 - ], - "vae": [ - "17", - 0 - ], - "image1": [ - "23", - 0 - ] - }, - "class_type": "TextEncodeQwenImageEditPlus", - "_meta": { - "title": "TextEncodeQwenImageEditPlus" - } - }, - "10": { - "inputs": { - "conditioning": [ - "7", - 0 - ], - "latent": [ - "4", - 0 - ] - }, - "class_type": "ReferenceLatent", - "_meta": { - "title": "ReferenceLatent" - } - }, - "11": { - "inputs": { - "conditioning": [ - "3", - 0 - ], - "latent": [ - "4", - 0 - ] - }, - "class_type": "ReferenceLatent", - "_meta": { - "title": "ReferenceLatent" - } - }, - "12": { - "inputs": { - "pixels": [ - "23", - 0 - ], - "vae": [ - "17", - 0 - ] - }, - "class_type": "VAEEncode", - "_meta": { - "title": "VAE Encode" - } - }, - "15": { - "inputs": { - "lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors", - "strength_model": 1, - "model": [ - "19", - 0 - ] - }, - "class_type": "LoraLoaderModelOnly", - "_meta": { - "title": "Load LoRA" - } - }, - "16": { - "inputs": { - "clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors", - "type": "qwen_image", - "device": "default" - }, - "class_type": "CLIPLoader", - "_meta": { - "title": "Load CLIP" - } - }, - "17": { - "inputs": { - "vae_name": "qwen_image_vae.safetensors" - }, - "class_type": "VAELoader", - "_meta": { - "title": "Load VAE" - } - }, - "19": { - "inputs": { - "unet_name": "qwen-image-edit-2511-Q6_K.gguf" - }, - "class_type": "UnetLoaderGGUF", - "_meta": { - "title": "Unet Loader (GGUF)" - } - }, - "20": { - "inputs": { - "seed": 1000, - "steps": 4, - "cfg": 1, - "sampler_name": "euler", - "scheduler": "simple", - "denoise": 1, - "model": [ - "5", - 0 - ], - "positive": [ - "10", - 0 - ], - "negative": [ - "11", - 0 - ], - "latent_image": [ - "6", - 0 - ] - }, - "class_type": "KSampler", - "_meta": { - "title": "KSampler" - } - }, - "21": { - "inputs": { - "filename_prefix": "Qwen", - "images": [ - "2", - 0 - ] - }, - "class_type": "SaveImage", - "_meta": { - "title": "Save Image" - } - }, - "22": { - "inputs": { - "image": "DwarfSorcerer FireBeard-mask-v0.png" - }, - "class_type": "LoadImage", - "_meta": { - "title": "Canny Image" - } - }, - "23": { - "inputs": { - "image": "DwarfSorcerer FireBeard-mask-v0.png" - }, - "class_type": "LoadImage", - "_meta": { - "title": "Source Image" - } - } -} \ No newline at end of file diff --git a/src/components/meshEditor/EditorMesh.jsx b/src/components/meshEditor/EditorMesh.jsx index c7f42fd..4b9b5ab 100644 --- a/src/components/meshEditor/EditorMesh.jsx +++ b/src/components/meshEditor/EditorMesh.jsx @@ -3,7 +3,14 @@ import * as THREE from 'three' import { getFaceSelectionGeometry, getVertexSelectionPositions } from '../../utils/meshEditor' // R3F scene helper extracted from MeshEditorPage.jsx (behaviour-preserving move). -export default function EditorMesh({ geometry, selectedFaceIndices, selectedVertexIndices, showShadows = false, showAlbedo = false }) { +export default function EditorMesh({ + geometry, + selectedFaceIndices, + selectedVertexIndices, + showShadows = false, + displayMode = 'pbr', + showWireframe = false, + }) { const faceSelectionGeometry = useMemo(() => getFaceSelectionGeometry(geometry, selectedFaceIndices), [geometry, selectedFaceIndices]) const selectedVertexPositions = useMemo(() => getVertexSelectionPositions(geometry, selectedVertexIndices), [geometry, selectedVertexIndices]) const selectedVertexVectors = useMemo(() => { @@ -24,14 +31,39 @@ export default function EditorMesh({ geometry, selectedFaceIndices, selectedVert return ( - - {showAlbedo - ? - : } - - - + + {displayMode === 'albedo' ? ( + + ) : displayMode === 'sculpt' ? ( + + ) : ( + + )} + {showWireframe && ( + + + + )} {selectedFaceIndices.length > 0 && faceSelectionGeometry?.attributes?.position?.count > 0 && ( diff --git a/src/components/meshEditor/TexturedMesh.jsx b/src/components/meshEditor/TexturedMesh.jsx index 79d1a42..9696fe6 100644 --- a/src/components/meshEditor/TexturedMesh.jsx +++ b/src/components/meshEditor/TexturedMesh.jsx @@ -3,7 +3,14 @@ import * as THREE from 'three' import { getTextureKeyFromMaterial } from '../../utils/meshTexturing' // R3F scene helper extracted from MeshEditorPage.jsx (behaviour-preserving move). -export default function TexturedMesh({ root, textureKey, displayTexture, showShadows = false, showAlbedo = false }) { +export default function TexturedMesh({ + root, + textureKey, + displayTexture, + showShadows = false, + displayMode = 'pbr', + showWireframe = false, + }) { const baseObject = useMemo(() => { if (!root || !displayTexture) { return null @@ -15,7 +22,7 @@ export default function TexturedMesh({ root, textureKey, displayTexture, showSha const buildMaterial = sourceMaterial => { const isTargetTexture = sourceMaterial && getTextureKeyFromMaterial(sourceMaterial) === textureKey - if (showAlbedo) { + if (displayMode === 'albedo') { const params = {} if (sourceMaterial?.color?.isColor) { params.color = sourceMaterial.color.clone() @@ -38,6 +45,17 @@ export default function TexturedMesh({ root, textureKey, displayTexture, showSha return new THREE.MeshBasicMaterial(params) } + if (displayMode === 'sculpt') { + const params = { + color: new THREE.Color('#6f6f6f'), + roughness: 0.78, + metalness: 0, + wireframe: showWireframe, + } + + return new THREE.MeshStandardMaterial(params) + } + const nextMaterial = sourceMaterial?.clone?.() || sourceMaterial if (nextMaterial && isTargetTexture) { nextMaterial.map = displayTexture @@ -74,7 +92,7 @@ export default function TexturedMesh({ root, textureKey, displayTexture, showSha object.userData.meshEditorMaterials = materials return object - }, [displayTexture, root, showAlbedo, showShadows, textureKey]) + }, [displayMode, displayTexture, root, showShadows, showWireframe, textureKey]) useEffect(() => () => { baseObject?.userData?.meshEditorMaterials?.forEach(material => material?.dispose?.()) diff --git a/src/pages/MeshEditorPage.jsx b/src/pages/MeshEditorPage.jsx index ed82415..f305ae4 100644 --- a/src/pages/MeshEditorPage.jsx +++ b/src/pages/MeshEditorPage.jsx @@ -309,7 +309,8 @@ export default function MeshEditorPage() { const [showSettings, setShowSettings] = useState(false) const [showShadows, setShowShadows] = useState(false) - const [showAlbedo, setShowAlbedo] = useState(false) + const [displayMode, setDisplayMode] = useState('pbr') + const [showWireframe, setShowWireframe] = useState(false) const [activeMenu, setActiveMenu] = useState('modeling') const [geometry, setGeometry] = useState(null) const [texturableMesh, setTexturableMesh] = useState(null) @@ -489,6 +490,14 @@ export default function MeshEditorPage() { const paintDocDirtyForAssetIdRef = useRef(null); const [paintCursorPos, setPaintCursorPos] = useState(null); // { x, y } in canvasShell coords + const cycleDisplayMode = () => { + setDisplayMode(current => { + if (current === 'pbr') return 'albedo' + if (current === 'albedo') return 'sculpt' + return 'pbr' + }) + } + // --- Sculpting mode state --- // Brush kind: 'standard' is the only kernel wired up in this step. Smooth // and Inflate kernels exist in meshSculpt.js for the auto-smooth slider @@ -5535,13 +5544,28 @@ export default function MeshEditorPage() { + {displayMode === 'sculpt' && ( + + )}
@@ -5792,10 +5816,10 @@ export default function MeshEditorPage() { }} > - + - + {(activeMenu === 'texturing' || activeMenu === 'painting' || activeMenu === 'projection') && texturableMesh?.root && displayTextureRef.current && (activeMenu !== 'texturing' || maskTextureRef.current) ? ( ) : activeMenu === 'boolean' && booleanHasPreview && booleanMaskTexture ? ( )} {activeMenu === 'boolean' && booleanHasPreview && (!booleanMaskTexture || booleanPlaceMode) && (