So just as a simple test, delete all the tonemapping operators and add a ACES OT and Saturation :
Then in the maxscript editor your code should look like this:
(
Mohammadreza's code first....etc
)
currentOperators = crnToneMapping.GetAllTMOperatorsPlusIDs()
-- it shows: SaturationOperatorPlugin & AcesOtOperatorPlugin
-- so thats currentOperators[1] and currentOperators[2]
-- Change saturation (Operator 1)
cfb = renderers.current.colorMap_pipeline
cfb.colorMappingOperator_saturation = .722
-- Go To Next Operator
cfb = cfb.colorMappingOperator_nextOperator
-- Change AcesOT (Operator 2)
cfb.colorMappingOperator_opacity = .22
Output is:
You can then use his other functions to add new operators, delete them by id etc... I just read through his code to get these variables and work it out from there.
You can also just add one operator at a time then assign the variable cfb and showproperties to see the value you need to change (for example, ill delete them all (for a moment) and add a Tint, from this output we need "colorMappingOperator_tint: color"):
cfb = renderers.current.colorMap_pipeline
showproperties cfb
--prints
ReferenceTarget:TintOperatorPlugin
.colorMappingOperator_nextOperator : maxObject
.colorMappingOperator_id : integer
.colorMappingOperator_enabled : boolean
.colorMappingOperator_tint : color
Once you get all the variables you need you can just convert it to a loop or something like
currentOperators = crnToneMapping.GetAllTMOperatorsPlusIDs()
cfb = renderers.current.colorMap_pipeline
-- Iterate through the currentOperators
for operator in currentOperators do
(
if classOf operator[1] == SaturationOperatorPlugin then
(
cfb.colorMappingOperator_saturation = 0.1 -- Replace with your desired value
)
if classOf operator[1] == AcesOtOperatorPlugin then
(
cfb.colorMappingOperator_opacity = 0.2 -- Replace with your desired value
)
if classOf operator[1] == TintOperatorPlugin then
(
cfb.colorMappingOperator_tint = [255, 0, 0] -- RGB Color
)
-- Iterate to next operator
cfb = cfb.colorMappingOperator_nextOperator
)
Output:
Also, can you show me what it looks like in the unified lister? I'm still running an older version for our current projects