Corona 10 maxscript

Hi, how to change value in simple exposure in tone mappiing corona camera using maxscript?

Hi,

You can have a look at the maxscript documentation page:

under Corona 8 New Tone Mapping Pipeline examples.

Specifically, if you want to set a operator to have concrete values, and given it is the only one from that type, you first search for it in the tone mapping, then set the property for it:

pipeline = getProperty renderers.current "colorMap.pipeline"
while pipeline != undefined do
(
    operatorClass = classOf pipeline
    if operatorClass == SimpleExposureOperatorPlugin then exit
    pipeline = getProperty pipeline "colorMappingOperator.nextOperator"
)
if pipeline != undefined then setProperty pipeline "colorMappingOperator.simpleExposure" 1.0

Simple exposure is usually the first in the stack (by default) and the only one, so the code above should work for you and set Simple Exposure to 1.0 - change the value according to your needs.

… and if you don’t like that getProperty and setProperty stuff (like me), you can to it as well this way:


-- returns undefined if no such operator in stack
fn setSimpleExposure exposurevalue enabled:true = (
	pipeline = renderers.current.colorMap_pipeline
	while pipeline != undefined do (
		if classof pipeline == SimpleExposureOperatorPlugin then exit
		pipeline = pipeline.colorMappingOperator_nextOperator
	)
	if pipeline != undefined then (
		pipeline.colorMappingOperator_simpleExposure = exposurevalue
 		pipeline.colorMappingOperator_enabled = enabled
	)
)

-- example calls:
setSimpleExposure 6

setSimpleExposure 2 enabled:false

if (setSimpleExposure 0.12345 enabled:true)==undefined do (
	format "No simple exposure operator in stack.\n"
)

Good Luck

Thanks for the detailed answer.