Skip to content

AI/Gen3D: Slice D — CLI + MCP + GUI surface via AIAssistManager #768

Description

@fernandotonon

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

  • CLI, MCP, and GUI all reach MeshGenPredictor and produce the same mesh for the same image.
  • All three degrade gracefully without ONNX/model (clear messages, no crash).
  • Breadcrumbs emitted on each surface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-assistLocal-AI-assisted 3D workflows (epic prefix: AI:)cliCommand-line / qtmeshenhancementNew feature or requestqtmesh-roadmap

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions