GetMaterial
From scripting
global proc string getMaterial(string $ObjName) { //Author Nick Pisca 0001d 2006 string $LH[] = `listHistory $ObjName`; string $LC[] = `listConnections $LH[0]`; string $LL[] = `listHistory $LC[1]`; return $LL[1];}
More information on navigating shader nodes, read pages 133-134 in YSYT.