I'm trying to write a script that, given an object's name, returns an array of material names that are assigned to that object, or children of that object.
proc getMatConnections(string $geometry[]){
// Get array of all Shading Groups
string $shadingGroups[] = ls -type shadingEngine;
for ( $shadingGroup in $shadingGroups ) {
for($g in $geometry) {
$shapes = eval("listRelatives -s " + $ng);
if (sets -isMember $shadingGroup $shapes)
...
...
It dies on this if statement if $g is of some type that doesn't get materials, like lattices. I'm not even sure if this is the best way to go about it. Maybe there's a simpler way.
Any help is appreciated.