Part of #764. Depends on Slices B+C. Wires the feature into the three user surfaces, following the PBR-synth (#404) pattern exactly.
CLI (CLIPipeline.cpp)
- New subcommand
generate3d (add to the recognized-subcommand list + the run() dispatcher near ~1489): qtmesh generate3d image.png [-o out.glb] [--resolution 256] [--no-color].
- Implement
cmdGenerate3d() mirroring cmdMaterialGeneratePbr (~4423–4566): #ifndef ENABLE_ONNX early error; load QImage; MeshGenPredictor::predict; build+export via Slice C; default output = <image>.glb.
- Sentry breadcrumb (
"ai.tool_call" / "ui.action"), per project rule.
MCP (MCPServer.cpp)
- Tool
generate_mesh_from_image in the dispatch map (~584) + toolGenerateMeshFromImage (mirror toolGeneratePbrMaps ~1880–1970) + #ifdef ENABLE_ONNX schema block (~6661–6693). Params: image_path (required), output, resolution, vertex_color. Result: meshPath, vertexCount, triangleCount. Breadcrumb "ai.tool_call".
GUI (AIAssistManager + QML)
- Add
Q_INVOKABLE MeshGenResult generateMeshFromImage(const QString& imagePath, int resolution=256) + meshGenStarted/Completed/Error signals to AIAssistManager (facade pattern; ensureModelBlocking for download with progress).
- Entry point: a "Generate 3D from Image…" action (button/menu) that opens a
FileDialog, calls the invokable, and loads the resulting mesh into the scene on success; show progress + errors. Keep it consistent with the existing AI panels.
Acceptance
Part of #764. Depends on Slices B+C. Wires the feature into the three user surfaces, following the PBR-synth (#404) pattern exactly.
CLI (
CLIPipeline.cpp)generate3d(add to the recognized-subcommand list + therun()dispatcher near ~1489):qtmesh generate3d image.png [-o out.glb] [--resolution 256] [--no-color].cmdGenerate3d()mirroringcmdMaterialGeneratePbr(~4423–4566):#ifndef ENABLE_ONNXearly error; loadQImage;MeshGenPredictor::predict; build+export via Slice C; default output =<image>.glb."ai.tool_call"/"ui.action"), per project rule.MCP (
MCPServer.cpp)generate_mesh_from_imagein the dispatch map (~584) +toolGenerateMeshFromImage(mirrortoolGeneratePbrMaps~1880–1970) +#ifdef ENABLE_ONNXschema block (~6661–6693). Params:image_path(required),output,resolution,vertex_color. Result:meshPath,vertexCount,triangleCount. Breadcrumb"ai.tool_call".GUI (
AIAssistManager+ QML)Q_INVOKABLE MeshGenResult generateMeshFromImage(const QString& imagePath, int resolution=256)+meshGenStarted/Completed/Errorsignals toAIAssistManager(facade pattern;ensureModelBlockingfor download with progress).FileDialog, calls the invokable, and loads the resulting mesh into the scene on success; show progress + errors. Keep it consistent with the existing AI panels.Acceptance
MeshGenPredictorand produce the same mesh for the same image.