Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python AOV's shaders

8 REPLIES 8
Reply
Message 1 of 9
fabriceQ224F
404 Views, 8 Replies

Python AOV's shaders

Hi,

Is there a way to extract shader name from the AOV node with Python? I'd like to get 'cryptomatte' when I know AOV's node name ('crypto_asset' for example). I tried a listAttr on that AOV's node name but couldn't find any one related to the shader name.

Thank you!


Tags (2)
Labels (2)
8 REPLIES 8
Message 2 of 9

MtoA automatically adds the cryptomatte aov shader when it sees the cryptomatte node (because the cryptomatte node has the aov_shader TRUE metadata in plug-ins\mtoa.mtd)

The shader name is automatically generated.



// Stephen Blair
// Arnold Renderer Support
Message 3 of 9
fabriceQ224F
in reply to: fabriceQ224F

Thank you Stephen. But what I'm trying to do is to find the name of the shader connected to an AOV (and, BTW, not especially cryptomattes). So, I have a node's name ('crypto_asset') and I'd like to find the shader called 'cryptomatte' that is connected to it...

Message 4 of 9


For other AOVs, MtoA inserts an aov write node.

So for example, if you create an AOV named "ao" and assign an aiAmbientOcclusion shader to it, then when MtoA translates the scene, MtoA inserts an aov_write_rgba node.

The node is named defaultArnoldRenderOptions/aov_write_rgba_ao

So if you know the type and name of the AOV, you could build the shader name.





// Stephen Blair
// Arnold Renderer Support
Message 5 of 9

Sorry, I made a simple scene with a sphere, an area light and an AO AOV node, but I can't find that aov_write_rgba_ao node... Can we find this in the Outliner? Is it only created during render time and then deleted?
Message 6 of 9

That node never exists in Maya. It exists only in the data that MtoA sends to Arnold.



// Stephen Blair
// Arnold Renderer Support
Message 7 of 9
fabriceQ224F
in reply to: fabriceQ224F

Ok. Sorry Stephen but I'm a bit lost then, there's no real documentation about Python commands for managing MtoA... How can we concretely ask aov_write_rgba node to give us its shader's name thanks to Python?

Message 8 of 9

You cannot get the name from the Maya scene, or from MtoA. MtoA creates the node and names it when MtoA translates the Maya scene to an Arnold scene. And there's no hooks/callbacks for the translation process that would give you the new node names.


// Stephen Blair
// Arnold Renderer Support
Message 9 of 9

Well... Ok thank you, I'll do it the dirty way then... List source connections to aov's defaultValue attribute, this should give me the shader node's name.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report