Scripting Preview

We introduced the new commands that render in modo_cl and are available as well in Modo. There are now 4 commands that can be used to render Preview to an image/image sequence/movie.

Commands that require Preview

  • iview.renderAnim

  • iview.render

These are used for rendering with Preview without a Preview pane. Functionally they are very similar though. The primary use is for rendering from modo_cl.

  • render.preview

  • render.previewAnim

All commands share the same arguments.

  • Time (time)
    • The maximum render time (in minutes) it will take for the frame or whole animation to render based on if ‘Per frame’ is enabled or not

    • Optional argument, defaults to the value set in the render item.

    • Zero means disabled; render until convergence is hit (clearly not recommended).

  • Use Render Time (perFrame)
    • Optional, there are two choices Entire Sequence/Frame

    • When Entire Sequence is set the Render Time is used for all the frames of the sequence, where Frame is set it’s time for one frame

  • Convergence Target (conv)
    • The convergence target value that needs to be reached before rendering stops (this value is used for one frame).

  • First/Last frame (first/last)
    • Optional, default values are the first/last from the render item.

  • Force Geometry Update Per-Frame (geoUpdate)
    • When enabled, Preview will force geometry update for surfaces that have displacement and adaptive fur.

  • Use Render Outputs (useRO)
    • When enabled, Preview will read render output filename and format channels

  • Filename/Format (filename/format)

The Time argument is a maximum time for a frame/animation (based on the perFrame argument). However, on complex scenes that time can be exceeded, that’s because we really want all pixels to be ‘touched’ (sampled at least once) prior to being saved to disk. The Convergence Target is the convergence value that has to be reached in order for frame to be finished. If the max. render time is exceeded, the rendering will stop even if the convergence target hasn’t been reached. The Convergence Target is actually capped to 99.99% in the code (you don’t want to render a frame forever, do you?) The Time and Convergence Target arguments are by default initialized from the Render item channels. In short here’s the test to check if one frame has been rendered: - test all the pixels reached min. samples - test if we’ve rendered for a min. time (3 seconds) - test if max. render time has elapsed (Time) - test if convergence has been reached (Convergence Target) If Time is set to 0, only the convergence test will be used.

The perFrame, geoUpdate and first/last command arguments are only used when rendering animation.

If Preview is in the Finished state invoking the iview.render command will not restart the Preview it will just save the pixels to disk.

Preview render, by default, will use the render output filename and format channels if they’re set. The user can override those values by specifying the filename and format on the command line.