Jun 2011
1 / 3
Jun 2011
Jun 2011

So, I've been working on a way to list all shaders in a scene, and find which meshes they're applied to. My system is getting a little in depth, and was just wondering if there is a simpler way that anyone knows of for doing this.  Maybe some command I'm unaware of? What exactly happens if you select a shader in the hypershade, and click on the 'Select Object with Material' option? I basically need to do that, with my script.

  • created

    Jun '11
  • last reply

    Jun '11
  • 2

    replies

  • 2.4k

    views

  • 1

    user

Does your script need to run in batch mode? Becuse the command thet does the selection wont work outside fo a gui maya very well. So use

sets -q yourShadersSG

in essence

for ( $item in ls -et shadingEngine ){
  $objects = sets -q $item;
  print ($item + " is connected to:\n");
  for ($object in $objects)
     print ("    " + $object + "\n");
}

yup... that's much faster than what I had going. I've never done anything with the 'sets' command before. I'll have to look into that some more. Thanks!

oh, and no, this doesn't have to run in batch mode...