Where can I find some examples about procedural_viewport, the new function of Procedrual API, please?
Solved! Go to Solution.
Solved by adrien.herubel. Go to Solution.
We currently don't have public examples of this new API, but here is a short sample showing how to use it to create a bounding box viewport representation in a 3rd party procedural. This viewport representation should be displayed automatically in the DCC viewport, once the procedural is added in the scene.
procedural_viewport { if (mode == AI_PROC_BOXES) { AtNode* bbox_node = AiNode(universe, "box", "bbox0"); AiNodeSetVec(bbox_node, "min", -5, -5, -5); AiNodeSetVec(bbox_node, "max", 5, 5, 5); } return AI_SUCCESS; }
Thank you Adrien, I guess this function only works in viewport of Arnold mode, instead of VP2, in Maya.
In the Arnold viewport, nothing is needed to display procedurals as they are part of the Arnold scene. The procedural_viewport API is needed to display the procedural in the DCC's own viewport, for example VP2 in Maya.
Hi, @Adrien Herubel. I met a problem when trying a simple procedural with the example of drawing code your posted. After creating the procedural node from Arnold->custom procedrual successfully, I got nothing in Maya's viewport (vp2.0). Should some parameters or options be set or turned on for drawing? Thanks.