How to optimize the activation of Arnold Aovs using MEL or Python script? Not to do it manually every time? PS: I apologize for my English, this is my non-native language
I make this:
global proc add_aov(int $number, string $passname, int $data, string $filter)
createNode aiAOVFilter -n "aiAOVFilter1";
setAttr ".ai_translator" -type "string" $filter;
createNode aiAOV -n ("aiAOV_"+$passname);
setAttr ".aovn" -type "string" $passname;
setAttr ".aovt" $data;
connectAttr defaultArnoldDriver.message ("aiAOV_"+$passname+".outputs.driver");
connectAttr aiAOVFilter1.message ("aiAOV_"+$passname+".outputs.filter");
connectAttr ("aiAOV_"+$passname+".message") defaultArnoldRenderOptions.aovList[$number];
add_aov(0, "direct_diffuse", 5, "gaussian");
Not that elegant but it works.
import maya.cmds as cmds import mtoa.aovs as aovs aovs.AOVInterface().addAOV("Object_ID") UtiD = cmds.createNode("aiUtility" , name="aiUtility_ID") <br> cmds.setAttr('aiUtility_ID.shadeMode' , 2) cmds.setAttr('aiUtility_ID.colorMode' , 21) cmds.connectAttr('aiUtility_ID.outColor' , 'aiAOV_Object_ID.defaultValue')
Thats a good starting point.
Id like to create a custom AOV with code like you created the beauty above.
In the end it should be a one click ID pass.
Here's something to get you started. But be warned, there's no API. This is just using the code that MtoA uses to build the AOV user interface.
import maya.cmds as cmds import mtoa.aovs as aovs aovs.AOVInterface().addAOV('beauty' )
Why not use Render Setup to import/export the AOVs?
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.
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.
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.
2 People are following this question.