I am trying to write a script that will auto setup Mental Ray or the Scan Line renderer with the best setting for an AO map. I have found a script that gives me a good jumping off point but I have hit a stumbling block that I am not sure how to get around. I think my problem is that when trying to set values in the Mental Ray engine via script, my script values look like they are not being passed. Here is the code that I am working with.
-- script for quickly change render settings
test = mental_ray_renderer()
if (( mainRoll != undefined) and ( mainRoll.isdisplayed)) do
(destroyDialog mainRoll ) -- test if dialog exist
fn checkRender nSearch = -- function check if render installed
(
theRenderer = for obj in RendererClass.classes where
(matchPattern (obj as string) pattern:nSearch) -- check if the name in nSearch variable exist
collect obj
if theRenderer.count ==1
then renderers.current = theRenderer[1]()
else
(messageBox "render not installed")
)
rollout mainRoll "ChangeSetting"
(
group "Change Render" -- define change render buttons
(
button butScanline "Scanline" align:#left across:2 width:70 height:20
button butMR "Mental Ray" align:#left width:70 height:20
button butVray "Vray" align:#left across:2 width:70 height:20
button butKrakatoa "Krakatoa" align:#right width:70 height:20
)
on butScanline pressed do
(
varScan = "*Scanline*"
checkRender varScan
)
on butMR pressed do
(
print(test)
varMR = "*mental_ray*"
checkRender varMR
test.glossyreflectionsprecision = .95
print(test.glossyreflectionsprecision)
test.BoxFilterWidth = 8.0
test.BoxFilterHeight = 8.0
test.FinalGatherEnable2 = true
)
on butVray pressed do
(
varVray = "V_Ray_Adv*"
checkRender varVray
)
on butKrakatoa pressed do
(
varKrakat = "*Krakatoa*"
checkRender varKrakat
)
)
createDialog mainRoll 175 450
Right now this code runs but I am pretty sure that it’s not working. The main thing that I do not understand is how to test if using test.“Some Value Here” is working or not because it seams like its not working but its not giving any errors. Any ideas or on what to do or some ideas where to look would be awesome.