Go to: Synopsis. Notes. Return value. Related. MEL examples.
setPluginResource(string $pluginName, string $lookUpKey, string $value)
Assign a new value to a plugin string resource.
This is used to provide localized values for plugin string resources.
The string resource must already be registered with the plugin,
either as an MStringResource or via the mel registerPluginString
command.
Lookup keys must be unique. Both the plugin name and the
lookup key are used to uniquely identify the resource.
The plugin name is the same string that is passed to the
loadPlugin command.
This command should be called during plugin load for each
string resource that will be used at any time during the plugin
execution to ensure the resources are properly initialized.
Generally these calls are invoked with the UI string registration
procedures that are setup using MFnPlugin::registerUIStrings.
The value specified will replace the current value of the resource.
See also the loadPluginLanguageResources command.
Plugin resources are retrieved using the getPluginResource command.
The plugin resource must be initially registered. This is done
in mel using the registerPluginResource command, or in a plugin's
code using MStringResource::registerString.
None
getPluginResource, loadPluginLanguageResources, registerPluginResource
Arguments
Variable Name |
Variable Type |
Description |
$pluginName | string | Unique Plugin name (as passed to loadPlugin)
|
$lookUpKey | string | Unique key for this string resource
|
$value | string | String value to be associated with the resource
|
// Assign resource values that will be used to initialize
// menu item labels for the plugin.
// The plugin name is "myPlugin" and each resource has a unique
// key.
//
setPluginResource("myPlugin", "showBBoxLabel", "Show Bounding Box");
setPluginResource("myPlugin", "hideBBoxLabel", "Hide Bounding Box");