Token System Library Library

详细描述

由于
R17.032
另请参阅
The Token System Overview article.

Classes

struct   TokenEntry
struct   RenderPathData

Macros

#define  ID_TOKEN_LIB
#define  INVALID_FRAME

Typedefs

typedef String   TOKENHOOK (void *data)

函数

Bool   GetAllTokenEntries ( maxon::BaseArray < TokenEntry > &tokenList)
String   StringConvertTokens (const String &path, const RenderPathData *rpData)
Filename   FilenameConvertTokens (const Filename &path, const RenderPathData *rpData)
String   StringConvertTokensFilter (const String &path, const RenderPathData *rpData, const maxon::BaseArray < String > &exclude)
Filename   FilenameConvertTokensFilter (const Filename &path, const RenderPathData *rpData, const maxon::BaseArray < String > &exclude)
String   StringExtractRoot (const String &path)
Filename   FilenameExtractRoot (const Filename &path)
Bool   FilenameSlicePath (const Filename &path, Filename &root, Filename &fileName)
Bool   RegisterToken (const String &key, const String &help, const String &example, TOKENHOOK *hook)
Bool   RegisterHiddenToken (const String &key, const String &help, const String &example, TOKENHOOK *hook)

Macro Definition Documentation

◆  ID_TOKEN_LIB

#define ID_TOKEN_LIB

Token library ID.

◆  INVALID_FRAME

#define INVALID_FRAME

Private .

Typedef Documentation

◆  TOKENHOOK

typedef String TOKENHOOK(void *data)

Token hook definition. Use RegisterToken() to register a custom Token.
Here is an example from the Take Token:

static String TakeTokenHook( void *data) { RenderPathData * rDataPath = ( RenderPathData *)data; if (!rDataPath) return String ();
if (rDataPath-> _cTake ) return rDataPath-> _cTake -> GetName (); return String (); } if (! RegisterToken ( String ( "take" ), String ( "Current Take Name" ), String ( "MyTake" ), TakeTokenHook)) { return false ; }
另请参阅
The Custom Tokens example.

Function Documentation

◆  GetAllTokenEntries()

Bool GetAllTokenEntries ( maxon::BaseArray < TokenEntry > &  tokenList )

Fills a list will all available Token entries.

参数
[out] tokenList The array to be filled.
返回
true if successful, otherwise false .

◆  StringConvertTokens()

String StringConvertTokens ( const String path ,
const RenderPathData rpData  
)

Converts tokenized path String to standard String by replacing all Tokens with correct values if found.

参数
[in] path The original path String .
[in] rpData The data used to extract value for Tokens. The caller owns the pointed RenderPathData .
返回
The converted String , or the original path if any error.

◆  FilenameConvertTokens()

Filename FilenameConvertTokens ( const Filename path ,
const RenderPathData rpData  
)

Converts tokenized path Filename into standard Filename by replacing all Tokens with correct values if found.

参数
[in] path The original path Filename .
[in] rpData The data used to extract value for Tokens. The caller owns the pointed RenderPathData .
返回
The converted FileName, or the original path if any error.

◆  StringConvertTokensFilter()

String StringConvertTokensFilter ( const String path ,
const RenderPathData rpData ,
const maxon::BaseArray < String > &  exclude  
)

Converts tokenized path String to standard String by replacing all Tokens with correct values if found. Tokens added to exclude array are ignored.

参数
[in] path The original path String .
[in] rpData The data used to extract value for the Tokens. The caller owns the pointed RenderPathData .
[in] exclude A list of Tokens strings to be ignored.
返回
The converted String or the original path if any error.

◆  FilenameConvertTokensFilter()

Filename FilenameConvertTokensFilter ( const Filename path ,
const RenderPathData rpData ,
const maxon::BaseArray < String > &  exclude  
)

Converts tokenized path Filename into standard Filename by replacing all Tokens with correct values if found. Tokens added to exclude array are ignored.

参数
[in] path The original path Filename .
[in] rpData The data used to extract value for Tokens. The caller owns the pointed RenderPathData .
[in] exclude A list of Tokens strings to be ignored.
返回
The converted FileName or the original path if any error.

◆  StringExtractRoot()

String StringExtractRoot ( const String path )

Searches for the first Token in path. If it is found and it is in-between "/.." returns the preceeding directory path String .

参数
[in] path The original path String .
返回
The root String path, or the original String if no Token is found.

◆  FilenameExtractRoot()

Filename FilenameExtractRoot ( const Filename path )

Searches for the first Token in path. If it is found and it is in-between "/..", returns the preceeding directory path Filename .

参数
[in] path The original path Filename .
返回
The root Filename path, or the original Filename if no Token is found.

◆  FilenameSlicePath()

Bool FilenameSlicePath ( const Filename path ,
Filename root ,
Filename fileName  
)

Splits path in two parts if a Token is found as sub-folders and extracts root and filename path starting at sub-folder.

参数
[in] path The original path Filename .
[out] root The root Filename path.
[out] fileName The sub-folder and filename.
返回
true if a Token is found, otherwise false .

◆  RegisterToken()

Bool RegisterToken ( const String key ,
const String help ,
const String example ,
TOKENHOOK hook  
)

Registers a new Token that can be used in a render filename.

注意
The key is the identifier for the Token and has to be unique. For this reason identify your plugin in the Token key as a prefix.
Example: "myplug.pass" instead of just "pass" as it will collide wit the generic "pass" Token definition.
参数
[in] key The key string for the Token itself without the "$".
[in] help An help string used to show the Token in the menu.
[in] example An example string for the use of the Token.
[in] hook An implemented TOKENHOOK used to define the string to replace the Token.
返回
true if successful, otherwise false .

◆  RegisterHiddenToken()

Bool RegisterHiddenToken ( const String key ,
const String help ,
const String example ,
TOKENHOOK hook  
)

Registers a new Token that can be used in a render filename but hides it from the render filename menu.

注意
The key is the identifier for the Token and has to be unique. For this reason identify your plugin in the Token key as a prefix.
Example: "myplug.pass" instead of just "pass" as it will collide wit the generic "pass" Token definition.
由于
R18
参数
[in] key The key string for the Token itself without the "$".
[in] help An help string used to show the Token in the menu.
[in] example An example string for the use of the Token.
[in] hook An implemented TOKENHOOK used to define the string to replace the Token.
返回
true if successful, otherwise false .
RegisterToken
Bool RegisterToken(const String &key, const String &help, const String &example, TOKENHOOK *hook)
String
定义: c4d_string.h:38
RenderPathData::_cTake
BaseTake * _cTake
The BaseTake used for rendering.
定义: lib_token.h:110
BaseList2D::GetName
String GetName() const
定义: c4d_baselist.h:2318
RenderPathData
Data structure to collect render information in handling Tokens in render output path.
定义: lib_token.h:85

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1