How aspirata/miblend works
Project type and purpose
• MiBlend is a Blender addon (Python–based plugin) for creating and exporting Minecraft assets (nodes, rigs, materials, resource packs) directly from Blender.
• It bundles Blender UI panels, operators, asset-loading modules, export logic, resource-pack management, build scripts, continuous integration, and documentation.
File structure
• Top‐level:
• .github/workflows: CI build & packaging
• bpy-build.yaml, build_for_release.bat, scripts/: packaging and release scripts
• MiBlend_Source/: core addon code subdivided into modules—Assets, Materials, Scripts, Rigs, Optimization, UI, Operators, API, Data, Preferences, Properties, Utils
• MiBlend_Source/Resource Packs: directories of JSON/model/texture assets
• docs/: documentation source (MDX) for site generation
• Debug/, .blend files: test assets
• Patterns: clear modular breakdown (UI vs business logic vs assets vs export), Python package structure, Blender API integration via __init__.py, build pipeline declarations.
README insights
• Describes MiBlend as beta, links to Wiki, contributors, and video demo.
• Emphasizes community contributions in rigging, coding, resource packs.
Main components & interactions
a. Components
1. Blender Host (bpy)
2. MiBlend Addon Code
• UI Layer (UI.py, panels in docs)
• Operators Layer (Operators.py)
• API Layer (MIB_API.py, Data.py, Properties.py, Preferences.py)
• Asset Modules (Assets.py + subfolders for Nodes, Rigs, Scripts)
• Materials Module (Materials.py + .blend presets)
• Optimization Module
• Utils (translation, solvers)
3. Resource Pack Generator
4. Build & Release Pipeline (CI workflows, build scripts)
5. Documentation Site Generator (docs/ + docs.json)
6. External Services
• GitHub (source, CI/CD)
• Docs host (docs.page)
• Discord/YouTube (community links)
b. Relationships & Data Flow
1. User → Blender UI Panel → triggers Operators
2. Operators call API Layer (MIB_API, Data, Properties)
3. API Layer interacts with Asset Modules and Materials Module to assemble .blend nodes, rigs, scripts
4. API Layer invokes Resource Pack Generator → writes JSON, textures, models into Resource Packs structure
5. On demand, build scripts package the addon into .zip and resource packs for release
6. CI (GitHub Actions) orchestrates build & publish
7. Documentation source → site generator → published to docs.page
c. Architectural patterns
• Modular separation (UI, Business Logic, Data, Assets)
• Plugin architecture conforming to Blender’s addon API (registration of panels, operators, preferences)
• Asset-centric pipeline (scan directories, load JSON/.blend, register in UI)
• CI/CD for automated builds and doc deployment
d. Key technologies
• Python 3.x, Blender’s bpy API
• JSON asset definitions
• GitHub Actions for CI/CD
• MDX-based documentation site (docs.page)
Elements
• Clear component labels (e.g., “UI Panel”, “Operators”, “MIB_API”)
• Blue for Blender addon runtime modules
• Green for asset/data directories
• Orange for build/CI processes
• Grey for external services
Detailed breakdown recommendation
• Related Python modules together and label their responsibilities
• How the Asset Modules folder maps to “Asset Loader” component
• Two outputs:
• .blend files rendered or configured in Blender
• Resource Pack directory structure for Minecraft
• CI/CD flow: commit → GitHub Actions → build addon & docs → GitHub Releases & docs.page