Both sides previous revision
Previous revision
Next revision
|
Previous revision
Last revision
Both sides next revision
|
maxscript [2022/04/12 17:39] mike [Corona Scatter API] |
maxscript [2022/06/08 09:42] maru [Example scripts] |
| ''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'' | |
<code>CProxy.ProxyFp.duplicateToMesh $my_proxy</code> - converts my_proxy back to mesh.\\ | <code>CProxy.ProxyFp.duplicateToMesh $my_proxy</code> - converts my_proxy back to mesh.\\ |
\\ | \\ |
| \\ |
| ===== Corona 8 New Tone Mapping Pipeline Examples ===== |
| |
| Getting last operator:\\ |
| <code>getProperty renderers.current "colorMap.pipeline"</code> |
| \\ |
| Each operator holds the next operator (in the UI it's the one above): |
| <code>getProperty (getProperty renderers.current "colorMap.pipeline") "colorMappingOperator.nextOperator"</code> |
| \\ |
| The particular parameter values can be obtained as: |
| <code>getProperty (getProperty renderers.current "colorMap.pipeline") "colorMappingOperator.opacity"</code> |
| \\ |
| Looking for specific operator using name & setting of property: |
| \\ |
| <code> |
| pipeline = getProperty renderers.current "colorMap.pipeline" |
| while pipeline != undefined do |
| ( |
| operatorClass = classOf pipeline |
| if operatorClass == WhiteBalanceOperatorPlugin then exit |
| pipeline = getProperty pipeline "colorMappingOperator.nextOperator" |
| ) |
| if pipeline != undefined then setProperty pipeline "colorMappingOperator.colorTemperature" 8000 |
| </code> |
| \\ |
| - the previous code only sets the value to the first operator it finds, in case it is necessary to have a more complex pipeline with multiple operators |
| of the same type, it is easier to create it from scratch and set the parameters right away, see below |
| \\ |
| \\ |
| Adding of operator (it is necessary to set unique ID) - replaces current pipeline with single contrast operator: |
| <code> |
| op = ContrastOperatorPlugin() |
| setProperty op "colorMappingOperator.id" 1 |
| setProperty op "colorMappingOperator.enabled" true |
| setProperty op "colorMappingOperator.contrast" 0.4 |
| setProperty renderers.current "colorMap.pipeline" op |
| </code> |
| \\ |
| Building own pipeline with multiple operators: |
| <code> |
| op = ContrastOperatorPlugin() |
| setProperty op "colorMappingOperator.id" 1 |
| setProperty renderers.current "colorMap.pipeline" op |
| op2 = GreenMagentaTintOperatorPlugin() |
| setProperty op2 "colorMappingOperator.id" 2 |
| setProperty op "colorMappingOperator.nextOperator" op2 |
| </code> |
| \\ |
| All operators: |
| <code> |
| ContrastOperatorPlugin |
| CurvesOperatorPlugin |
| SimpleExposureOperatorPlugin |
| PhotographicExposureOperatorPlugin |
| FilmicOperatorPlugin |
| AdvancedFilmicOperatorPlugin |
| GreenMagentaTintOperatorPlugin |
| LutOperatorPlugin |
| ReinhardOperatorPlugin |
| SaturationOperatorPlugin |
| TintOperatorPlugin |
| ToneCurveOperatorPlugin |
| VignetteOperatorPlugin |
| WhiteBalanceOperatorPlugin |
| AcesOtOperatorPlugin |
| </code> |
| \\ |
| (The following are for internal purposes, no need to add them manually or change their values) |
| <code> |
| LinearToSrgbOperatorPlugin |
| SrgbToLinearOperatorPlugin |
| IdentityOperatorPlugin (assigned when user deletes all items from UI) |
| </code> |
| \\ |
| \\ |
| All parameters: |
| <code> |
| Main paramblock (renderers.current): |
| T_BOOL, PARAM_COLORMAP_ENABLED, "colorMap.enabled" |
| T_FLOAT, PARAM_COLORMAP_GAMMA, "colorMap.gamma" |
| TYPE_REFTARG, PARAM_COLORMAP_PIPELINE, "colorMap.pipeline" |
| </code> |
| \\ |
| Operator paramblocks: |
| <code> |
| ACES |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_ACES_OT_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_ACES_OT_OP_OPACITY, TYPE_FLOAT, _T("colorMappingOperator.opacity"), |
| |
| CONTRAST |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_CONTRAST_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_CONTRAST_OP_CONTRAST, TYPE_FLOAT, _T("colorMappingOperator.contrast"), |
| |
| CURVES |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_CURVES_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_CURVES_OP_MASTER_NODES, TYPE_POINT3_TAB, _T("colorMappingOperator.master.nodes"), |
| PARAM_CURVES_OP_MASTER_INTERPOL, TYPE_INT, _T("colorMappingOperator.master.interpol"), |
| PARAM_CURVES_OP_RED_NODES, TYPE_POINT3_TAB, _T("colorMappingOperator.r.nodes"), |
| PARAM_CURVES_OP_RED_INTERPOL, TYPE_INT, _T("colorMappingOperator.r.interpol"), |
| PARAM_CURVES_OP_GREEN_NODES, TYPE_POINT3_TAB, _T("colorMappingOperator.g.nodes"), |
| PARAM_CURVES_OP_GREEN_INTERPOL, TYPE_INT, _T("colorMappingOperator.g.interpol"), |
| PARAM_CURVES_OP_BLUE_NODES, TYPE_POINT3_TAB, _T("colorMappingOperator.b.nodes"), |
| PARAM_CURVES_OP_BLUE_INTERPOL, TYPE_INT, _T("colorMappingOperator.b.interpol"), |
| |
| FILMIC |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_FILMIC_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_FILMIC_OP_HIGHLIGHTS_COMPRESSION, TYPE_FLOAT, _T("colorMappingOperator.highlightCompression"), |
| PARAM_FILMIC_OP_RICH_SHADOWS, TYPE_FLOAT, _T("colorMappingOperator.richShadows"), |
| |
| ADV FILMIC |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_FILMIC_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_ADVANCED_FILMIC_OP_TOE_STRENGTH, TYPE_FLOAT, _T("colorMappingOperator.toeStrength"), |
| PARAM_ADVANCED_FILMIC_OP_TOE_LENGTH, TYPE_FLOAT, _T("colorMappingOperator.toeLength"), |
| PARAM_ADVANCED_FILMIC_OP_SHOULDER_STRENGTH, TYPE_FLOAT, _T("colorMappingOperator.shoulderStrength"), |
| PARAM_ADVANCED_FILMIC_OP_SHOULDER_LENGTH, TYPE_FLOAT, _T("colorMappingOperator.shoulderLength"), |
| PARAM_ADVANCED_FILMIC_OP_SHOULDER_ANGLE, TYPE_FLOAT, _T("colorMappingOperator.shoulderAngle"), |
| |
| GM TINT |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_GMTINT_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_GMTINT_OP_GREEN_MAGENTA_TINT, TYPE_FLOAT, _T("colorMappingOperator.greenMagentaTint"), |
| |
| LUT |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_LUT_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_LUT_OP_PATH, TYPE_FILENAME, _T("colorMappingOperator.path"), |
| PARAM_LUT_OP_OPACITY, TYPE_FLOAT, _T("colorMappingOperator.opacity"), |
| PARAM_LUT_OP_LOGARITHMIC, TYPE_BOOL, _T("colorMappingOperator.logarithmic"), |
| |
| PHOTOGRAPHIC EXPOSURE |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_EXPOSURE_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| |
| REINHARD |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_REINHARD_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_REINHARD_OP_HIGHLIGHT_COMPRESSION, TYPE_FLOAT, _T("colorMappingOperator.highlightCompression"), |
| |
| SATURATION |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_SATURATION_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_SATURATION_OP_SATURATION, TYPE_FLOAT, _T("colorMappingOperator.saturation"), |
| |
| SIMPLE EXPOSURE |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_EXPOSURE_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_EXPOSURE_OP_SIMPLE_EXPOSURE, TYPE_FLOAT,_T("colorMappingOperator.simpleExposure"), |
| |
| TINT |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_TINT_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_TINT_OP_TINT, TYPE_RGBA, _T("colorMappingOperator.tint"), |
| |
| TONE CURVE |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_TONE_CURVE_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_TONE_CURVE_OP_HIGHLIGHTS, TYPE_FLOAT, _T("colorMappingOperator.highlights"), |
| PARAM_TONE_CURVE_OP_LIGHTS, TYPE_FLOAT, _T("colorMappingOperator.lights"), |
| PARAM_TONE_CURVE_OP_DARKS, TYPE_FLOAT, _T("colorMappingOperator.darks"), |
| PARAM_TONE_CURVE_OP_SHADOWS, TYPE_FLOAT, _T("colorMappingOperator.shadows"), |
| |
| VIGNETTE |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_VIGNETTE_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_VIGNETTE_OP_INTENSITY, TYPE_FLOAT, _T("colorMappingOperator.intensity"), |
| PARAM_VIGNETTE_OP_FALLOFF, TYPE_FLOAT, _T("colorMappingOperator.falloff"), |
| |
| WHITE BALANCE |
| PARAM_COLOR_MAP_PREDECESSOR, TYPE_REFTARG, _T("colorMappingOperator.nextOperator"), |
| PARAM_WHITE_BALANCE_OP_ENABLED, TYPE_BOOL, _T("colorMappingOperator.enabled"), |
| PARAM_WHITE_BALANCE_OP_COLOR_TEMPERATURE, TYPE_FLOAT, _T("colorMappingOperator.colorTemperature"), |
| </code> |