Chaos Corona for 3ds Max > [Max] Resolved Bugs

C8 - VFB tonemapping parameters have been hidden from Maxscripting?

(1/5) > >>

DPS:
Hi

For years I've been using a render pass manager called Vexus.

Upon update to Corona 8 - the Frame buffer parameters are no longer being passed from Vexus to the VFB.

I was just talking to the developer who was keen to see if he can update his software to support C8, but it appears that these parameters are no longer available?

Have they been renamed?

Thanks

Frood:

--- Quote from: DPS on 2022-05-25, 01:21:41 ---Have they been renamed?

--- End quote ---

Not just renamed. The new, more flexible tone mapping pipeline is a completely different approach. Of course this is reflected in script access as well.

There is no documentation currently, but the key to open the script door to the post processing settings is "renderers.current.colorMap_pipeline"

As an example, this one iterates through the pipeline and lists all operators with their properties:


--- Code: ---op=renderers.current.colorMap_pipeline
while op!=undefined do (
Print ("Operator found: " + classof op as string)
show op
op=op.colorMappingOperator_nextOperator
)

--- End code ---


Everything else can be quite easily guessed by inspecting the objects.


Good Luck



DPS:
Thanks I've passed that on.

DPS:
Would anyone mind posting a couple of examples of how I might edit these parameters via maxscript?

I can figure out which I need to edit but I'm not a scripter.

maru:
Sharing some info from a related support case:

When you call showProperties renderers.current, you will notice that there is a renderers.current.colorMap_pipeline property, which is of type MaxObject.

Also calling classOf (getProperty renderers.current "colorMap_pipeline") returns UndefinedClass.

While the old tone mapping had a fixed set of parameters that could be accessed directly like using the provided script, the new tone mapping works as follows - the main paramblock (renderers.current) holds the last tone mapping operator as getProperty renderers.current "colorMap.pipeline" and each operator holds the next operator (in the UI it's the one above) like getProperty (getProperty renderers.current "colorMap.pipeline") "colorMappingOperator.nextOperator" - from these, we can get particular parameter values as getProperty (getProperty renderers.current "colorMap.pipeline") "colorMappingOperator.opacity"

The UndefinedClass is because the pipeline is saved only once a parameter is changed (we wanted to avoid having changes in the scene without any "real" user changes, but it can be a bit problematic), after changing the parameter, the command posted above returns correctly AcesOtOperatorPlugin - ! the legacy scenes have the pipeline right after opening, since there is the conversion of legacy parameters, so the command works without any additional changes of parameters

Here is the paramblock with the parameter names and types, it should be everything that is necessary to set the parameters from MAXScript:

Main paramblock (renderers.current):

T_BOOL, PARAM_COLORMAP_ENABLED, "colorMap.enabled", true
T_FLOAT, PARAM_COLORMAP_GAMMA, "colorMap.gamma", 2.2f, 0.1f, 10.f
T_STR, PARAM_COLORMAP_PIPELINE, "colorMap.pipeline", L""

Operator paramblocks:

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"),

Update: In Corona 8 non-hotfix:
The tone mapping stack cannot be created from scratch using maxscript, or controlled using maxscript, unless you perform some manual intervention from the user interface first (e.g. create some new operators, change their values by hand). For example, if you create a fresh new scene and it already has some existing tone mapping stack, you will not be able to adjust its values using maxscript unless you change some of the values manually first. There are some technical reasons for this, and we did not predict that it could cause some issues to our users.

In Corona 8 Hotfix 1 and newer this part no longer applies and it should work fine out of the box.


- Adding operators: here is a basic example how to add two Contrast operators (currently, there is a limitation that the operators need to have a unique ID assigned manually, you'll see in the code)
op = ContrastOperatorPlugin()
setProperty op "colorMappingOperator.id" 1
setProperty renderers.current "colorMap.pipeline" op
op2 = ContrastOperatorPlugin()
setProperty op "colorMappingOperator.nextOperator" op2
setProperty renderers.current "colorMap.pipeline" op

The operators' names are

ContrastOperatorPlugin
CurvesOperatorPlugin
SimpleExposureOperatorPlugin
PhotographicExposureOperatorPlugin
FilmicOperatorPlugin
AdvancedFilmicOperatorPlugin
GreenMagentaTintOperatorPlugin
LutOperatorPlugin
ReinhardOperatorPlugin
SaturationOperatorPlugin
TintOperatorPlugin
ToneCurveOperatorPlugin
VignetteOperatorPlugin
WhiteBalanceOperatorPlugin
AcesOtOperatorPlugin

- Settings some preset and saving old values: in the script, you can store the old pipeline like getProperty renderers.current "colorMap.pipeline" and set it back after you are finished

This could be used to create the pipeline with the parameters assigned to the operators, so you don't have to index to the pipeline later.

---

In the latest V9 daily build (and this will be also a part of the V8 hotfix) we have included a fix to the "you need to create tone mapping manually or make some manual change in order for scripts to work":

--- Quote ---Tone mapping pipeline is now created in every scene, without need to interact with it first, allowing users to access it from MAXScript
--- End quote ---
Link: https://forum.corona-renderer.com/index.php?topic=36810.0

---

Feel free to ask some further questions, however I would definitely need to get in touch with our developers, so getting an answer may take time. :)
We should also update our maxscript documentation at https://wiki.corona-renderer.com/maxscript at some point.



Navigation

[0] Message Index

[#] Next page

Go to full version