Hello!
It seems Arnold's maxscript commands still not documented. I figured out how to check already added AOVs using maxscript, but can't figured out how add it?
Can someone help with this?
p.s. To devs: please make maxscript documentation for MAXtoA!
As far as I know, there's no maxtoa commands. I assume you used some generic maxscript to check the AOVs?
MAXtoA expose properties of AOVs, so we can check it. Something like this:
fn checkArnoldAOVs = ( res = false if renderers.current.AOV_Manager != undefined then -- aovs not added ( for d = 1 to renderers.current.AOV_Manager.Drivers.count do -- aovs count ( if renderers.current.AOV_Manager.Drivers[d].filenameSuffix == "Altus" then ( altusAOVs = #() for a = 1 to renderers.current.AOV_Manager.Drivers[d].aovList.count do ( append altusAOVs renderers.current.AOV_Manager.Drivers[d].aovList[a].name --format "%\n" renderers.current.AOV_Manager.Drivers[d].aovList[a].name ) for i = 1 to altusAOVs.count do ( if \ (findItem altusAOVs "N") >0 and \ (findItem altusAOVs "P") >0 and \ (findItem altusAOVs "diffuse_albedo") >0 and \ (findItem altusAOVs "shadow_matte") >0 and \ (findItem altusAOVs "specular") >0 \ then res = true ) ) ) ) res )
edit: the site does not give the right post a code 😞
Hi @Mike Samoilov thanks! Your code shows how to check the AOVs properties, but how can we add AOVs using MAXScript?
,Hi Mike thanks, your code shows how to check the AOVs properties, but how can we add AOVs using MAXScript?
I don't know. Still no official maxscript support in MAXtoA. 😞
Thank you for looking into it @Mike Samoilov 😉
I posted Idea about maxscript support in MAXtoA, please vote :
https://forums.autodesk.com/t5/3ds-max-ideas/arnold-maxscript/idi-p/8318742
Getting very close to MAXScripting the AOVs
I found that on top of querying the name of an AOV (if you currently have one) running this syntax:
--
renderers.current.AOV_Manager.drivers[1].aovList[1].name
--
If we say the AOV is a coat pass then "coat" is returned.
In fact, by assigning the correct string you are actually changing the AOV itself, so:
--
renderers.current.AOV_Manager.drivers[1].aovList[1].name = "specular"
--
You haven't just changed the name to specular, you are now using the specular AOV.
--
renderers.current.AOV_Manager.drivers[1].aovList is the array so you can append copies of the current aov (duplicating an aov) and then change their names to any pass you want!
--
Now I just need to figure how to append the first ReferenceTarget:ArnoldAOV and ReferenceTarget:ArnoldEXRDriver and we can quickly add multiple AOV's with scripts.
Here is 'some' AOV automation:
https://www.youtube.com/watch?v=rJox4jZn-gI
https://pastebin.com/5TZG3F9Q
Add new AOV: -- The name becomes the AOV type, so make sure to get it right
AOVmgr = renderers.current.AOV_manager
append (AOVmgr.drivers) (ArnoldEXRDriver filenameSuffix:"MyAOVs")
append (AOVmgr.drivers[1].aovList) (ArnoldAOV name:"diffuse")
Just a regular append function using ArnoldEXRDriver() and ArnoldAOV() to create them.
Example #2: -- This one also sets the data type and filter type
append (AOVmgr.drivers[1].aovList) (ArnoldAOV name:"N" data:"vector" filter:"mitnet_filter")