Corona Rendering Core

Most render settings can be set using the Maxscript. You can list the settings using show renderers.current command. They are also listed here: https://corona-renderer.com/doc/

There are several published functions that can be called using the CoronaRenderer.CoronaFp interface. You can list them using showInterface CoronaRenderer.CoronaFp. Most functions return an integer, that is 0 on success, and nonzero on failure.

Adding new functions is very easy, so contact us if you need any.

Function Parameters description
showVfb <boolean>show Displays or hides the VFB window. When the argument is true, calling it is the same as clicking “Show VFB” button in the UI.
resumeRender Resumes the last rendering. Same as clicking “Resume last” button in the Actions tab.
loadAndResume <string>filename Same as resumeRender, but loads the last render from a given previously dumped EXR file.
dumpVfb <string>filename Saves the current VFB contents to given file so it can be resumed later using loadAndResume.
setDisplayedChannel <integer>channel If using Corona VFB, it sets the currently displayed channel. 0 is beauty channel, 1 is alpha, and higher values are extra render passes.
getVfbContent <integer>channel <boolean>toneMapping <boolean>renderStamp Returns bitmap with one render channel from the current framebuffer. Optionally can include tone mapping and renderstamp. Does not return integer code, but directly the bitmap (or null if the call failed).
resetSettings Resets the render settings to default values. Same as clicking “Reset Settings” button in Actions tab.
renderElements <boolean>useAntialiasing Renders only the extra render elements, without main shading (so it is much faster). Some elements depend on the shading and will not show when using this option. Has a parameter to enable/disable antialiasing. Same as clicking “Render only elements”, or “Render only elements (without AA) in the Actions tab. Removed in 1.5 and replaced with regular render with Render only elements checkbox enabled.
exportScene <string>filename <bool>renderImmediately Exports the scene to given file so it can be loaded in the Corona standalone application. If renderImmediately is true, then the application will also look for the standalone executable and try to run it immediately.
getCoronaVersion Returns a string with the Corona version name and build timestamp, for example Daily build pre-1.0, build timestamp: Thu Dec 11 19:14:30 2014.
getStatistic <int>statisticId Returns one of the statistics from the table below, in double precision floating point format. Returns results from the currently active render or last render. If no render occured yet in the session, or 3dsmax was reset/renderer changed after the last render, then the results are undefined.
getBlackbodyColor <float>temperature Returns the color of a black body emitter with specified temperature (given in Kelvins). The returned value is in HDR linear sRGB color space (without gamma correction). The result is normalized - the brightest color channel is always equal to 1, and the absolute brightness of the color does not correspond to the reality (only ratio between different color channels is meaningful). Input color must be in range 1000-99000K
loadDrIpFile <string>filename Loads a text file containing 1 IP per line into the DR nodes list. Same as clicking on the button “From file…” in UI and selecting the provided file.
startInteractive Starts the interactive rendering in Corona pop-out WX VFB.
startInteractiveDocked Starts the interactive rendering in the Corona viewport-docked VFB. The viewport (extended view) needs to be present and inactive for this method to work
stopRender Stops any render that is currently going on
isRendering Returns true if Corona is currently rendering. Added in version 1.5 Removed in version 1.6, replaced with getRenderType
reparseInteractive While in interactive rendering session, reparses the entire scene and restarts interactive rendering. Added in version 1.5
getRenderType Returns 0 if there is currently no render going on, 1 for offline (non-interactive rendering), 2 for interactive rendering with docked VFB, and 3 for interactive rendering in regular Corona VFB. Added in version 1.6.
saveAllElements <string>filename Saves all render elements to specified location - same as when using the Corona VFB button functionality. The provided parameter is the filename of beauty channel, other filenames are derived from it.
showLightMixSetupDialog Shows the LightMix setup dialog, if not currently rendering. Added in version 2.
Statistic ID Meaning
0 Number of elapsed passes
1 Number of primitives in the scene, not counting instances
2 Number of primitives in the scene with instancing
3 Average number of rays processed per second
4 Average number of rays processed for each image sample
5 Total render time in miliseconds
6 Total time spent in the rendering phase (in miliseconds). This time is used for deciding when to stop progressive rendering with a time limit set.
7 Estimated noise amount in the picture, in percents. Returns 0 if no estimate is available. (Corona 1.7+)
8 Estimated remaining rendering time (in milliseconds). Returns 0 if no estimate is available. (Corona 2.0+)

Corona Proxy API

To invoke a method on proxy object [proxy], use CProxy.ProxyFp.[method_name] [proxy] [optional further args]

Function Parameters description
getOriginalObjectName <node>proxy Returns string containing the name of the original object from which the proxy was created.
getOriginalMaterialName <node>proxy Returns string containing the name of material of the original object from which the proxy was created.
fromScene <node>proxy <node>source <filename>filename Creates a proxy from scene object source, and saves it to file specified by filename
fromSceneAnimated <node>proxy <node>source <filename>filename <integer>frameFrom <integer>frameTo <integer>pointCloudSize <integer>samplesPerFrame Same as the other fromScene, but allows to specify additional parameters - animation range (frameFrom - frameTo), size of viewport display point cloud to precompute and store in the file, and number of motion blur samples to take

Corona Material Library API

There are several published functions that can be called using the CoronaMaterialLibrary.MaterialLibraryFp interface. You can list them by calling showInterface CoronaMaterialLibrary.MaterialLibraryFp.

Function Parameters description
isSupported [DEPRECATED] Returns TRUE if the library is supported by the running 3ds Max version. Returns FALSE otherwise. Material library is supported in every 3ds Max version except for 2012. This function is available only in Corona 1.7. It will be removed in newer versions of Corona.
isInstalled Returns TRUE if the library is currently installed. Returns FALSE otherwise (user de-selected it during Corona installation).
showBrowserIfPossible <boolean>show Displays or hides the browser window for the library, if possible. Returns 0 if it has succeeded, non-zero if it has failed.

Example scripts

CoronaRenderer.CoronaFp.showvfb true - shows the Corona VFB

renderers.current.system_vfbRegions = #([1280,720,0], [0,0,0], [1280,720,0], [10,20,0], [100,200,0], [0,0,0]) - draws a render region in the VFB (we are assuming that the output resolution is 1280×720)


Log In