Skip to content

Add direct text object tool#83

Merged
Ker102 merged 2 commits into
mainfrom
feature/text-object-tool
May 31, 2026
Merged

Add direct text object tool#83
Ker102 merged 2 commits into
mainfrom
feature/text-object-tool

Conversation

@Ker102
Copy link
Copy Markdown
Owner

@Ker102 Ker102 commented May 31, 2026

Summary

  • Add add_text_object to the ViperMesh Blender addon and public download addon for bounded text/signage/title creation.
  • Wire the tool through LangGraph agent schemas, orchestration registry/filtering, test pipeline allowlist, system prompt, scene composition guide, and capability inventory.
  • Add direct coverage for text object command exposure, tool filtering, prompt formatting, and agent execution wiring.

Validation

  • python -m py_compile desktop/assets/vipermesh-addon.py public/downloads/vipermesh-addon.py
  • npx tsx scripts/test/test-blender-text-object-tool.ts
  • npx tsx scripts/test/test-direct-tool-surface-coverage.ts
  • npx tsx scripts/test/test-tool-guide-trigger-coverage.ts
  • npx tsc --noEmit --incremental false
  • npm run lint (existing baseline-browser-mapping freshness warning only)

Summary by CodeRabbit

  • New Features
    • Added support for creating 3D text objects in Blender scenes. Users can now generate customizable text labels, signs, titles, and annotations with control over size, alignment, materials, and positioning. Text objects can optionally be converted to mesh geometry for advanced modeling workflows.

@github-actions github-actions Bot added documentation Improvements or additions to documentation backend desktop scripts labels May 31, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Review Change Stack

Warning

Review limit reached

@Ker102, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 55 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 97b18498-71a1-4e54-bcca-19bb07834158

📥 Commits

Reviewing files that changed from the base of the PR and between a59f1ea and acbdb83.

📒 Files selected for processing (4)
  • desktop/assets/vipermesh-addon.py
  • lib/ai/agents.ts
  • lib/orchestration/tool-registry.ts
  • public/downloads/vipermesh-addon.py
📝 Walkthrough

Walkthrough

This PR adds add_text_object, a new MCP tool for creating bounded 3D text objects in Blender. The implementation spans the addon (Blender Python), agent wiring (LangChain), orchestration layers, test infrastructure, and user-facing documentation.

Changes

Text Object Tool Integration

Layer / File(s) Summary
Blender addon: add_text_object implementation
desktop/assets/vipermesh-addon.py, public/downloads/vipermesh-addon.py
BlenderMCPServer.add_text_object(...) creates bounded FONT objects with validated text, transforms, alignment, sizing, extrusion/bevel, optional font/material, collection linking, and mesh conversion; command is registered in the server's dispatch handler.
Agent and orchestration integration
lib/ai/agents.ts, lib/orchestration/tool-registry.ts, lib/orchestration/tool-filter.ts, lib/orchestration/prompts/blender-agent-system.md
addTextObject tool added to LangChain with Zod schema; registered in TOOL_REGISTRY and ALL_TOOLS; categorized as a geometry tool with text/label/signage/font keyword matching; system prompt documents parameters and routes text label/sign/title requests to this tool.
Test pipeline integration
app/api/test-pipeline/route.ts
"add_text_object" added to MCP tool allowlist to enable planning and validation steps.
Documentation and capability inventory
data/tool-guides/scene-composition-guide.md, docs/blender-mcp-capability-inventory.md
Scene composition guide adds metadata tags and new "TEXT, SIGNAGE, AND LABELS" section with workflow, material/mesh-conversion guidance; capability inventory updated to 79 commands (from 53) and expanded command snapshots.
Test coverage
scripts/test/test-blender-text-object-tool.ts, scripts/test/test-tool-guide-trigger-coverage.ts
New test validates add_text_object presence, capabilities, and agent integration; existing trigger-coverage test expanded to require the tool be bound to at least one guide.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Ker102/ViperMesh#44: Both extend the MCP geometry tool pipeline by adding different commands (add_text_object vs create_mesh_from_data/validate_mesh_geometry).
  • Ker102/ViperMesh#49: Both extend tool registration in the orchestration layer (tool-filter, tool-registry, system-prompt) by adding different commands (add_text_object vs inspect_collection_hierarchy).

Suggested labels

documentation, backend, desktop, scripts

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description does not follow the required template structure; it lacks the standard sections such as Type of Change, Related Issues, Motivation and Context, Testing, and Checklist. Restructure the description to match the template with proper sections: Description, Type of Change (mark relevant), Related Issues, Motivation and Context, How Has This Been Tested, Screenshots if applicable, and Checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add direct text object tool' clearly and concisely summarizes the main change: introducing a new add_text_object tool to the ViperMesh system.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/text-object-tool

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@desktop/assets/vipermesh-addon.py`:
- Around line 1423-1429: The font_path handling should resolve Blender-relative
paths and avoid duplicate font datablocks: call bpy.path.abspath(font_path) to
get a real filesystem path before using os.path.exists (replace the existing
os.path.exists(font_path) check), then pass that resolved path into
bpy.data.fonts.load(..., check_existing=True) so existing fonts are reused;
update uses of loaded_font to reference the returned font from the resolved-path
load.

In `@lib/orchestration/tool-registry.ts`:
- Around line 186-193: The parameter description for the tool object with name
"add_text_object" currently lists align_y as TOP|CENTER|BOTTOM but is missing
Blender 5.0's TOP_BASELINE and BOTTOM_BASELINE; update the parameters string in
the same tool object (the object literal where name === "add_text_object" in
tool-registry.ts) to include TOP_BASELINE|BOTTOM_BASELINE in the align_y enum
(e.g. align_y?: TOP|CENTER|BOTTOM|TOP_BASELINE|BOTTOM_BASELINE), leaving align_x
as-is.

In `@public/downloads/vipermesh-addon.py`:
- Around line 1422-1459: Currently the code eagerly mutates Blender state
(loading font via bpy.data.fonts.load into loaded_font, creating/linking
target_collection with bpy.data.collections.new and
bpy.context.scene.collection.children.link, and removing existing when existing
and replace_existing) before the new text object is fully created/converted;
instead, validate inputs first, then create the new text object under a
temporary name/unlinked state (use your text_add/convert flow but keep it
isolated), apply font/material/transform to that temp object, and only after all
steps succeed swap it into target_collection and remove the original existing
object (existing/remove) if replace_existing; on any failure, undo any created
datablocks (unload or remove loaded_font if newly loaded), delete the temp
object and delete any newly-created collection to leave the scene unchanged.
Ensure references to loaded_font, target_collection, material_name/mat,
existing, text_add and convert are used to locate and implement the
transactional create-then-swap flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 779c91c7-4f6a-4e76-b40c-beeb7902d288

📥 Commits

Reviewing files that changed from the base of the PR and between f6bd92f and a59f1ea.

📒 Files selected for processing (11)
  • app/api/test-pipeline/route.ts
  • data/tool-guides/scene-composition-guide.md
  • desktop/assets/vipermesh-addon.py
  • docs/blender-mcp-capability-inventory.md
  • lib/ai/agents.ts
  • lib/orchestration/prompts/blender-agent-system.md
  • lib/orchestration/tool-filter.ts
  • lib/orchestration/tool-registry.ts
  • public/downloads/vipermesh-addon.py
  • scripts/test/test-blender-text-object-tool.ts
  • scripts/test/test-tool-guide-trigger-coverage.ts

Comment thread desktop/assets/vipermesh-addon.py
Comment thread lib/orchestration/tool-registry.ts
Comment thread public/downloads/vipermesh-addon.py Outdated
@Ker102 Ker102 merged commit fc43805 into main May 31, 2026
6 checks passed
@Ker102 Ker102 deleted the feature/text-object-tool branch May 31, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend desktop documentation Improvements or additions to documentation scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant