▪Tips for controlling different MG-Picker Studio versions: ▪Why we need to do that:
A big studio might have its own software packing & managing tool and version controlling system.
So they need to be 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 uses Maya's workspace control to autoload itself for a new Maya session.
Problem is, for the UI script, was hard-coded to the actual path to the loader MEL script, it sources the MEL script and calls a MEL procedure to launch the UI.
Next time you change to use the new version of MG-Picker Studio, 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 the new version of the tool, which might result in an 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 the UI script of workspaceControl so will be used prior to the original MEL path.
example in python code to set the environment variable:
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, set up an environment variable called: MGPICKER_USER_CONFIG_DIR , to determine where the configuration files go.
You can also set it up in MGPicker_Program/ServerConfig/UserConfig_Position.txt, but setting the env has higher precedence over the setting in UserConfig_Position.txt.
Possible values 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, set up an environment variable called: MGPICKER_FLOAT_LIC_CONNECTOR_DIR , to the path that contains MG-LicenceConnector executable.
You can also set up in MGPicker_Program/ServerConfig/MG_LicenceConnector.txt, but setting the env has higher precedence over the setting in MG_LicenceConnector.txt.
|