How techartorg/bqt works
Project Type and Purpose
• BQt is a library/addon for Blender that enables the integration of fully custom QT user interfaces (via PySide2) into Blender, and it can even extend to other DCC tools.
• The README emphasizes features like “fully custom UI”, “cross app” usage (for popular DCC tools), and theming that matches Blender’s look, which clearly defines its purpose.
File Structure
• The top-level directories include:
• .github – CI/CD workflows (e.g., python-publish.yml) for continuous integration or publishing.
• bqt – Primary library code.
○ Submodules like blender_applications that include OS-specific integrations (darwin and win32 implementations) suggest that the system abstracts platform-specific behavior for launching Qt widgets in Blender.
○ Other components such as focus.py, manager.py, qt_core.py, and utils.py represent core functionalities like managing the application state, providing a QT core abstraction, and handling utility functions.
• bqt/ui – Contains the files related to creating UI elements (e.g., quit_dialogue.py), indicating that there’s a separation between non-UI logic and UI code.
• bqt_demo – A demonstration project containing examples (e.g., demo.py, hello_world.py, anim_bar.py) that illustrate how to use the library.
• Configuration files (requirements.txt, setup.py, license) and additional quality tools (pylintrc, pre-commit) support project maintenance.
• This structure underlines separation of concerns: library core with application and UI support, platform-specific integrations, and demonstration samples.
Readme Insights
• The README explains the integration with Blender (version 2.83 or higher), the support for multiple platforms (Windows & Mac), and special dependencies (PySide2, PyObjC for Mac).
• It also directs users to browse the Wiki for installation and further integration details, hinting at a modular design where external configuration and environment variables can toggle functionality.
• The sample code from bqt_demo serves as a practical guide to how the core library is applied.
a. Main Components to Represent:
• Core Library (bqt)
• Core Modules: manager.py, focus.py, qt_core.py, and utils.py.
• Platform-Specific Applications (bqt/blender_applications)
• Submodules: blender_application.py (base class), darwin_blender_application.py, and win32_blender_application.py.
• UI Module (bqt/ui)
• Example: quit_dialogue.py and any additional UI helpers.
• Demonstration/Application Examples (bqt_demo)
• Components: demo.py, hello_world.py, anim_bar.py, timer.py, and pyside_widgets.py.
• External Dependencies/Frameworks
• PySide2 for the actual UI elements.
• Blender integration environment (Blender environment variables, registration mechanism).
b. Relationships and Interactions:
• The Core Library manages the initialization and integration of custom QT widgets with Blender.
• The Blender Applications module provides platform-specific implementations to properly launch and integrate UI on different OSes.
• The UI module contains the components responsible for display and interaction (e.g., dialogue windows).
• Demo components illustrate usage and serve as client examples that instantiate QT widgets, register them with the manager, and interact with the core of the library.
c. Architectural Patterns / Design Principles:
• Modular/Layered Architecture: Separation between core logic, platform-specific integrations, and user interface components.
• Abstraction: The platform-specific modules hide OS details, allowing the generic parts to remain stable.
• Extensibility: The demo folder and environment variables hint at ease of extension and customization (“plug-and-play” style integration).
d. Relevant Technologies and Frameworks:
• Python as the primary language.
• PySide2 for QT widget development.
• Blender for the target environment.
• GitHub Actions for CI/CD automation.
• Each component should have a clear label (e.g., “Core Manager”, “Blender App (Darwin)”, “UI - Quit Dialogue”, “Demo - Hello World”).
• UI elements (another style).
• External dependencies (maybe in a border or different style).
Final Remarks
• Detail every portion of the project. Even if it might seem granular, capturing all relevant components like demos, utilities, and even CI/CD config can help in understanding integration points.