question

Mike Samoylov avatar image
Mike Samoylov asked ·

Add AOVs through Maxscript

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!

aovs
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Lucas Milner avatar image
Lucas Milner answered ·
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Lucas Milner avatar image
Lucas Milner answered ·

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.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mike Samoylov avatar image
Mike Samoylov answered ·

I posted Idea about maxscript support in MAXtoA, please vote :

https://forums.autodesk.com/t5/3ds-max-ideas/arnold-maxscript/idi-p/8318742

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Lucas Milner avatar image
Lucas Milner answered ·

Thank you for looking into it @Mike Samoilov ;)

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mike Samoylov avatar image
Mike Samoylov answered ·

I don't know. Still no official maxscript support in MAXtoA. :(

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Lucas Milner avatar image
Lucas Milner answered ·

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?

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mike Samoylov avatar image
Mike Samoylov answered ·

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 :(

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

As far as I know, there's no maxtoa commands. I assume you used some generic maxscript to check the AOVs?

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.