Home  Previous Next

Tips for controlling different MG-Picker Studio versions:

Why we need to that:
Big studio might has their own software packing & managing tool and version controlling system.
So they need to able to update MG-Picker Studio to use the newly-downloaded latest version, or roll back to the older version of it.

The problem we face:
Currently in maya 2017+, MG-Picker Studio use maya's workspace control to autoload itself for a new maya session.
Problem is, for the ui script, it was hard-coded to the actually path to the loader mel, it source the mel and call a mel procedure to launch the UI.
Next time you change to use new version of MG-Picker Studio, but the workspace control config still point to the old mel path.
So that means in maya, you might have the old version already loaded, yet try to load new version of tool, which might results in error.

How to solve the problem:
Starting from MG-Picker Studio v1.83, setup env variable called:  MGPICKER_PROGRAM_FILE_DIR ,
set its value to the path to MGPicker_Program directory, which contains the loader mel file called "MGPicker_WrittenByMiguel.mel".
The test of env is included in ui script of workspaceControl so will be used prior to original mel path. example in python code:
import os
os.environ["MGPICKER_PROGRAM_FILE_DIR"] = '/path/to/MGPicker_Program'
* For maya 2016 or earlier, the feature is not supported, you need to uninstall and reinstall the tool.

The actual MEL code to launch MG-Picker: (python code works alike)

string $mgpicker_programDir = `getenv "MGPICKER_PROGRAM_FILE_DIR"`;

if(`filetest -d $mgpicker_programDir`)

{

   eval ("source \""+$mgpicker_programDir+"/MGPicker_WrittenByMiguel.mel"+"\"");

}

else

{

   eval ("source \"/thePathTo/MGPicker_Program/MGPicker_WrittenByMiguel.mel\"");    // Change to real path, this is a fallback path!

}

MG_PickerStudio 1;     // Use MG_PickerStudio 0 to launch in designer mode!

 

How to setup different config root dir:
Starting from MG-Picker Studio v1.83, setup env variable called:  MGPICKER_USER_CONFIG_DIR , to determine where the configuration files go.
you can also setup in MGPicker_Program/ServerConfig/UserConfig_Position.txt, but setting the env has higher precedence over the setting in UserConfig_Position.txt.
Possible value for the environment variables are:
Any absolute path
$UserAppDir / ${UserAppDir}  / __UserAppDir__ :    Result directory might be "My Documents/maya/MG_PickerUserConfig", it takes effects to all local maya versions.
      $UserScriptDir / ${UserScriptDir} / __UserScriptDir__ :  Result directory might be "My Documents/maya/2016/scripts/MG-PickerStudio/MGPicker_UserConfig", as shown in the example, it only take effects to local maya 2016.
* You must restart maya in order to make that take effect.

 

How to setup MG-LicenceConnector dir:
Starting from MG-Picker Studio v1.83, setup env variable called:  MGPICKER_FLOAT_LIC_CONNECTOR_DIR , to the path that contains MG-LicenceConnector executable.
you can also setup in MGPicker_Program/ServerConfig/MG_LicenceConnector.txt, but setting the env has higher precedence over the setting in MG_LicenceConnector.txt.

Home Previous Next