▪If you want to: - Grab any part of your scene rig, based on the selected rig's namespace, MG-Picker studio is able to auto-load a picker file, set up the namespace, and ready to be used.
- Without any selection, click the top-left button to visit the menu, and select any entries in the "Load All Pickers" menu to load all pickers for all scene rigs, or all characters, props, etc.
- All the mapping rules between rigs and pickers are customizable.
Then this page is for you!
▪How to do that? 1.Create your own python module. One would be enough. 2.Create two classes, one inherits from MGP.loader.MGPickerRigListerBase and another inherit from MGP.loader.MGPickerLoaderBase.
MGPickerRigListerBase derived class is for listing a set of rig names (Maya rig namespace) for a certain category of asset.
You can define the method name mayaScene_* and it will be picked up. For example:
def mayaScene_characters(self):
This method list all the rig names for an asset category called "characters", then in the "Load All Pickers" menu in the more button, will have a "Load All Characters" entry.
The name of the category is all decided by you, just use the prefix "mayaScene_" for the method name. 3.With lister, now we know for what rig names we need to load the picker files. It is time to load them!
MGPickerLoaderBase is for this. For this class, you just override the pickerFileForAssetName method:
def pickerFileForAssetName(self, assetName)
For an asset name (which is a Maya namespace string), you just return a full path to a picker file. 4.Once the python module is ready, you have two ways to make it picked up by MG-Picker Studio, choose the one that fits you:
a. Put the python module in AutoLoaders folder in MGPicker_Program folder in the MG-Picker Studio installation directory.
b. Put the module name or module full path in the environment variable called "MGPICKER_LOADER_PY_MODULES".
To avoid hard-coding the environment name, use MGP.loadermanager.MGPICKER_LOADER_LISTER_MODULES_ENV_NAME instead.
If it is just a module name instead of a full path, make sure the directory that contains the module is in sys.path beforehand. 5.Check out the "loader_example.py" example python module in MGPicker_Program/AutoLoaders/Examples folder. For multiple lister & loader modules, use ';' to separate in the MGPICKER_LOADER_PY_MODULES env variable.
For multiple modules, asset names will be merged for the same category, yet it will skip the leftover loader if one loader succeeds.
|