Cinema - Non-GUI Rendering

In addition to the standard GUI-based methods provided by the plugin, it is also possible to ask the plugin to render a Scene via C.O.F.F.E.E (or C++/Python/etc.) code. Here is an example of how to do that (in C.O.F.F.E.E):


    // Maxwell plugin command IDs 
    var renderToMxs = 1024908;
    var renderToStudio = 1024907;
    var renderToNetwork = 1027368;
    var renderActiveView = 1024906;
    var renderRenderView = 1024905; 
    // we can render the first scene found:
    SpecialEventAdd(renderRenderView); 
    // ...or we can get the active Cinema doc
    var doc = GetActiveDocument(); 
    if (doc)
    {
        // find the desired Maxwell Scene Object
        var scene = doc->FindObject("my.scene"); 
        if (scene)
        {
            // ...and tell it to render:
            scene->Message(renderRenderView);
        }
    } 


It is also possible to render in Maxwell when starting Cinema from the command-line. In this case, it is always the first Maxwell Scene Object found in the Cinema document which will be rendered; if none is found, an error will be reported. All that is necessary is to add the -rendermxs flag to the command-line:


> "[path to cinema 4d.exe]" "c:\doc.c4d" -nogui -rendermxs 

   
When this command-line is executed, C4D will be started in 'nogui' mode, and the first Maxwell Scene Object found in doc.c4d will be rendered in Maxwell Render. The parameters contained in the Scene Object will be used; for example, if the Scene Object has Animation enabled, an animation will be exported and rendered. Additionally, it is possible to override various parameters specified in the Scene Object. This is done by putting them directly on the Cinema command-line. When doing so, parameter values should never be quoted, and spaces should be encoded using +20. Several plugin-specific commands are available:


CommandDescriptionUsage
-outputdirOverrides Scene Object > Output > Folder.-outputdir:c:\dir+20name+20with+20spaces
-outputnameOverrides Scene Object > Output > Name.-outputname:output+20name+20with+20spaces
-outputformatOverrides Scene Object > Output > Name > Extension/Depth.-outputformat:tif32
-framesEnables animation, using the specified frame range (separated by a dash).-frames:2-24
-framestepIf animation is enabled, this parameter overrides the animation frame step value.-framestep:3
-cmdlineModifies the Scene Object command-line.

-cmdline:append (the default)

-cmdline:override

-scenenameUse this to specify that a particular Scene Object be rendered.-scenename:Scene+20Name


Regarding the -cmdline option, the values appended to (or used to override) the Scene Object command-line parameters (i.e. Scene Object > Engine > Command Line), are communicated by placing them directly on the C4D command-line. Note that since C4D also uses the -nogui command, you must use Maxwell Render's -n alias for this parameter instead. Here is an example command-line, which renders a series of frames from a given C4D file:

> "[path to cinema 4d.exe]" "c:\doc.c4d" -nogui -rendermxs -outputdir:c:\new+20output+20dir -outputname:new+20output+20name -outputformat:png16 -frames:1-21 -framestep:2 -cmdline:override -channel:alpha,on,32,tif -channel:material,on,16,png -th:4 -sl:5.65 -nomxi -n -nowait