Custom MotionBuilder Module to load C++ plugins from Python Project on Startup
Project description
MBPluginLoader
Load C++ Plugins from a Python Project at MotionBuilder Startup.
Platform
- Motionbuilder : 2020 or above
- OS : Windows
Installation
Method 1: Install via mobupy & pip
-
Open a terminal as an administrator.
-
Run the following command, replacing the path with your MotionBuilder installation directory:
path/to/MotionBuilder<version>/bin/x64/mobupy.exe -m pip install mbpluginloader
Note: Only works with MotionBuilder 2022 and later.
Method 2: Manual Install
This method is mainly intended for developers who want to bundle mbpluginloader directly within their own projects or tools (i.e., as a third-party library).
-
Go to the GitHub Releases page.
-
Download the source code
.zipfile for the latest release. -
Extract the archive. You will find a
mbpluginloaderdirectory inside. -
Copy the
mbpluginloaderdirectory into your own project's source tree. -
You can now import it in your project using
from mbpluginloader import ....Project directory ├── your modules ├── ... └── mbpluginloader <- downloaded from Git Release
Reference
load_plugins(path_or_dir)
Loads a C++ plugin (.dll) from a specified file path or all plugins within a directory.
- path_or_dir (
str): The absolute or relative path to a single.dllfile or a directory containing.dllfiles.
log(level, format_string, *args)
Prints a formatted log message to the MotionBuilder console.
- level (
str): The log level (e.g., "Info", "Error"). - format_string (
str): A message template containing{}placeholders. - *args: Values to be inserted into the placeholders in
format_string.
Development
Requirements
-
Visual Studio Build Tools & "Desktop development with C++" workload
- MSVC v143 - VS 2022 C++ x64/x86 build tool : MotionBuilder 2024 ~
- MSVC v142 - VS 2019 C++ x64/x86 build tool : MotionBuilder 2022, 2023
- MSVC v141 - VS 2017 C++ x64/x86 build tool : MotionBuilder 2020
Building from source
-
Open a terminal as an administrator.
Set the Visual Studio environment variables using
vcvarsall.bat, which is typically located at:C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/Build.path/to/vcvarsall.bat x64 [-vcvars_ver=<version>]
Use
-vcvars_ver=14.29for VS2019 or-vcvars_ver=14.16for VS2017. See the Microsoft documentation for more details.
-
Clone this repository.
git clone https://github.com/Ndgt/MBPyPluginLoader.git cd MBPyPluginLoader
-
Edit the user-specific variables in
CMakeLists.txtaccording to your environment.# === Environment-specific user configuration === set(PRODUCT_VERSION 2026) set(MOBU_ROOT "C:/Program Files/Autodesk/MotionBuilder ${PRODUCT_VERSION}")
-
Build.
cd src cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release cmake --build build
Notes
-
FBSystem().Versionreturns float version value formatted asxx000.0For example, in MotionBuilder 2024, this returns
24000.0.
- This module uses Boost.Python to call the
FBSystem::LibraryLoad()function from the C++ SDK, which is not exposed in the Python SDK.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mbpluginloader-2.1-py2.py3-none-win_amd64.whl.
File metadata
- Download URL: mbpluginloader-2.1-py2.py3-none-win_amd64.whl
- Upload date:
- Size: 192.1 kB
- Tags: Python 2, Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bf0c9dcd3251d5d7ee3740c34fb855b77f57ca2b344d567ee99107af92da712
|
|
| MD5 |
2728f3f0c0b2bf13013115e8f2f91db5
|
|
| BLAKE2b-256 |
02b1664814b7d20bc339429181cfef87f9ed3708c58c889c2d3d457d72971476
|