Scene Export

You are viewing an old version of this page. View the current version.

Version 8

Arnold Scene Source (.ass) is Arnold's native scene definition format, stored in human-readable, editable ASCII files that can later be rendered outside of CINEMA 4D with kick (a multi-platform, command-line utility) or used for rendering via procedurals. Beside ASS files Arnold offers writing scenes to  Universal Scene Description (USD) format.

Scene Export Dialog

C4DtoA lets you save scenes to ASS or USD files. The scene export dialog can be accessed from the Plugins > C4DtoA > Scene Export menu.

The dialog shows Arnold related options and frame settings described below.

Path

The path where the archive (.ass, .usd, .usda, .usdc) will be saved to. Numbers in a path recognized as frame padding and automatically replaced with # characters. For example if you select /path/to/test_0004.ass from a sequence in the file dialog, /path/to/test_####.ass will be shown in the filename field. If you want to use static numbers instead you have to replace the padding manually.

Format

File format, e.g. ASS or USD.

Mode

Set to Scene to export the whole scene, or set to Procedural to export only the selected meshes to be loaded in an Arnold Procedural (stand-in).

Objects

Defines the objects to be exported:

• All: Export all objects (geometries, lights, etc.) from the scene.
• Selected: Export only the selected objects.
• Selected individually: Export the selected objects to separate ASS files. The object name is added to the file name as a suffix (e.g. myexport_Sphere.assmyexport_Cube.ass, etc.)

Export Object Hierarchy

Exports the whole hierarchy of the selected objects (instead of manually selecting all children).

Replace With Arnold Procedural

Available in Procedural mode. When enabled the exported objects are replaced with an Arnold Procedural object pointing to the exported file.

Absolute Paths

When enabled all paths are exported as absolute paths, even if they are defined as relative in the scene.

ASS

ASS format specific settings.

Gzip Compression (.ass.gz)

Exports the scene directly to gzip-compressed files with the .ass.gz extension. You can expect compression rates in the 4-5x range (compared to full ASCII form, obviously there will be a lower compression ratio if the binary encoding option is being used).

Binary Encoding

Specify whether binary encoding is used to compress large arrays (bigger than 16) containing float in their components. They are encoded into a more compact ASCII representation (b85), leading to smaller files and faster load times, whilst still being mostly human-readable.  In addition, the binary encoding has exact 32-bit precision, whereas without this binary output floating point values are truncated into at most 8 ASCII digits (e.g. 1234.5678). The encoded arrays are indicated by prefixing the array type with "b85" as in the example below. POINT2, POINT, and VECTOR arrays are encoded. 16 float

polymesh

{

name mymesh

nsides 54 1 UINT  3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

 4 4 4 4 4 3 3 3 3 3 3 3 3 3

vlist 47 1 b85POINT

 LJ4iv4THCEE/NV4/1nPCvhpuBkEMk10/LJ4iv2uf+kDVzHI/36OGvhkc/kD9+Fs/LGenvtmU8EDqJVo/l1cGv+Ij50D1 ...

Expand procedurals

Internally, Arnold creates shape nodes from procedural nodes (usually on demand). 'Expand procedurals' expands the nodes before doing the Ass export. Therefore when saving .ass file you will get all of the nodes that have been created by the procedural.

Include

Specifies which of the following node types are included in the ASS export:

• Option
• Cameras
• Lights
• Shapes
• Drivers
• Filters

Animation

Frame range

Specifies the range of frames to be exported:

• Use render settings: frames specified for render (Render Setting / Output) will be exported.
• Current frame: exports only the current frame.
• Custom: exports frames specified by the Frame start/end/step settings.

Frame start

Specifies the start frame of the sequence to be exported in custom mode.

Frame end

Specifies the end frame of the sequence to be exported in custom mode.

Frame step

The increment between the frames to be exported in custom mode.

Currently animation can not be written to a single USD file, a different file is created for each frame.

Export

Writes the file(s) to the disc.

Scene Export from command line

Besides the above dialog, scene export can be executed from the command line as well via the -arnoldSceneExport parameter followed by the export options. Note that you have also use the -nogui parameter to disable the user interface.

For example, the following command exports frame range 10-20 of myscene.c4d to myscene.ass on Window:

c:\Program Files\MAXON\CINEMA 4D R16\CINEMA 4D.exe -nogui -arnoldSceneExport "scene=c:\path\to\myscene.c4d;format=ASS;filename=c:\path\to\myscene.ass;startFrame=10;endFrame=20"

Note that the export runs in the background, therefore, you have no output in the console. You can redirect the output of the call to a file using the > directive:

c:\Program Files\MAXON\CINEMA 4D R16\CINEMA 4D.exe -nogui -arnoldSceneExport "scene=c:\path\to\myscene.c4d;format=ASS;filename=c:\path\to\myscene.ass;startFrame=10;endFrame=20" > export.log 2>&1

The following options are available by the arnoldSceneExport parameter:

• scene: path to the C4D scene file to export. This parameter is mandatory.
• format: output file format, ASS or USD. If not specified, the plugin guesses the format from the file extension.
• filename: path of the output .ass file. If not given .ass file is exported next to the c4d scene file.
• compressed: if given the scene is exported directly to gzip-compressed files (.ass.gz).
• asciiAss: if given values exported to a standard text format, if not given (default) binary encoding is used.
• expandProcedurals: if given procedurals will be expanded before exporting the scene.
• exportObjectHierarchy: if given the whole hierarchy (children) of the selected objects is exported.
• mask: specifies which Arnold node types are included in the .ass export. See the AtNodeEntry page of the Arnold API for the available node types.
• exportType: specifies which objects are exported. Possible values are:
• 0: all
• 1: selected
• 2: selected individually
• startFrame: specifies the start frame to be exported. When not given scene's render settings will be used.
• endFrame: specifies the end frame to be exported. When not given scene's render settings will be used.
• frameStep: specifies the increment between frames. When not given scene's render settings will be used.
• camera: you can override active scene camera by this option by specifying the name of the camera. Note that camera names must be unique otherwise always the first camera with the same name is used.

Scene Export from script

Scene export is implemented as a command which means it can be called from scripts as well. using the CallCommand() function with id of 1029993. Export options can be defined via a document setting.

For example, the following python script exports frame range 10-20 to myscene.ass:

import c4d

ARNOLD_SCENE_EXPORT = 1029993

def main():
options = c4d.BaseContainer()
options.SetFilename(0, "c:\\path\\to\\myscene.ass")
options.SetInt32(6, 10)
options.SetInt32(7, 20)
doc.GetSettingsInstance(c4d.DOCUMENTSETTINGS_DOCUMENT).SetContainer(ARNOLD_SCENE_EXPORT, options)

c4d.CallCommand(ARNOLD_SCENE_EXPORT)

if __name__=='__main__':
main()

List of available option ids can be found in C4DtoA/res/c4d_symbols.h header file. They are the following:

• 0 (Filename) filename: path of the output .ass file. If not given .ass file is exported next to the c4d scene file.
• 1 (Bool) | compressed: if true the scene is exported directly to gzip-compressed files (.ass.gz).
• 2 (Bool) | bounding box: if true bounding box of the scene are added to the ASS meta data.
• 3 (Bool) | binary: if true binary encoding is used.
• 4 (Bool) | expand procedurals: if true procedurals will be expanded before exporting the scene.
• 5 (Int32) | mask: specifies which Arnold node types are included in the .ass export. See the AtNodeEntry page of the Arnold API for the available node types.
• 6 (Int32) | start frame: specifies the start frame to be exported. When not given scene's render settings will be used.
• 7 (Int32) | end frame: specifies the end frame to be exported. When not given scene's render settings will be used.
• 8 (Int32) | step frame: specifies the increment between frames. When not given scene's render settings will be used.
• 11 (Int32) | export objects: specifies which objects are exported. Possible values are:
• 0: all
• 1: selected
• 2: selected individually
• 12 (Bool) | replace with Arnold Procedural: replaces the exported objects with an Arnold Procedural pointing to the ASS file.
• 13 (Bool) | export object hierarchy: exports the whole hierarchy (children) of the selected objects.
• 14 (Int32) | format: format of the output file. If not specified, the plugin guesses the format from the file extension. Available values are:
• 193450604: ASS
• 193472369: USD

• No labels