XSIUtils.ResolveTokenString
 
 
 

XSIUtils.ResolveTokenString

Introduced

v6.01

Description

Resolves a token (a word surrounded by square brackets) string at a given time. There are two classes of tokens:

- Universal: [Project], [Scene], [Date], [Time], [Frame], [Field], [User], [Host], [Env], and [Value]

- Context-Specfic: For example, the [Pass] tokenm which is render-specific instead of universal

For a list of all the built-in tokens, see the "Tokens and Templates" section in the Softimage user guide.

Note that this call is only aware of the Universal Tokens. If any existing context-specific tokens are required, they will need to be supplied as user-defined tokens.

To specify user-defined tokens, you can pass arrays representing token names and values in the UserTokenNames and UserTokenValues arguments which will be used to resolve the token string. The two string arrays must have the same size.

C# Syntax

String XSIUtils.ResolveTokenString( String in_TokenString, Object in_Time, Boolean in_bVerbose, Object in_TokenNames, Object in_TokenValues );

Scripting Syntax

oString = XSIUtils.ResolveTokenString( TokenString, Time, Verbose, [UserTokenNames], [UserTokenValues] );

Return Value

String

Parameters

Parameter Type Description
TokenString String The input string containing tokens.
Time Variant The time used to resolved time dependent tokens.
Verbose Boolean True to log error messages.
UserTokenNames Variant An optional Array of strings representing the user token names.
UserTokenValues Variant An optional Array of strings representing the user token values.

Examples

C# Example

// This example shows how to resolve token strings. 
object[] tokenNames = new object[2] { "A", "C"};
object[] tokenValues = new object[2] { "AAA", "CCC" };
// Note that the Log method used below is provided by the Softimage wizards
Log( "Resolve using default tokens= " + GetUtils().ResolveTokenString("[A][C][Project]", 0, false, null, null) );
Log( "Resolve using default and user tokens= " + GetUtils().ResolveTokenString("[A][C][Project]", 0, false, tokenNames, tokenValues) );