Skip to content

fix(blender): align docs and render execute with real behavior#240

Open
yuh-yang wants to merge 1 commit intomainfrom
fix/issue-236-blender-render-execute-single-commit
Open

fix(blender): align docs and render execute with real behavior#240
yuh-yang wants to merge 1 commit intomainfrom
fix/issue-236-blender-render-execute-single-commit

Conversation

@yuh-yang
Copy link
Copy Markdown
Collaborator

Description

Fixes #236

This PR fixes the Blender side of the failures reported in issue #236 and updates the related documentation so the documented examples match the real CLI behavior.

Issue #236 exposed two concrete problems:

  1. The root README examples used object add-mesh --type cube --location 0 0 1, but the actual Blender CLI only supported object add cube --location 0,0,1.
  2. The docs implied that render execute would perform a real Blender render, while the CLI only generated _render_script.py and printed a manual command to run.

This PR aligns the implementation with the documented user expectation:

  • render execute now actually invokes Blender headless through the existing backend
  • _render_script.py is still generated as an artifact for debugging/reuse
  • render script remains the script-only path for environments without Blender
  • a backward-compatible object add-mesh alias is added so the stale documented command no longer hard-fails
  • README.md, README_CN.md, and the Blender harness README are updated to reflect the canonical syntax and actual runtime behavior

Issue #236 also mentioned LibreOffice export, but that flow was already working correctly in this environment. For that path, this PR only clarifies in the docs that real PDF export requires a local
LibreOffice/soffice installation.

Type of Change

  • New Software CLI (in-repo) — adds a CLI harness inside this monorepo
  • New Software CLI (standalone repo) — registry-only PR pointing to an external repo
  • New Feature — adds new functionality to an existing harness or the plugin
  • Bug Fix — fixes incorrect behavior
  • Documentation — updates docs only
  • Other — please describe:

For New Software CLIs (in-repo)

  • <SOFTWARE>.md SOP document exists at <software>/agent-harness/<SOFTWARE>.md
  • Canonical SKILL.md exists at skills/cli-anything-<software>/SKILL.md
  • Packaged compatibility SKILL.md exists at cli_anything/<software>/skills/SKILL.md
  • Unit tests at cli_anything/<software>/tests/test_core.py are present and pass without backend
  • E2E tests at cli_anything/<software>/tests/test_full_e2e.py are present
  • README.md includes the new software (with link to harness directory)
  • registry.json includes an entry with source_url: null
  • repl_skin.py in utils/ is an unmodified copy from the plugin

For New Software CLIs (standalone repo)

  • CLI is installable via pip install <package-name> or a pip install git+https://... URL
  • SKILL.md exists in the external repo
  • External repo has its own test suite
  • registry.json entry includes source_url pointing to the external repo
  • registry.json entry includes skill_md with full URL to the external SKILL.md
  • install_cmd in registry.json works (tested locally)

For Existing CLI Modifications

  • All unit tests pass: python3 -m pytest cli_anything/blender/tests/test_core.py -v
  • All E2E tests pass: python3 -m pytest cli_anything/blender/tests/test_full_e2e.py -v
  • No test regressions — no previously passing tests were removed or weakened
  • registry.json entry is updated if version, description, or requirements changed

General Checklist

  • Code follows existing patterns and conventions
  • --json flag is supported on any new commands
  • Commit messages follow the conventional format (feat:, fix:, docs:, test:)
  • I have tested my changes locally

Test Results

python3 -m pytest \
  cli_anything/blender/tests/test_full_e2e.py::TestCLISubprocess::test_legacy_add_mesh_command \
  cli_anything/blender/tests/test_full_e2e.py::TestCLISubprocess::test_full_workflow_json \
  cli_anything/blender/tests/test_full_e2e.py::TestBlenderRenderE2E::test_cli_render_execute \
  cli_anything/blender/tests/test_core.py::TestRender::test_render_scene_generates_script \
  -v

# Result: 4 passed

python3 -m pytest \
  cli_anything/blender/tests/test_full_e2e.py::TestBlenderRenderScriptE2E::test_run_minimal_bpy_script \
  cli_anything/blender/tests/test_full_e2e.py::TestBlenderRenderE2E::test_render_simple_cube \
  -v

# Result: 2 passed

python3 -m pytest cli_anything/blender/tests/test_core.py cli_anything/blender/tests/test_full_e2e.py -v

# Result: 210 passed

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Blender harness inconsistencies highlighted in #236 by aligning the CLI behavior and documentation: render execute now performs a real headless Blender render (while still emitting _render_script.py), and the previously documented-but-broken object add-mesh syntax is restored as a backward-compatible alias.

Changes:

  • Add object add-mesh as a compatibility alias while keeping object add <primitive> as the canonical syntax.
  • Make render execute actually run Blender headless via the backend and return output metadata (while still generating _render_script.py).
  • Update top-level and Blender harness documentation examples to match real CLI behavior; clarify LibreOffice export requirements.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
blender/agent-harness/cli_anything/blender/utils/blender_backend.py Adds output discovery helpers and enriches headless render results with output metadata.
blender/agent-harness/cli_anything/blender/core/render.py Adds optional execution path to render after script generation via the backend.
blender/agent-harness/cli_anything/blender/blender_cli.py Implements object add-mesh alias and upgrades render execute to run Blender headless (plus per-invocation overrides).
blender/agent-harness/cli_anything/blender/tests/test_full_e2e.py Updates E2E assertions and adds coverage for legacy add-mesh and CLI-driven render execute.
blender/agent-harness/cli_anything/blender/README.md Updates harness docs to reflect canonical syntax and real rendering behavior.
README.md Updates top-level examples and clarifies LibreOffice PDF export prerequisite.
README_CN.md Updates Chinese docs similarly (Blender syntax + LibreOffice prerequisite clarification).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@whaleprince
Copy link
Copy Markdown

why you modify code in blender content manually, instead of using the skill of cli-anything?

@yuh-yang
Copy link
Copy Markdown
Collaborator Author

why you modify code in blender content manually, instead of using the skill of cli-anything?

Hey thanks for questioning. This PR is a targeted fix on an existing harness, rather than generating a new CLI from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 运行案例中的libreoffice和blender的cli时报错

3 participants