Skip to main content

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

  1. Open a terminal as an administrator.

  2. 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).

  1. Go to the GitHub Releases page.

  2. Download the source code .zip file for the latest release.

  3. Extract the archive. You will find a mbpluginloader directory inside.

  4. Copy the mbpluginloader directory into your own project's source tree.

  5. 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 .dll file or a directory containing .dll files.

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

  1. 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.29 for VS2019 or -vcvars_ver=14.16 for VS2017. See the Microsoft documentation for more details.


  1. Clone this repository.

    git clone https://github.com/Ndgt/MBPyPluginLoader.git
    cd MBPyPluginLoader
    

  1. Edit the user-specific variables in CMakeLists.txt according to your environment.

    # === Environment-specific user configuration ===
    set(PRODUCT_VERSION 2026)
    set(MOBU_ROOT "C:/Program Files/Autodesk/MotionBuilder ${PRODUCT_VERSION}")
    

  1. Build.

    cd src
    cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
    cmake --build build
    

Notes

  • FBSystem().Version returns float version value formatted as xx000.0

    For 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

This version

2.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mbpluginloader-2.1-py2.py3-none-win_amd64.whl (192.1 kB view details)

Uploaded Python 2Python 3Windows x86-64

File details

Details for the file mbpluginloader-2.1-py2.py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for mbpluginloader-2.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9bf0c9dcd3251d5d7ee3740c34fb855b77f57ca2b344d567ee99107af92da712
MD5 2728f3f0c0b2bf13013115e8f2f91db5
BLAKE2b-256 02b1664814b7d20bc339429181cfef87f9ed3708c58c889c2d3d457d72971476

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page