Community编程与开发github.com

huayuehua15-netizen/unity-blender-mcp

通过 MCP 自主操作 Unity 与 Blender,完成 3D 游戏资产的搜索复用、建模、清洗、导出、导入与验收全流程。核心原则是素材优先:优先从 MCP 内置素材源(Sketchfab、Poly Haven)与外部素材库(3d66 等国内站、TurboSquid、CGTrader、Kenney、Quaternius、Mixamo、AI 生成等)搜索复用现成资产,搜不到再在 Blender 自建。涵盖 MCP 工具发现与连接、bpy 自动化建模与批处理、素材审计清洗、Unity 正确 FBX 导出、Unity 导入设置(材质/LOD/碰撞/骨骼动画/Prefab)、批量导入后处理与故障排查。当用户要求用 MCP 操作 Blender 或 Unity、找 3D 模型/素材/动画、把下载素材导入 Unity、处理素材格式与授权、Blender 建模或改模、导出 FBX、搭建 Blender→Unity 管线、修复粉色材质/缩放/法线/轴/碰撞/动画异常时使用。 English: Asset-first 3D pipeline driving Unity and Blender through MCP: search and reuse existing assets, audit and clean them, export FBX, and import into Unity with correct materials, LODs, colliders, skinned animation and prefabs. Use when sourcing 3D assets, building a Blender-to-Unity pipeline, or fixing pink materials, scale, normals, axes, colliders or animation issues.

unity-blender-mcp 是什么?

unity-blender-mcp is a Claude Code agent skill that 通过 MCP 自主操作 Unity 与 Blender,完成 3D 游戏资产的搜索复用、建模、清洗、导出、导入与验收全流程。核心原则是素材优先:优先从 MCP 内置素材源(Sketchfab、Poly Haven)与外部素材库(3d66 等国内站、TurboSquid、CGTrader、Kenney、Quaternius、Mixamo、AI 生成等)搜索复用现成资产,搜不到再在 Blender 自建。涵盖 MCP 工具发现与连接、bpy 自动化建模与批处理、素材审计清洗、Unity 正确 FBX 导出、Unity 导入设置(材质/LOD/碰撞/骨骼动画/Prefab)、批量导入后处理与故障排查。当用户要求用 MCP 操作 Blender 或 Unity、找 3D 模型/素材/动画、把下载素材导入 Unity、处理素材格式与授权、Blender 建模或改模、导出 FBX、搭建 Blender→Unity 管线、修复粉色材质/缩放/法线/轴/碰撞/动画异常时使用。 English: Asset-first 3D pipeline driving Unity and Blender through MCP: search and reuse existing assets, audit and clean them, export FBX, and import into Unity with correct materials, LODs, colliders, skinned animation and prefabs. Use when sourcing 3D assets, building a Blender-to-Unity pipeline, or fixing pink materials, scale, normals, axes, colliders or animation issues.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/huayuehua15-netizen/gamedev-agent-skills/tree/HEAD/plugins/unity-blender-mcp/skills/unity-blender-mcp

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Unity + Blender MCP Autonomous Pipeline

Path Convention: All scripts/, references/, and assets/ paths in this file are relative to the directory containing this SKILL.md. When moving to a different host or working directory, first resolve the SKILL.md directory into an absolute path before invoking. Always include --python-exit-code 1 when running scripts from the command line: Blender's default exit code for abnormal termination is 0; without this flag, a failed audit may be reported as successful.

Overview

This skill enables an AI to autonomously operate Blender and Unity via MCP (Model Context Protocol) following an Asset-First approach to produce 3D game assets: first search and reuse, then AI generate, and only as a last resort model from scratch — delivering each asset as a "ready-to-import-into-engine" final product.

Core Principle: Asset-First Decision Tree

When receiving any request for a "model/asset XX", strictly follow this order — do not start modeling from scratch immediately:

  1. MCP Built-in Asset Sources (fastest, zero downloads): Blender MCP's search_sketchfab_models / search_polyhaven_assets (HDRI, PBR textures, realistic models); Unity MCP's import_model (Sketchfab).
  2. CC0 Game Asset Sites: Kenney, Quaternius, KayKit, Poly Haven, Poly Pizza — consistent style, directly usable in engines, zero commercial risk.
  3. Free Sections of Major Markets: Sketchfab (filter CC0/CC-BY and Downloadable), TurboSquid, CGTrader, Fab (Megascans), BlenderKit.
  4. Domestic Sites (China): 3d66, Mofu House, Aigei Network — must check licensing and format individually (many .max files cannot be opened in Blender — see 03).
  5. Characters/Animations: Prioritize Mixamo (free auto-rigging + thousands of animations) and Quaternius animated character packs for skeletons and animations.
  6. AI Generation: Blender MCP's Hyper3D Rodin / Hunyuan3D, Unity MCP's Tripo/Meshy — use only for single, clearly-defined objects, not entire scenes/terrain.
  7. Blender Custom Build (last resort): Use bpy/modeling workflows only when nothing above is found, or precise functional structure/custom brand assets are required.

Assets from any source must go through Blender audit and cleaning (Step 5) before entering Unity. Do not drag downloaded raw FBX directly into Unity.

Before Starting: MCP Connection and Tool Discovery (Mandatory Every Session)

MCP tool names vary by implementation (commonly ahujasid/blender-mcp for Blender; CoplayDev/unity-mcp or Unity official com.unity.ai.assistant for Unity) — do not assume fixed tool names.

  1. First, list the MCP tools exposed in the current session and map them against the "Standard Capability Comparison Table" in references/00-mcp-connection.md.
  2. Check connection status:
    • Blender: Call a scene inspection tool (e.g., get_scene_info) to confirm Blender is open and the plugin is Connected.
    • Unity: Call an editor state/console tool (e.g., manage_editor / read_console) to confirm the bridge is Running.
  3. If tools are missing or not connected: Follow the troubleshooting table in 00, or fall back to command-line batch mode (blender --background --python, Unity batchmode). Do not pretend calls succeeded.
  4. On first connection, confirm the project's render pipeline (Built-in / URP / HDRP) and Unity version — material shaders and mask channel packaging differ.

Standard Work Loop (Follow for Every Operation)

Check state (scene_info / console) → screenshot/read for evidence → execute single small change
→ verify with screenshot or read → save/record → proceed to next step
  • Read before write: Get scene/object info before modifying anything; save backup with bpy.ops.wm.save_as_mainfile in Blender before making changes.
  • Small chunks: Blender MCP's execute_blender_code has a timeout (~180s); split complex tasks into multiple code blocks. Each block must be self-contained (import bpy, re-select objects by name — do not rely on variables from previous blocks).
  • Results must be visible: Verify every Blender import/placement/export with get_viewport_screenshot; in Unity, check errors with read_console after each step and confirm results via hierarchy/scene queries.
  • Do not force failures: If two attempts with the same operation fail, switch method or channel, record the symptoms, and do not retry the same call repeatedly.

Three Workflows

Workflow A: Reuse an Existing Asset (Most Common)

Read references/04-asset-reuse-workflow.md and follow the 9 steps: Requirements list → Search for assets → Candidate evaluation (including licensing) → Download to staging → Blender audit → Clean and standardize → Export FBX → QA render & visual inspection → Unity import & validation.

  • Audit: scripts/blender_asset_audit.py (outputs a JSON report of polycount/materials/UVs/transforms/skeleton/animation — compare against budget to decide keep/discard).
  • Cleaning + Export: scripts/blender_prep_unity.py (applies transforms, resets origin, recalculates normals, uniform naming, exports FBX with correct Unity parameters).
  • QA Render: scripts/blender_asset_qa_render.py (automatically generates a quality image with standard lighting and framing after export; inspect textures, metalness/roughness, normals, shape; --turntable N for multi-angle shots — only pass data+human verification).
  • Licensing: Register every non-CC0 asset in assets/asset-ledger.csv (license type, source URL, attribution requirements).

Workflow B: Create an Asset from Scratch

Read references/05-model-from-scratch.md: Reference images/dimensions → Low-poly blockout → High-poly detail → UVs → Bake normals/PBR → Self-check polycount and texel budget → Follow A's export/import steps. First determine if AI generation can replace it; AI-generated assets also require audit and retopology.

Workflow C: Blender → Unity Engine Setup

Read references/06-blender-to-unity.md: Model/material/animation import settings → LODs → Colliders → Material texture channel mapping (URP/HDRP differences) → Generate Prefab → Scene placement/light bake → Build.

  • For batch imports, place assets/unity/Editor/AssetPostprocessor.cs into the Unity project's Assets/Editor/ (with directory gating to only process the specified import folder — won't pollute the entire project).

Scripts and Assets

FilePurposeHow to Run
scripts/blender_asset_audit.pyAudit current scene or specified model file, output JSON inspection reportMCP: paste and execute code; or blender --background --python scripts/blender_asset_audit.py -- <model path>
scripts/blender_prep_unity.pyClean selected assets and export Unity-standard FBX (with optional animation baking)MCP: paste code then call prep_and_export(); or command line -- <output path>
scripts/blender_asset_qa_render.pyAsset QA render: auto-framing, HDRI/three-point lighting, AgX, neutral background produces quality image; supports --turntable N multi-angleblender --background --python ... -- <model path> <output.png> [--hdri <path>] [--turntable 3]; MCP paste renders current scene
assets/unity/Editor/AssetPostprocessor.csUnity import post-processor: set sRGB/normal/mask based on texture suffix, uniform scale/normal/mesh settings for modelsCopy to Unity project Assets/Editor/
assets/asset-ledger.csvAsset licensing ledger templateOne row per non-CC0 asset

Reference Document Index (Load as Needed)

  • references/00-mcp-connection.md: MCP connection/tool discovery/safety rules/command-line fallback without MCP
  • references/01-blender-mcp-playbook.md: Blender MCP tool table + bpy common code snippet library (import/clean/material/LOD/export/screenshot)
  • references/02-unity-mcp-playbook.md: Unity MCP tool table + scene/object/asset/material/script/build operations
  • references/03-asset-libraries.md: Asset library encyclopedia (licensing/format/selection/search keywords/pitfalls of domestic sites like 3d66)
  • references/04-asset-reuse-workflow.md: Asset reuse 9-step workflow and acceptance checklist
  • references/05-model-from-scratch.md: When to build from scratch, Blender game asset generation pipeline, handling AI-generated assets
  • references/06-blender-to-unity.md: Blender→Unity standard pipeline (axis/scale/FBX parameters/material channels/LOD/colliders/Humanoid)
  • references/07-troubleshooting.md: Symptom→cause→fix reference table (pink materials/scale/normals/fallen/collision missing/T-pose/sliding feet, etc.)

Safety Rules

  • Before modifying a user's existing Blender/Unity scene, save a backup separately; all imports and cleaning must be done in separate Blender scenes and Unity's Assets/Imports/ staging directory — only move to the final directory after passing acceptance.
  • Do not delete or overwrite user source files; keep downloaded originals in staging, save cleaning outputs separately.
  • execute_blender_code and Unity's execute_code can execute arbitrary code — prohibit operations unrelated to the current task; for dangerous operations (deletion, batch renaming, overwrite exports), first list the affected objects before executing.
  • Assets with unclear licenses (especially NC, learning-only, 3d66 free items, paid membership items) must never enter commercial projects — prefer switching to CC0 sources or building from scratch.
  • All material/texture/model naming must follow conventions (SM_/SK_/T_BC/N/RMA/M/M_/MI_); Chinese filenames and Chinese texture paths must be converted to English before export.

Definition of Done (Asset-Level DoD)

Every asset delivered to Unity must satisfy:

  • License recorded (CC0 must also note the source), clear for commercial use with no blockers
  • Audit report: polycount within budget, UVs present, no N-gon issues, transforms applied
  • Correct in-scene scale (human ~1.7m, proportional to surrounding objects), correct orientation
  • Materials not pink, textures not missing (textures included in package/within project), URP/HDRP channels correct
  • Appropriate colliders present; characters/animated assets have Avatar configured and animations work correctly
  • Prefab generated, LOD configured as required, console shows no errors
  • Key-angle quality image rendered by blender_asset_qa_render.py and visually inspected (textures/normals/metalness-roughness/shape) — then confirm with the user

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

huayuehua15-netizen/aaa-game-gdd

3A 级 3D 游戏开发文档(GDD)设计与审校技能:把模糊的游戏想法转化为可直接交付开发、达到 Steam 上架标准、对标 3A 大作的完整文档体系。覆盖游戏愿景与 Pitch、美术圣经、场景与关卡描述、主线玩法与系统数值、剧情叙事与台词脚本、交互与 UI/UX、角色设定、物品/道具建模规格、动画与帧动画规格、音频设计、技术架构与性能预算、QA 与 Steam 上架验收。当用户要写游戏策划案、GDD、游戏设计文档、场景/关卡/玩法/台词/交互/建模/动画规格、美术需求单,或需要审校游戏文档是否达到可开发、可上架、对标 3A 的质量时使用。支持 Unity/Unreal/Godot,附带一键脚手架脚本生成整套文档树。 English: AAA-grade game design document (GDD) authoring and review for Steam-ready games. Covers vision/pitch, art bible, level specs, gameplay systems and numbers, narrative and dialogue, UI/UX, character/prop/animation/audio specs, tech performance budgets, and QA plus Steam release checklists. Supports Unity, Unreal and Godot. Use when writing or reviewing a GDD, game design doc, level/scene spec, art brief, or release QA checklist.

huayuehua15-netizen/unity-gameplay-dev

让 AI 通过 MCP(或命令行)自主完成 Unity 3D 单机游戏的玩法逻辑开发:从 GDD 规格到可玩、可测试、可构建的代码。覆盖 Unity 6(6000.x,第一人称、URP、UGUI、新 Input System)下的项目脚手架与代码规范、输入系统、第一人称控制器、准星交互、Animator 状态机、UI 面板栈/HUD、背包/对话/存档/对象池/音频、NavMesh 敌人 AI、Profiler 性能定位、构建发布与测试。提供可直接编译运行的 C# 框架模板(带 asmdef 与测试)和一键脚手架脚本。当用户要求在 Unity 里写玩法代码、做控制器/移动/视角、交互系统、背包/对话/存档、UI 菜单、敌人 AI、音效集成、性能优化、跑测试或出包,或把 GDD 规格落地为可玩功能时使用。与 unity-blender-mcp(资产管线)、aaa-game-gdd(设计文档)配套,不负责 3D 资产制作、不覆盖多人联机。 English: Unity 6 single-player gameplay development from GDD specs to playable, testable, buildable code: project scaffold, Input System, first-person controller, interaction, UI panel stack, inventory, dialogue, save system, object pooling, audio, NavMesh enemy AI, profiling, build and tests. Use when writing Unity gameplay code, controllers, interaction, UI, AI, or shipping a build.

相关技能