How bharathadolf/tinkerusd works
Project Type and Purpose
• TinkerUsd is a desktop C++ R&D application (Windows-only) for viewing and editing Pixar’s USD scene graphs. It combines a Qt6-based UI, Hydra OpenGL rendering, USD core logic, and embedded Python scripting.
Main Components
a. Presentation Layer (UI)
• Qt6 Application (mainWindow, mainMenubar)
• Advanced Docking System (ADS) integration
• Sub-modules:
• Viewport (OpenGL widget + camera controls)
• Outliner (scene hierarchy tree)
• Composition Inspector (layer stack and prim composition)
• Property Editor (MVVM tree view, value editors)
• Script Editor (Python code editor)
b. Core Logic
• USD document management (core/usdDocument)
• Global selection service (core/globalSelection)
• Utility functions (core/utils)
c. Rendering Engine
• Hydra OpenGL adapter (render/usdRenderEngineGL)
• Framebuffer object manager (render/usdDrawTargetFBO)
d. Python API & Scripting
• C++ → Python bindings (Boost.Python) in pythonAPI
• Embedded module (pythonAPI/python)
• Global services exposed to scripts
e. Camera System
• Dolly, pan, zoom (camera/usdCamera)
f. External Dependencies
• OpenUSD libraries
• Qt6 + ADS docking library
• CMake build system
Component Relationships
• UI ←→ Core: UI widgets invoke core services to load, inspect, and modify USD scenes.
• Core ←→ OpenUSD: usdDocument wraps USD Stage and Prim operations via Pixar’s API.
• UI ←→ Render: Viewport widget feeds camera transforms and USD data to the Hydra OpenGL engine.
• UI ←→ PythonAPI: Script Editor runs Python code against bound C++ services.
• PythonAPI ←→ Core: Exposed functions allow scripts to manipulate selection and document.
• Camera ←→ Viewport: Input events drive camera object, which signals viewport to redraw.
Architectural Patterns & Principles
• Layered architecture:
• Presentation (Qt UI)
• Application services (Core + PythonAPI)
• Data/Rendering (USD + Hydra)
• MVC/MVVM in Property Editor: model, delegate, view separation for USD attribute wrappers.
• Plugin-style extensibility: Python bindings enable runtime script customization.
• Single-entry Qt event loop coordinating all modules.
Final Advice
• Interactions with external subsystems (USD, Qt, ADS).
• Review against the file tree to ensure no major component (e.g., camera, pythonAPI) is omitted.