Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Charlie Nicols on 2023-06-12, 17:55:47

Title: [Solved] Help: Open tone mapping settings editor from script
Post by: Charlie Nicols on 2023-06-12, 17:55:47
Does anybody know if it is possible to open a camera's tone mapping settings editor from maxscript or a macro?

This button:
(https://i.imgur.com/hta3byI.png)

Thanks!
Title: Re: Help: Open tone mapping settings editor from script
Post by: Frood on 2023-06-12, 22:04:22
Hi,

Does anybody know if it is possible to open a camera's tone mapping settings editor from maxscript or a macro?


Not conveniently, but you can get a reference to the UI and let windows press the button. Example macro:

Code: [Select]
macroScript OpenCCamToneMapping
category:"# Scripts"
toolTip:"Opens tone mapping edit window of current Corona camera."
icon: #("Systems",2)

(

on isEnabled do (
return ((classof (viewport.getCamera())==CoronaCam))
)

on execute do (
max modify mode
select (viewport.getCamera())
TMButton=windows.getChildHWND (windows.getChildHWND #max ((viewport.getCamera()).name))[7] "Edit..."         
windows.sendMessage TMButton[1] 0x201 0 0 -- LMB down
windows.sendMessage TMButton[1] 0x202 0 0 -- LMB up
)
)


Coding like this it is crap, but it works.


Good Luck



Title: Re: Help: Open tone mapping settings editor from script
Post by: Charlie Nicols on 2023-06-13, 11:09:34
Thank you so much, that has worked great!

Had to change it a little to get it to work with my python script. If anyone's curious:
Code: [Select]
from pymxs import runtime as rt
parent = rt.windows.getChildHWND(rt.name("max"), (rt.viewport.getCamera().name))
tm_btn = rt.windows.getChildHWND(parent[7], "Edit...")

Thanks again, I really appreciate it!