// MTsetAnimFrameRange.mel // Written by Markus Tessmann, Rock Farm Animation // ------------------------------------------------------- // // This mel script creates a window with a column of buttons, where each button sets // a playback range and frames the graph editor on that range. This is intended for // use in Maya scenes where there are a number of independent animations // on a particular character (game animation) or in a specific scene setup. // Copy the contents of this script to a Maya Shelf button and then // customize as indicated below for each character or entity. // NOTE: sourcing this script will not work properly - it must be loaded to run // // 'search & replace' the 3 occurrences of the word CHARACTER in this file to customize the window title and name window -w 150 -title "CHARACTER Animations" CHARACTERButton1; columnLayout; // copy the button line below and modify to create a new button that will set the desired range. // Note: you can use the label name to indicate the output sequence name and range. button -w 130 -label "Sample 1" -command ("playbackOptions -min 0 -max 30;" + "frameRange"); button -w 130 -label "Another Sample" -command ("playbackOptions -min 50 -max 100;" + "frameRange"); // the word CHARACTER below must match the window name set on the first 'window' line. showWindow CHARACTERButton1; // DO NOT modify the code below. It frames the window of the graph editor to match the playback range. proc frameRange() { setFocus graphEditor1; FrameSelected; animView -startTime (`playbackOptions -query -minTime` - 1) -endTime (`playbackOptions -query -maxTime` + 1) graphEditor1GraphEd; }