Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: aaouviz on 2019-05-07, 06:57:38
-
Hi All,
I'm a total noob when it comes to scripting (or anything advanced in 3ds max, tbh)... So apologies for the query
I'm wondering how I might go about either finding or somehow creating a script that when activated toggles (either on or off) the Corona Global Volume Material.
I've recently started using Pulze scene manager (from half a days usage I can recommend, despite 1 crash). In some views I'd like the scene to have fog, other scenes I'd like it off. I don't think Pulze has the ability to toggle this option other than saving and loading render settings or - as I'm hoping to do - with a script.
Any tips or pointers much appreciated!
-
First assign a variable to the current renderer to easily access it:
global ren = renderers.current
Then you can list all of the properties of any Max object:
showProperties ren
Then you can search for a key word to find the property you want to change, for example searching for "volume" Got me these:
.globalVolumeMtl (enviro_globalVolumeMaterial) : material
.globalVolumeMtl_use (enviro_useGlobalVolumeMaterial) : boolean
It's the second one you need, so to enable to fog, you just need:
ren.globalVolumeMtl_use = true
-
Thanks mate. The script works an absolute treat! (Can't get Pulze to recognise it though, sadly)
Thanks again
-
Hi Njen,
How about if I want to toggle between Path Tracing and UHD Cache in the render settings? Think this is possible?
Thanks in advance for any tips! :D
-
Yup this is quite easy to do, in fact, I have already written something like this for my own suite of tools. I chopped out the relevant code that you can use. Feel free to add this rollout to what ever custom tool suite you are developing:
rollout ro_lightControl "Light Control"
(
button btn_lcRendererSetupUHDCache "Renderer Setup: UHD Cache" width:146 height:18 pos:[3,10]
button btn_lcRendererSetupPathTracing "Renderer Setup: Path Tracing" width:147 height:18 pos:[151,10]
fn defaultRenderSettings =
(
set animate off
renderSceneDialog.close()
renderers.current = CoronaRenderer()
global ren = renderers.current
--showproperties ren
-- Set up any other custom general settings you wish here.
-- For example, I like to turn off 'Auto Bump', so I added this line:
--ren.geometry_displace_useAutoBump = false
)
on btn_lcRendererSetupUHDCache pressed do
(
defaultRenderSettings()
ren.shading_secondarySolver = 4
ren.gi_uhdcache_preset = 1
)
on btn_lcRendererSetupPathTracing pressed do
(
defaultRenderSettings()
ren.shading_secondarySolver = 1
)
)