This is an old revision of the document!

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:

There are several published functions that can be called using the CoronaRenderer.CoronaFp interface. You can list them by executing showInterface CoronaRenderer.CoronaFp command. Most functions return an integer, that is zero 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 [DEPRECATED] 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 version 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 [DEPRECATED] Returns current Corona version formatted as a human-readable string. It is still available but will be removed in future versions in favor of getVersionString providing the same string.
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.
getVersionNumber Returns current Corona version encoded as a single comparable 64-bit integer number. Version numbers returned in earlier builds are always lower than version numbers returned in later builds. Added in version 3.
getVersionString Returns current Corona version formatted as a human-readable string. It is suitable to be presented to the user. Added in version 3.
getVersionMajorNumber Returns current Corona version major number. Added in version 3.
getVersionMinorNumber Returns current Corona version minor number. Added in version 3.
getVersionBuildType Returns current Corona version build type formatted as string. I.e. one of “StableRelease”, “ReleaseCandidate”, and “DailyBuild”. Added in version 3.
showListerDialog <integer>tab Opens Corona Lister dialog window. The tab argument determines which tab will be selected when opening the dialog, where 0 means last active tab, 1 means Lights tab and 2 means Scatters tab. Added in version 3.
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 invoked using the CoronaMaterialLibrary.MaterialLibraryFp interface. You can list them by executing 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.
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.

Corona Scatter API

There are several published methods invokable on every CScatter object. You can list them by executing s = CScatter(); showInterfaces s. Look for the ScatterFpInterface interface there. It is available since Corona 3.

Function Parameters description
update <interval>timeInterval <integer>referenceTime Updates scattering of instances for the given non-empty time interval. The specified reference time determines scattering parameters that cannot be interpolated. It is expected to lie in the interval. Returns 0 on success. Returns 1 if the user does not have a valid license. Currently, only 1 time frame long intervals are supported.
clear Clears scattering of instances created by last update call. Can be called to free allocated resources, but maps depending on the scatter object may be evaluated incorrectly then.
getModelCount Returns number of all model objects. These are original objects that get instanced by the scatter object. The count is relevant to last update call.
getModelNode <integer>index Returns node of a model object selected by the given index. If the index is outside [0, N) interval, where N is the count returned by getModelCount, it returns null. The node is relevant to last update call.
getInstanceCount Returns number of instances. All instances scattered throughout the whole time interval specified for last update call are accounted here. For example, if scattering gets updated for 2 time frames long interval and in the first frame get scattered instances A, B, C and in the second frame get scattered instances B and D, it will return 4.
convertInstancesToGeometry <integer>time Converts (duplicates) all instances scattered at the given time to true geometry objects. Expects the time to lie in the interval specified for last update call. Returns 0 on success. Note this may be costly for great number of instances.

Example scripts

CoronaRenderer.CoronaFp.showvfb true

- shows the Corona VFB


- stops current rendering (same as pressing the STOP button in the 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)


- clears all VFB regions (the VFB has to be closed first)

CoronaRenderer.CoronaFp.exportScene @"C:\Corona\myscene.scn" false

- exports the current scene from 3ds max to C:\Corona\ as myscene.scn and does not start rendering it.

CoronaRenderer.CoronaFp.dumpVfb "D:/yourfilename.cxr"

- dumps the current content of the VFB to the specified CXR file.

Log In