3ds Max C++ API Reference
|
MAXScript scripts are typically written in English, but when MAXScript accesses names from TrackView nodes only localized names are available. More...
Enumerations | |
enum | ResolutionContext { kTrackViewNodes , kCount } |
The property name resolution context where localized \ English string translation lookup is occurring. More... | |
Functions | |
CoreExport bool | RegisterTranslation (ResolutionContext context, const MCHAR *localizedString, const MCHAR *nonLocalizedString) |
Specifies translation between a localized and non-localized (English) string pair for when MAXScript is performing property resolution. | |
CoreExport bool | GetLocalizedStrings (ResolutionContext context, const MCHAR *nonLocalizedString, Tab< const MCHAR * > &localizedStrings) |
Retrieves localized translations for a non-localized (English) string. | |
CoreExport bool | GetNonLocalizedStrings (ResolutionContext context, const MCHAR *localizedString, Tab< const MCHAR * > &nonLocalizedStrings) |
Retrieves non-localized (English) translations for a localized string. | |
MAXScript scripts are typically written in English, but when MAXScript accesses names from TrackView nodes only localized names are available.
By specifying localized and English string pairs using the RegisterTranslation method, MAXScript is able to retrieve the English name corresponding to a localized name to see if it matches the property name or SubAnim name specified by a script. Code that operates on TrackView nodes via ITrackViewNode::AddNode or ITrackViewNode::AddController should register via RegisterTranslation the English name corresponding to the localized name specified in these methods. TrackView nodes persist their names to the scene file, so in order to ensure that the translations are present when loading the scene file, the translations should be registered when the dll is loaded.
For example, if have the following code:
The following would be specified:
And then RegisterTranslations() would be called from the DllMain function handling of DLL_PROCESS_ATTACH. For example:
enum ResolutionContext |
CoreExport bool RegisterTranslation | ( | ResolutionContext | context, |
const MCHAR * | localizedString, | ||
const MCHAR * | nonLocalizedString | ||
) |
Specifies translation between a localized and non-localized (English) string pair for when MAXScript is performing property resolution.
[in] | context | - The property name resolution context where this translation will be used |
[in] | localizedString | - the localized string |
[in] | nonLocalizedString | - the non-localized (English) string |
CoreExport bool GetLocalizedStrings | ( | ResolutionContext | context, |
const MCHAR * | nonLocalizedString, | ||
Tab< const MCHAR * > & | localizedStrings | ||
) |
Retrieves localized translations for a non-localized (English) string.
[in] | context | - The property name resolution context |
[in] | nonLocalizedString | - the non-localized (English) string |
[out] | localizedStrings | - an array of the localized strings |
CoreExport bool GetNonLocalizedStrings | ( | ResolutionContext | context, |
const MCHAR * | localizedString, | ||
Tab< const MCHAR * > & | nonLocalizedStrings | ||
) |
Retrieves non-localized (English) translations for a localized string.
[in] | context | - The property name resolution context |
[in] | localizedString | - the localized string |
[out] | nonLocalizedStrings | - an array of the non-localized (English) strings |