Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
maxscript [2020/08/24 08:38]
rowan.manns
maxscript [2022/05/24 09:09]
maru [Corona Rendering Core]
Line 7: Line 7:
 Adding new functions is very easy, so contact us if you need any. Adding new functions is very easy, so contact us if you need any.
  
-^Function ^Parameters ^description ^+^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. | | ''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. | | ''resumeRender'' | | Resumes the last rendering. Same as clicking "Resume last" button in the Actions tab. |
Line 22: Line 22:
 | ''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. | | ''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. | | ''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 |+| ''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. The command returns the following codes: \\ 0 - Success \\ 1 - Failure - Corona is not selected as the active renderer \\ 2 - Failure - Corona is already rendering \\ 3 - Failure - No valid docked window available |
 | ''stopRender'' | | Stops any render that is currently going on | | ''stopRender'' | | Stops any render that is currently going on |
 | <del>''isRendering''</del> | | <del>Returns true if Corona is currently rendering. Added in version 1.5</del> Removed in version 1.6, replaced with ''getRenderType'' | | <del>''isRendering''</del> | | <del>Returns true if Corona is currently rendering. Added in version 1.5</del> Removed in version 1.6, replaced with ''getRenderType'' |
Line 35: Line 35:
 | ''getVersionBuildType'' | | Returns current Corona version build type formatted as string. I.e. one of "StableRelease", "ReleaseCandidate", and "DailyBuild". 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. | | ''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. |
 +| ''bakeLightMix'' | | Bakes the current LightMix configuration into the scene. This is the same as clicking the corresponding bake button in VFB. Added in version 7. |
 +| ''getScriptsDirectory'' | | Returns a path to a directory where MAXScript scripts bundled with Corona (e.g. Corona Converter or Corona Proxy Exporter) are stored. Added in version 7. |
 +| ''getDefaultRoughnessMode'' | | Returns the default mode for the Corona PhysicalMtl roughness mode, as set in the Corona System Settings. 0 = use roughness, 1 = use glossiness. Added in version 7. |
 +| ''getDefaultIorMode'' | | Returns the default mode for the Corona PhysicalMtl IOR mode, as set in the Corona System Settings. 0 = use IOR, 1 = use Disney Specular. Added in version 7. |
 +| ''showErrorWindow'' | | Shows the Corona Error Window Added in version 8. |
  
 ^ Statistic ID ^ Meaning ^ ^ Statistic ID ^ Meaning ^
Line 42: Line 47:
 | 3 |Average number of rays processed per second| | 3 |Average number of rays processed per second|
 | 4 |Average number of rays processed for each image sample| | 4 |Average number of rays processed for each image sample|
-| 5 |Total render time in miliseconds+| 5 |Total render time in milliseconds
-| 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. |+| 6 |Total time spent in the rendering phase (in milliseconds). 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+)| | 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+)| | 8 |Estimated remaining rendering time (in milliseconds). Returns 0 if no estimate is available. (Corona 2.0+)|
Line 51: Line 56:
 | 12 |Peak virtual memory currently used by the process. (Corona 6.0+)| | 12 |Peak virtual memory currently used by the process. (Corona 6.0+)|
 | 13 |Virtual memory used by the system. (Corona 6.0+)|  | 13 |Virtual memory used by the system. (Corona 6.0+)| 
-| 14 |Scene parsing time. (Corona 6.0+)| +| 14 |Scene parsing time in ms. (Corona 6.0+)|  
 +| 15 |Displacement primitives (Corona 7.0+)|
  
 ====== Corona Proxy API ====== ====== Corona Proxy API ======
Line 61: Line 67:
 | ''fromScene'' | ''<node>proxy <node>source <filename>filename'' | Creates a proxy from scene object ''source'', and saves it to file specified by ''filename'' | | ''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  | | ''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  |
 +| ''duplicateToMesh'' | ''<node>proxy'' | Creates a 3ds Max Editable Mesh from the proxy (does not delete the proxy). Same as clicking the //Duplicate to mesh// button in the UI. |
 +
  
  
Line 73: Line 81:
  
 ====== Corona Scatter API ====== ====== Corona Scatter API ======
 +**Valid until version 8 in which Corona Scatter has been replaced with more advanced Chaos Scatter with its own [[scatter_maxscript|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. 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 ^ ^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.** |+| ''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. | | ''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. | | ''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. |+| ''getModelNode'' | ''<integer>index'' | Returns node of a model object selected by the given index. The node is relevant to last ''update'' call. It returns null if the node got deleted meanwhile. If the index is outside [0, N) interval, where N is the count returned by ''getModelCount'', it returns null too. |
 | ''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. | | ''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. | | ''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. |

Log In