How not-elm/desktop_homunculus works
Main Components
• Core Application Logic:
• Entry Point (src/main.rs) and initialization code.
• Modules for handling the desktop window on different platforms (src/application_windows and src/global_window with platform-specific code for macOS and Windows).
• Systems managing the mascot behavior (src/mascot), including drag, rendering layers, sitting, etc.
• VRM and VRMA modules (e.g. src/vrm, src/vrma) for loading models, handling expressions, managing animations/transitions, and retargeting.
• System parameters (src/system_param) which include bone offsets, cameras, monitors, and other low-level integration aspects.
• Assets Management:
• Assets directory housing models, animations (organized into group folders under assets/animations), and UI-related files.
• The animations are logically grouped by action (idle, drag, sit_down, etc.), which is a core design element.
• Desktop UI:
• The UI folder (ui/) contains a TypeScript/React-like application (tsx files, Vite config) that provides settings and controls (e.g., mascot settings, menu actions) to alter animation behavior.
• Build & Deployment:
• The build directory contains platform-specific build scripts and resources for Windows, macOS, Android, and even web.
Relationships and Data Flow
• How the UI (frontend) interacts with the core application:
• E.g., a settings change in the UI component (ui/src/Settings.tsx) sends commands to the core, which then uses modules from src/mascot and src/settings to update the mascot’s state.
• Assets Flow:
• How the assets folder is consumed by the VRMA/VRM modules for loading animation files and VRM models.
• Different directories under assets/animations correspond to action groups used by the animation system.
• Platform-Specific Behaviors:
• Build and Deployment Pipelines:
Architectural Patterns and Technologies
• Modular design with clear separation:
• Core logic is in Rust; UI is written in TypeScript with React-style components.
• The animation system uses action-transition patterns (auto, manual, none) that drive the state evolution for the mascots.
• Dependencies and external libraries:
• The project uses Rust’s Cargo for dependency management (Cargo.toml and Cargo.lock) and likely leverages libraries such as Bevy (reference in credits) as part of its game/application template for rendering.
• The UI is built using the modern TypeScript workflow (Vite configuration, pnpm lock files).
• Cross-Platform Considerations:
• The codebase provides specific modules and builds for handling differences across Windows, macOS, and other platforms.
Instructing the Principal Software Engineer
• Next, drill down into each segment:
• For the Assets, show the structured directories (models and various animation groups) that feed into the VRM and VRMA modules.
• Flow from the assets directory into VRM loading routines.