Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 69 additions & 1 deletion src/meshops/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@
"blockout-leg-foot-compare photo vs RECIPE vs optional scene "
"(0127; LEG_FOOT_COMPARE_HONESTY — N6); "
"blockout-girdle-compare photo vs RECIPE vs optional scene "
"(0128; GIRDLE_COMPARE_HONESTY — N6). "
"(0128; GIRDLE_COMPARE_HONESTY — N6); "
"blockout-arm-hand-compare photo vs RECIPE vs optional scene "
"(0129; ARM_HAND_COMPARE_HONESTY — N6). "
"Optional: meshops[proportion] (Pillow)."
),
add_completion=False,
Expand Down Expand Up @@ -3620,5 +3622,71 @@ def proportion_blockout_girdle_compare_cmd(
raise typer.Exit(0)


@proportion_app.command("blockout-arm-hand-compare")
def proportion_blockout_arm_hand_compare_cmd(
report: Path = typer.Option(
...,
"--report",
help="Path to proportion_report.json (required)",
),
recipe: Path = typer.Option(
...,
"--recipe",
help="Path to blockout_recipe.json (required)",
),
out: Path = typer.Option(
...,
"--out",
help="Output directory for arm_hand_compare.json (required)",
),
scene_dump: Path | None = typer.Option(
None,
"--scene-dump",
help="Optional live Blender/scene dump JSON overlay",
),
force: bool = typer.Option(
False,
"--force",
help="Overwrite existing arm_hand_compare.json",
),
json_out: bool = typer.Option(False, "--json", help="Emit machine result JSON"),
) -> None:
"""Compare Package A arm/hand landmarks vs RECIPE vs optional live scene.

Authoring QA only — not mesh or print success (ARM_HAND_COMPARE_HONESTY).
"""
from meshops.proportion.arm_hand_compare import run_blockout_arm_hand_compare
from meshops.proportion.errors import ProportionError
from meshops.proportion.honesty import ARM_HAND_COMPARE_HONESTY

try:
payload = run_blockout_arm_hand_compare(
report,
recipe,
out,
scene_dump=scene_dump,
force=force,
)
except ProportionError as exc:
_emit_error(exc, json_mode=json_out, code=1)
except Exception as exc:
_emit_error(exc, json_mode=json_out)

if json_out:
_emit_json(payload)
else:
typer.echo(
f"blockout-arm-hand-compare ok={payload.get('ok')} region={payload.get('region')}"
)
for msg in payload.get("messages") or []:
typer.echo(f" note: {msg}")
pkg_path = payload.get("package_path")
if pkg_path:
typer.echo(f" {pkg_path}")
typer.echo(f"honesty: {ARM_HAND_COMPARE_HONESTY}")
typer.echo("blockout-arm-hand-compare authoring QA only — not mesh or print success")
raise typer.Exit(0)


if __name__ == "__main__":
app()
23 changes: 23 additions & 0 deletions src/meshops/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"mesh_proportion_blockout_hip_glute_compare",
"mesh_proportion_blockout_leg_foot_compare",
"mesh_proportion_blockout_girdle_compare",
"mesh_proportion_blockout_arm_hand_compare",
}
)

Expand Down Expand Up @@ -1067,4 +1068,26 @@ def mesh_proportion_blockout_girdle_compare(
force=force,
)

@mcp.tool()
def mesh_proportion_blockout_arm_hand_compare(
report: str,
recipe: str,
out: str,
scene_dump: str | None = None,
force: bool = False,
) -> dict[str, Any]:
"""Compare Package A arm/hand landmarks vs RECIPE vs optional live scene dump.

Authoring QA only — proportion_arm_hand_compare_not_mesh_or_print_success.
Not mesh or print success. Raises ProportionError on hard failures.
"""
return T.mesh_proportion_blockout_arm_hand_compare(
wr,
report=report,
recipe=recipe,
out=out,
scene_dump=scene_dump,
force=force,
)

return mcp
27 changes: 27 additions & 0 deletions src/meshops/mcp/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,3 +1484,30 @@ def mesh_proportion_blockout_girdle_compare(
scene_dump=_resolve_tool_path(scene_dump, work_root) if scene_dump else None,
force=force,
)


def mesh_proportion_blockout_arm_hand_compare(
work_root: Path,
*,
report: str,
recipe: str,
out: str,
scene_dump: str | None = None,
force: bool = False,
) -> dict[str, Any]:
"""Photo vs RECIPE vs optional scene. Authoring only — ARM_HAND_COMPARE_HONESTY."""
from meshops.proportion.arm_hand_compare import run_blockout_arm_hand_compare

ends_sep = out.endswith(("/", "\\"))
out_base = out.rstrip("/\\") if ends_sep else out
out_resolved = _resolve_tool_path(out_base, work_root)
out_arg: str | Path = (
str(out_resolved) + ("\\" if ends_sep else "") if ends_sep else out_resolved
)
return run_blockout_arm_hand_compare(
_resolve_tool_path(report, work_root),
_resolve_tool_path(recipe, work_root),
out_arg,
scene_dump=_resolve_tool_path(scene_dump, work_root) if scene_dump else None,
force=force,
)
Loading