Editing specific bitmap offset, output and other proproties
Heya
I've went over this for past 2 hours with not much luck. The closes I was is when I found some of Bobo's suggestions on forum. In any case if some1 could help me out that would be amazing.
I'm trying to access a specific bitmap that is located in
Mental ray >
Environment map > Environment/Background Switcher > Environment / Reflections> Bitmap- offset, Output amount and other parameters.
I tried by going directly :
sceneMaterials["IBL_Map"].Properties.reference.output.output_amount = 5.53
But that errors out. I also tried to somehow make this line usable
rootScene[#SME][#View1][#IBL_Map__IBL_Basic_Studio_hdr].Properties.reference.coords.U_Offset = 0.05
But that dont work either.
How can I follow up hierarchy of an node and get to that specific bitmap? I know that going by name search wont work as I can have more than 1 bitmap with that name. But maybe it could work not sure.
I want to hock up a spinner for easy control of my IBL. Does any1 have any idea how to access that parameter?
Regards
Dariusz
Comments
Try to see here for more
Try to see here for more idea:
http://www.scriptspot.com/forums/3ds-max/general-scripting/refresh-objec...
...
Amazing work! Thanks for sharing :)
Ok so I hit another wall
Ok so I hit another wall :-)
When I restart max and start from fresh scene I'm missing few nodes and my script crashes ehh
Anyway can some suggest a fix for missing values? - The script wont start because the value for spinner dont exist because the envi node don't exist.
oki oki
I see you have Create button... (so you want to use script to create and edit material...)
Than your script should check first if material "IBL_Main" exist... you can use if map != undefined then .... or try()catch() to check it. If material doesn't exist script will turn off spinner or more rollout items. See in code below.
When button Create "IBL_Main" is pressed - script will create material and turn on spinner.
I think it can look this way:
So first I would declare all items in rollout with default values, than use "on open..." if map exist it load spiner value otherwise it will turn off spinner.
Hope it helps.
Cheers,
Pixamoon
Hey mate Thanks I cant
Hey mate
Thanks I cant believe I mist it ! I had to reference the switch shader and then I could've sub reverence the bitmap parameters as you've showed me. Oh dear thanks!!!!
no prob
no prob man :) Happy I could help!
Pixamoon
mr Enviroment/Background Switcher properties
Hey,
If you do:
print (getpropnames scenematerials["IBL_Map"])
you will get properies names:
#Background
#environment
#background_connected
#background_shader
#background_paramName
#environment_connected
#environment_shader
#environment_paramName
#TheList
#Shader_Version
Bitmap holders are: background_shader and environment_shader
so the code can look:
scenematerials["IBL_Map"].background_shader.output.output_amount = 5.53
or
sceneMaterials["IBL_Map"].background_shader.coords.U_Offset = 0.05
Hope this helps,
Pixamoon