The following snippet code opens the "test.ass" file attached in this wiki, find the object named "mesh", get the shader array, and print a list of its shaders.

#!/usr/bin/env python
from arnold import *

AiBegin()
AiASSLoad("test.ass")

mesh = AiNodeLookUpByName('mesh')
shaders = AiNodeGetArray(mesh, "shader");
for i in range(AiArrayGetNumElements(shaders)):
   shader = AiArrayGetPtr(shaders, i)
   print AiNodeGetName(shader)

AiEnd()



  • No labels