« Only in Soho | Home | MEL: Find and edit the source of a procedure »

MEL: Setting the value of a Slim attribute

By nikos | July 11, 2008

Setting the value of a Slim attribute, from MEL, requires a bit more overhead compared to the normal Maya attribute. The following example shows how it can be done.

string $palette = `slimcmd slim FindPalette “MYPALETTE”`;
  1. string $all = `slimcmd $palette GetAppearances`;
  2. string $shaders[];
  3. tokenize( $all, " ", $shaders );
  4.  
  5. for ( $s in $shaders ) {
  6.     string $attr = `slimcmd $s GetProperties -name "MYPROPERTY"`;
  7.     if ( $attr != "") {
  8.         slimcmd $attr SetValue "MYVALUE";
  9.    }
  10. }

Topics: Maya, RenderMan | No Comments »

Comments are closed.