From 417ff72850cc710183a1cbce8d6a4f24a0335c28 Mon Sep 17 00:00:00 2001 From: indigo Date: Tue, 14 Jul 2026 09:05:53 +0800 Subject: [PATCH] Add PoseRenderer.mod for Maya module installs Registers the module as PoseRenderer 1.0.0, auto-adding plug-ins/ to MAYA_PLUG_IN_PATH and python/ to PYTHONPATH. Verified end-to-end (module discovery, load-by-short-name, python/ on sys.path, functional smoke test) on both Maya 2022 and 2024. README documents this as the recommended install path, with the plain MAYA_PLUG_IN_PATH route kept as a fallback. Co-Authored-By: Claude Sonnet 5 --- PoseRenderer.mod | 2 ++ README.md | 34 ++++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 PoseRenderer.mod diff --git a/PoseRenderer.mod b/PoseRenderer.mod new file mode 100644 index 0000000..728f69e --- /dev/null +++ b/PoseRenderer.mod @@ -0,0 +1,2 @@ ++ PoseRenderer 1.0.0 . +PYTHONPATH+:=python diff --git a/README.md b/README.md index c918c00..6d35c1e 100644 --- a/README.md +++ b/README.md @@ -14,16 +14,30 @@ the exact same joint mapping; switching formats does not require remapping. ## Install -1. Copy (or symlink) this whole `PoseRenderer` folder somewhere on disk. -2. Add its `plug-ins` folder to `MAYA_PLUG_IN_PATH`, e.g. in - `Maya.env`: - ``` - MAYA_PLUG_IN_PATH = C:\path\to\PoseRenderer\plug-ins - ``` - (The plugin adds its own `python/` folder to `sys.path` automatically at - load time -- you do not need to set `PYTHONPATH` yourself.) -3. In Maya: **Windows > Settings/Preferences > Plug-in Manager**, find - `openposeRenderer.py`, and check *Loaded* (and *Auto load* if desired). +**Option A -- Maya module (recommended):** copy (or symlink) this whole +`PoseRenderer` folder somewhere on disk, then add its *parent* directory to +`MAYA_MODULE_PATH` (e.g. in `Maya.env`): +``` +MAYA_MODULE_PATH = C:\path\to\parent\folder +``` +`PoseRenderer.mod` (at the repo root) handles the rest: it registers the +module as `PoseRenderer`, adds `plug-ins/` to `MAYA_PLUG_IN_PATH` and +`python/` to `PYTHONPATH` automatically. In Maya: **Windows > +Settings/Preferences > Plug-in Manager**, find `openposeRenderer.py`, and +check *Loaded* (and *Auto load* if desired) -- it's now loadable by its +short name (`cmds.loadPlugin("openposeRenderer")`) from anywhere. + +**Option B -- plug-in path only:** skip the module system and add +`plug-ins/` directly to `MAYA_PLUG_IN_PATH` instead: +``` +MAYA_PLUG_IN_PATH = C:\path\to\PoseRenderer\plug-ins +``` +The plugin adds its own `python/` folder to `sys.path` automatically at +load time either way (via `MFnPlugin.loadPath()`), so `PYTHONPATH` never +needs setting by hand for the plugin itself to work -- Option A's +`PYTHONPATH` entry only matters if you want `python/openpose_renderer` (or +the bundled `debugpy`) importable outside of loading the plugin, e.g. from +a shelf script. ## Usage