How logicreinc/logicreinc.blendfarm works
Project Type and Purpose
• BlendFarm is a distributed network‐rendering system for Blender, composed of a headless render “server” (render node) and a cross-platform GUI “client,” sharing a common messaging library.
• Purpose: coordinate multiple machines over the LAN to split and accelerate Blender renders.
File Structure
• Top-level solution (LogicReinc.BlendFarm.sln)
• LogicReinc.BlendFarm.Client – GUI front-end (Avalonia + .NET Core)
• LogicReinc.BlendFarm.Server – headless render node (console app + Python helper scripts)
• LogicReinc.BlendFarm.Shared – common DTOs, protocol, binary parser, exceptions
• LogicReinc.BlendFarm – the packaged desktop app and UI logic
• LogicReinc.BlendFarm.Tests – unit and integration tests
• .data, .resources – static assets (announcements, example media)
• build scripts (build-osx-arm.sh, build-server.sh)
• Notice configuration files (nuget.config), automation scripts (extract_dependencies.py, peek.py, render.py).
Readme Insights
• Architecture: custom TCP protocol for commands & file sync; UDP broadcasts for auto-discovery.
• Technologies: C# / .NET Core 3.0, Avalonia UI, Python for Blender orchestration.
• Features: split/chunked rendering strategies, auto-download Blender versions, live re-render on save.
Main Components
a. Client GUI (LogicReinc.BlendFarm.Client & LogicReinc.BlendFarm)
b. Render Server (LogicReinc.BlendFarm.Server)
c. Shared Library (LogicReinc.BlendFarm.Shared)
d. External Blender Engine (spawned processes; versions in BlenderData)
e. Networking segments (UDP discovery, TCP command & data channel)
f. Local file storage (.blend files, assets) and optional announcements service
Relationships & Data Flows
• UDP Broadcast: Client → Network → Server (auto-discovery)
• TCP Connection: Client ⇄ Server (handshake, version check, sync, task dispatch)
• File Sync: Client pushes updated .blend and dependencies via TCP (FileUpload messages)
• Task Dispatch: Client sends RenderBatchRequest / RenderRequest
• Blender Process Lifecycle: Server spawns Blender child process → renders chunks → streams RenderInfoResponse / image data back
• Performance Feedback: Server reports timings; Client uses shared library to adjust chunk distribution
Architectural Patterns & Principles
• MVVM (Client UI layer separated from logic/controllers)
• Layered Architecture:
• Presentation (Avalonia UI)
• Application (Client/Server logic)
• Shared Domain (Messaging, Models)
• Infrastructure (TCP/UDP transport, Blender process management)
• Single Responsibility: each assembly focuses on one concern (UI vs. server vs. shared protocol)
• Modular Extensibility: new rendering strategies (Split, Chunked) implemented via strategy pattern in Tasks/
Key Technologies & Libraries
• C# .NET Core 3.0
• Avalonia UI (cross-platform GUI)
• Custom TCP protocol & UDP broadcasts
• Python scripts for Blender scripting (render.py, peek.py)
• JSON files for announcements and configuration
What to Emphasize
• The split between front‐end and back‐end, with a shared contract in BlendFarm.Shared
• Networking flows (UDP auto-discovery, TCP tasks & file sync)
• Lifecycle of a render job (upload, dispatch, spawn Blender, chunked render, aggregation)
• How Blender versions are managed (download to BlenderData, spawn as subprocess)
• Extensibility points: adding new strategies under Tasks/ on the client and server