Thread: Animating
View Single Post
# 28 24-11-2002 , 10:37 AM
BabyDuck's Avatar
Subscriber
Join Date: Nov 2002
Location: USA
Posts: 1,170

working now

ok, the script is working: you can set keys and cut keys (now or in whole scene) of ALL keyable attributes. the indicator is still missing if a key is set already or not. and whenever you change the selected objects you have to run the script again, as only that will ensure that all attributes (the custom ones too) will show correctly. the easiest way to use it, is to copy the whole code (be sure you got all) into script editor, there select all, and mmb-drag it to the shelf - a MEL button that runs the setkey will appear user added image

enjoy

p.s.: no comments in code, no docu? i know, dont blame me, it is my first mel try user added image


Code:
string $setKeyKeyable;
if (`window -exists $setKeyKeyable`) deleteUI -window $setKeyKeyable;
$setKeyKeyable = `window -wh 450 400 -t "Set Key Keyable"`;
    rowColumnLayout -numberOfColumns 4;
    string $setB,$cutB,$cutAllB,$attr;
    string $attrList[] = `listAttr -k`;
    if( size($attrList) > 0){
      $attrList = stringArrayRemoveDuplicates($attrList);
      $attrList = sort ($attrList);
      for( $i=0; $i<size($attrList); $i+=1 ) {
          $attr = $attrList[$i];
          text -label $attr -align "center"; $setB = `button -l "set"`;
          $cutB = `button -l "cut"`;
          $cutAllB = `button -l "cutAll"`;
          button -e -c {"setKeyframe -at "+$attr+";"} $setB;
          button -e -c {"cutKey -t `currentTime -q` -at "+$attr+";"} $cutB;
          button -e -c {"cutKey -at "+$attr+";"} $cutAllB;
      }
    } else
      text -label "no keyable";
   setParent ..;
showWindow $setKeyKeyable;