/* DLS_ctlColor Author: Davide La Sala (daxx@davidelasala.com) www.davidelasala.com Copyright (C) 2005 Davide La Sala Version: 1.0 Last Modified: 03 Nov 2005 (Davide La Sala) Function: Automatically override display color of a prefixed selected object. Usage: run the script, fill the information and press override button :) little note : this script override all the object (control nurbs, mesh and joint) color. */ //-----------------------------Init Script---------------- //-------------Window Maker global proc DLS_ctlColor() { string $DLSCTLC = `window -title "DLS_ctlColor v1.0 " -iconName "Short Name" -widthHeight 300 40`; columnLayout -adjustableColumn true; separator -height 10; $instr = `text -label "Insert Controls prefix"`; global string $cprefix; $cprefix = `textField -tx "l_"`; separator -height 10; global string $colore; $colore =`colorIndexSliderGrp -label "Select Controls Color" -min 0 -max 20 -value 10`; separator -height 10; button -label "Override Display Color!!" -command "DLS_ctlColormp"; separator -height 10; button -label "Close" -command ("deleteUI -window " + $DLSCTLC); separator -height 10; text -label "Davide La Sala - www.davidelasala.com" -align "center"; showWindow $DLSCTLC; } //--------------Override Color global proc DLS_ctlColormp() { select -cl; global string $cprefix; global string $colore; string $ctlprefix; int $ctlcolorx; string $ctlprefix = `textField -q -tx $cprefix `; int $ctlcolorx = `colorIndexSliderGrp -q -v $colore`; if (size($ctlprefix) == 0) { error "No Prefix Inserted"; } else select ($ctlprefix+("*")); string $sela[] = `ls -sl`; int $elements = `size $sela`; int $i; for ($i=0;$i<$elements;$i++) { setAttr ($sela[$i]+".overrideEnabled") 1; setAttr ($sela[$i]+".overrideColor") ($ctlcolorx-1) ; } select -cl; print ("Override Complete!"); print("\n"); print("\n"); } DLS_ctlColor; //------------End