GetAllTokenEntries(): Using GetAllTokenEntries() it is possible to get all registered Tokens. This can be used to populate a ComboBox or to print a help for the user.
Converting Tokens
StringConvertTokens() / FilenameConvertTokens(): Using these conversion functions, a path containing Tokens can be converted into a complete file path. The Tokens will be evaluated and replaced by the actual data based on RenderPathData. There are two flavors, one taking String and the other taking Filename as an input parameter.
StringConvertTokensFilter() / FilenameConvertTokensFilter(): There may be situations, where one wants to evaluate only a subset of Tokens, while keeping others for later evaluation. That's what the *ConvertTokensFilter() functions are for.
// This example renders a BaseDocument and saves the resulting image using a filename handling tokens:
There are a bunch of functions to dissect a path containing Tokens. In the following an exemplary path /myprojects/topnotchproject/$take/beautiful.tif is assumed.
StringExtractRoot() / FilenameExtractRoot(): Both return the "constant" part of a path. With the above path, these functions return /myprojects/topnotchproject/.
FilenameSlicePath(): This function is similar, but it also returns the part containing Tokens. With above path, it will return /myprojects/topnotchproject/ and $take/beautiful.tif.
Custom Tokens
RegisterToken(): Using RegisterToken() custom Tokens can be registered within Cinema 4D. Therefore RegisterToken() gets provided with all information needed by a TokenEntry (key, help and example) and a pointer to the TOKENHOOK function. The example below shows how the "$take" Token is implemented.
RegisterHiddenToken(): This function registers a hidden token that is not displayed in Render Settings.
RegisterPythonToken(): Registers a new Python token.
RegisterPythonHiddenToken(): Registers a new Python token that is not displayed in Render Settings.
Note
When registering custom Tokens, it is recommended to use a prefix to avoid collision with already existing Tokens. For example, the plugin name could be used.