Home Animation Showcase & Critiques

Maya Hotkeys For Faster Workflow

mod
Hey all, I wanted to touch on hot keys a bit.

I've seen a few posts lately about having to re-time things, and this being difficult when you have keys all over the place. Hot keys can help with this in ways you can't even image, if you have the right ones set up. 

Specifically, I`m talking about the AddInbetween, RemoveInbetween functions within Maya. What these functions do is when you have a control selected with keys on it, if you are currently on frame 5, and you have keys on frame 10, 15 and 20, you can press a single button and ALL the keys after your current frame will shift by 1 frame. So if you press your AddInbetween button, your keys will now be at 11, 16, and 21. If you press your RemoveInbetween button, your keys will be at 9, 14,  and 19. 

Here's an example. Below is the original timeline.

Now I press my addInbetween key 5 times and my timeline now looks like 

When I hit my removeInbetween 3 times, it will look like


This is all with 2 hot keys. A single button press. No going into the graph editor, selecting all the keys you want, and shift sliding them around. just grab your controls and button a key. This works for every control you have selected as well, so you can do all your controls at once. Super fast. Super convenient. 

To setup the hot keys, if you wish to use them, at the top of your maya, go to Window > Settings / preferences > Hotkey Editor.

You will see this window pop up. 

On the left, find “User” (A)  and on the right, click New (B). Type in a name for the hotkey (C) with no spaces. Then in the blank space below (D), You`ll type in the Mel commands which are as followed.

timeSliderEditKeys addInbetween;    <---for inserting an empty frame
timeSliderEditKeys removeInbetween;    <---for removing an empty frame

Press save (E). Now you just have to assign the actual hotkey (F). So type in the key you wish to use in the “Key:” box. For example, if you want your hotkey to be Ctrl + h, type in h in the box, then check the Ctrl modifier box. Hit Query to double check (see below), then hit assign.

 

The query button will tell you what action your hot key is assigned to, just so you don’t overwrite anything important. Most of the time, you`ll be over writing actions you`ll never use as an animator, but it’s good to check.  

 

You`ll need to do this process for both, typing in only 1 line of code for each hot key.

I keep most of my hotkeys as default in Maya, but I have changed a few.

` (left of 1) = toggle playback. So pressing it will start my animation, or stop it if already playing.

1 = previous key
alt +1 =  previous frame
2 = next key
alt + 2 = next frame
then my insert and remove frames are , and . since those are the default next/previous keys. 1 and 2, by default, change the quality of a model, low or medium. As an animator, I personally never use those keys. 


I really hope this helps some of you. I know it made a huge difference in my workflow, and greatly increased my ability to fix my timing. 

If you have any questions, feel free to ask! I`ll do my best to answer. And if you have any other hot keys that may benefit others, share them!

Replies

  • EVernier
    Offline / Send Message
    EVernier polycounter lvl 8
    Great post, thanks for sharing. I've been using Maya for a while and never bothered to change or add hot keys. I'll try your workflow for sure.
  • KielFiggins
    Offline / Send Message
    KielFiggins polycounter lvl 7
    Fun post @slipsius will have to give that a look.  You and I have similar hotkey layouts.

    ` = TimeDraggerToolActivate (from Tools section), allows you to scrub the timeline without putting your mouse in the timeline.  Handy when editing in the the GE

    1 = First frame in the range slider, custom hot key script
    2 = Previous Frame
    3 = Next Frame
    4 = Toggle Nurbs Shapes
    q = playback toggle
    d = my primary custom marking menu that accesses all my tools and other processes.

    I used to use more hotkeys, but I started getting repetitive stretch from reaching with my pinkie on ALT to whatever key, so I mapped them to a marking menu.  Some additional benefits to marking menus:
    -Access to my most common tools and procs (you can do this with the pop up option in marking menus to make drop downs)
    -All available from my 'd' key do I never need to leave the home row
    -When I have to transfer my prefs, I don't need to spend time on hotkeys, but just drag over a single marking menu file



  • slipsius
    Ah ya. The time slider tool active. I tried that before. Saw it on someone else's setup. Wasn't a fan of it, personally. I dunno why. The first frame in the range button though. I think I need to set that up! That would be super useful. Thanks for the share, Kiel.
  • heboltz3
    Offline / Send Message
    heboltz3 polycounter lvl 9
    Cool stuff getting thrown around in here!

    @slipsius  Ill have to try out those commands.  Seem to be super powerful! 
    @KielFiggins Marking menus are really awesome! I'm making the switch over to that workflow, and at first its pretty daunting going from a workflow based around shelves to one based around the menu, but I already see the speed advantages associated with it.

    Mostly, my hotkeys currently revolve around different windows I use all the time (graph editor,component editor, skin weighting etc), all associating around the " CTRL+ALT+ "hotkey" button " setup.  However I came to the conclusion that throwing all of that on a marking menu, and using hotkeys for functions similar to what Slipsius posted, or other scripts in general would save time, and valuable hot-key real estate while maintaining the speed of both workflows. 

  • AGoodFella
    Offline / Send Message
    AGoodFella polycounter lvl 5
    Does anyone have a script that allows you to scrub the timeline while working in the graph editor? I know holding down K is the default way of doing this but I've already overwrote that with another hotkey. I just need the MEL script so I can create another hotkey.

    Thanks.


  • slipsius
    @AGoodFella That's the "TimeDraggerToolActivate" key in the tools menu.. You can change the key in there. 



    Or if you want the MEL then it's 

    storeLastAction( "restoreLastContext " + `currentCtx` );setToolTo TimeDragger
  • AGoodFella
    Offline / Send Message
    AGoodFella polycounter lvl 5
    Thanks. I assigned it to "L" . I had to also assign TimeDraggerToolDeactivate to "L Release" for it to work properly. 
  • KielFiggins
    Offline / Send Message
    KielFiggins polycounter lvl 7
    @slipsius The mel command for first frame is pretty straight forward

    //First Frame Script float $timeKF = `playbackOptions -q -min`; currentTime -e $timeKF;
  • slipsius
    Ah, that saves me the trouble. Thanks, @KielFiggins !
  • StephenVyas
    Offline / Send Message
    StephenVyas polycounter lvl 18
    Nice idea for a thread

    I generally like to customize my hotkeys to keep them same as my gaming key layout (awsd)  

    1-4 to switch between the playback options

    a-previous frame  (Also stops playback & Loops through the timerange without adding additional 'undo' reiterations. Which is what the satewithoutflush is used for.Comment this out, if you prefer to include timeline scrubbing in your undo phase. )

    undoInfo -stateWithoutFlush off;
    float $mycurrentFrame = currentTime(`currentTime -q`);
    int $maxF = `playbackOptions  -q -maxTime`;
    int $minF = `playbackOptions  -q -minTime`;
    int $myMin = (int)$minF;
    int $myMax = (int)$maxF;
    int $myInt = (int)$mycurrentFrame;
    if ($myInt == $myMin){
    currentTime($myMax);
    } else {
    currentTime($myInt -1);
    }
    play -state off;
    undoInfo -stateWithoutFlush on;
    d-next frame
    undoInfo -stateWithoutFlush off;
    float $mycurrentFrame = currentTime(`currentTime -q`);
    int $maxF = `playbackOptions  -q -maxTime`;
    int $minF = `playbackOptions  -q -minTime`;
    int $myMin = (int)$minF;
    int $myMax = (int)$maxF;
    int $myInt = (int)$mycurrentFrame;
    if ($myInt == $myMax){
    currentTime($minF);
    } else {
    currentTime($myInt +1);
    }
    play -state off;
    undoInfo -stateWithoutFlush on;
    Shift a- Previous Key
    undoInfo -stateWithoutFlush off;
    currentTime -edit `findKeyframe -timeSlider -which previous`;
    play -state off;
    undoInfo -stateWithoutFlush on;
    Shift d- Next Key
    undoInfo -stateWithoutFlush off;
    currentTime -edit `findKeyframe -timeSlider -which next`;
    play -state off;
    undoInfo -stateWithoutFlush on;
    w - Move tool (toggles through World->Object(local) axis)
    w -Translate Toggle (World-Local/object axis)
    global proc ackToggleTranslateMode() {
    int $transX = `manipMoveContext -q -mode Move`;
    // 0 = Object, 1 = Local, 2 = World, 3 = Normal, 4 = Rotation Axis
    if ($transX == 2) {
    manipMoveContext -e -mode 0 Move;
    } else {
    manipMoveContext -e -mode 2 Move;
    };
    }
    ackToggleTranslateMode();
    dR_DoCmd("movePress")

    s - Rotate (Toggles between world -> object(Local) axis)
    global proc ackToggleRotateMode() {
    int $rotX = `manipRotateContext -q -mode Rotate`;
    // 0 = Local, 1 = Global, 2 = Gimbal
    if ($rotX == 0) {
    manipRotateContext -e -mode 1 Rotate;
    } else {
    manipRotateContext -e -mode 0 Rotate;
    };
    }
    ackToggleRotateMode();
    dR_DoCmd("rotatePress")


    e & Shift e -Toggles between Ik/Fk 
    q-Marquee select tool
    x- Set key
    z-undo
    f- focus/frame selected object
    `  Brings up the character GUI

    Shift R -Reset rotations on selected object
    string $array[] = `ls -sl`; 
    for ($item in $array) {
    setAttr ($item + ".rotateX") 0;
    setAttr ($item + ".rotateY") 0;
    setAttr ($item + ".rotateZ") 0;
    }

    Shift T -reset Translations on selected objects

    string $array[] = `ls -sl`; 
    for ($item in $array) {
    setAttr ($item + ".translateX") 0;
    setAttr ($item + ".translateY") 0;
    setAttr ($item + ".translateZ") 0;
    }
    ctrl c - Copy Keys
    timeSliderCopyKey;
    ctrl v- Paste Keys
    timeSliderPasteKey false;

    I think thatabout covers the non-specific Rig hotkeys
     
  • Arturow
    Offline / Send Message
    Arturow polycounter
    Nice! It's interesting how everyone works.
    I currently don't use the keyboard that much with hotkeys (maybe only to show all and show selected). I got a Razor Naga mouse with 12 side buttons but I only use 4/5 haha , just another perspective to use hotkeys :P
  • halleynguyen
    Paste Keys: paste this cmd in 'Runtime comd editor'. if u using 'timeSliderPasteKey false; ' it will not work for 'key all posing'

    performPasteKeyArgList 1 {"0", "animationList", "0"}
Sign In or Register to comment.