Home  Previous Next

If you wanna:

- Grab any part of your scene rig, based on selected rig's namespace, MG-Picker studio is able to auto-load a picker file, setup namespace and ready to be used.

- Without any selection, click the top-left "..." button to visit the menu, select any entries in the "Select 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 inherit 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 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 call "characters", then in "Load All Pickers" menu in the more button, will have a "Load All Characters" entry.
The name of category is all decided by you, just use a prefix "mayaScene_" for method name.

3.With lister, now we know for what rig names that we need to load the picker files for. It is time to load them !
MGPickerLoaderBase is for this. For this class, you just override 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 for you:
a. Put the python module in AutoLoaders folder in MGPicker_Program folder in 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 code the environment name, use MGP.loadermanager.MGPICKER_LOADER_LISTER_MODULES_ENV_NAME instead.  
   If it is just a module name instead of 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.

Warning  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 same category, yet it will skip leftover loader if one loader succeeds.

 

Home Previous Next