Variable Path and File Names ("Tokens")
Variable path and file names (Tokens) can be used in the following locations when saving renderings:
- In the Render Settings’ Save tab's File input fields for either normal or multi-pass images.
- In the Render Manager's Output Path
- In the -oimage and -omultipass commands’ command lines.
What is a Token used for? Tokens are simple text variables used in path and file names. When rendered or displayed in the Picture Viewer they will be replaced by project attributes such as project name, camera currently being used, which take, etc.
Example
The following example should shed some light on how this works:
Note the file path in the above image: Results/$take/$rs. The variables $take and $rs (a list with all available Tokens can be found below) are Tokens. A file path's last Token (here $rs for the render setting name) is always the file name and preceding Tokens (in this example $take for the take name) represent directory names. These do not have to be pre-existing directories! Cinema 4D will create them if they do not already exist.
On the right side of the above image, 12 takes are marked in the Attribute Manager window that have various names and different render settings (which are marked on the left (Small Resolution, Normal Resolution and Large Resolution). If all 12 takes are rendered, each directory name ($take) would be replaced by the take name (e.g., Analog) and the rendered image saved at that location. The image's file name ($rs) will also be replaced by the name of the respective render setting.
Tokens
The following Tokens can be used:
- $prj: Project file name
- $camera: Current camera name
- $take: Current take name
- $pass: Multi-Pass or object channel name (the defined multi-pass names). Primarily to be used as directory name. (the Channel Name as Suffix option will be disabled internally)
- $userpass: Multi-Pass or object channel name (the multi-passes renamed via double-click in the Render Settings (opened Multi-Pass tree view). Primarily to be used as a directory name.
- $frame: Current animation frame
- $rs: Current Render Setting name
- $res: Image resolution (e.g., 800*600: 800X600)
- $range: Animation range (e.g., from frame 23 to 76; 23_76)
- $fps: Frame rate
- $username: Operating system username
- $height:Render output as defined in the Render Settings menu, e.g., 720
- $computer: Operating system machine name
- $YY: The current year (only last 2 digits), e.g., 21 for 2021
- $YYYY: The complete current year date with all 4 digits
- $mm: The current time (only minutes), e.g., 35 for14:35:59
- $MM: The current month, e.g., 03 for 12.03.2021
- $ss: The current time (seconds only), e.g., 59 for 14:35:59
- $hh: the current time (hours only), e.g., 14 for 14:35:59
- $DD: The current day, e.g., 12 for 12.03.2021
- $author: The author defined in the Info tab
- $renderer: The render engine defined in the Render Settings menu, e.g., Redshift
Object channel refers to the Compositing tag's Object Channels that are used to render Alpha channels of specific objects as separate Multi-Passes.
These Tokens, which can also be used in combination with any series of characters (e.g., Camera_$cameraXY1), can be used to create complex directory structures. Especially in combination with the Take function (see Take Manager), which makes various project states at the point of rendering available, ,procedural’ file and path names can be generated, which, for example, generate directories named in accordance with the file name. Subsequent re-rendering will not overwrite existing paths/files, which is a handy feature when working with complex projects (of course the Token system also works with multi-passes).
Note that multi-pass file names already contain their own names, which causes numerous seemingly superfluous Tokens such as $pass or $userpass to appear. However, these can also be used to name directories.