![]() ![]() ![]() |
Multiple Layers of User Configuration are supported in MG-Picker 1.Manual configuration is set in the user preference dialog by going to Windows/Preferences.. menu in designer mode. (Ctrl+K) 2.The server configuration is set in an external text configuration file. 3.Environment variables.
Priorities of different configuration layers ( 1 as the highest, 4 as the lowest): 1.Server settings with a "!" prefix on the configuration key name. 2.User manual configuration in UI. 3.Server settings without a "!" prefix on the configuration key name. 4.Environment variables. Tips on Manual User Settings: Besides manually setting these preferences on UI, you can also use Python/MEL API to query and set all of them. These config API is available as long as the plug-in is loaded, it does not require the UI to be loaded. # Query all config keys and values in string forms: cmds.MGPicker(q=True, config=True)
# To query one single config: cmds.MGPicker(q=True, config=("recentPickerFiles", ""))
# To set one single config: cmds.MGPicker(e=True, config=(configKey, configStringKey)) Tips on server config: •The server config file, by default, is a text file called "ServerConfig.txt" in the "MGPicker_ServerConfig" folder that is shipped with the MG-Picker program files. •The server config file is of the form "key = value", to add comment out a line, you start the line with "#". •By default, the user config will have higher priority than the ones in server config, but if you use "!key = value", then it will override the user config. •You can use the API to query all the configs to know all the possible keys you can set in the server config: cmds.MGPicker(q=True, config=True) •You can use the environment variable "MGPICKER_SERVER_CONFIG_FILE_PATH" to override the default server config file path, the default server config file will be ignored. •Environment variables are supported in the value. Use them in form of $variable, ${variable}, %variable% or __variable__. •There are some predefined constants that are not environment variables, but you can use them in the same way as environment variables in the value.
Various Environment variables Supported: The environment variables supported by MG-Picker are listed below:
* Note that the env variable "MGPICKER_USER_CONFIG_DIR" is no longer supported, as the user configuration folder is always OS_user_data_folder/MGLAND/MG-PickerStudio. |
![]() ![]() ![]() |