Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Animation / Keyframe Scubbing Undo?
  RSS 2.0 ATOM  

Keyframe Scubbing Undo?
Rate this thread
 
51825
 
Permlink of this thread  
avatar
  • CoreyArt
  • Posted: 29 January 2011 04:04 PM
  • Total Posts: 7
  • Joined: 30 January 2007 10:24 AM

Currently I used the < and > keys to scrub through my keyframes when animating. However maya seems to count this as an action, so when I hit undo, maya also goes through all the times I pressed the < and > keys too. Is there a way I can use the shortcut keys < and > to scrub through my timeline keyframes without maya taking this into account whenever I do an undo.



Replies: 0
avatar
  • CoreyArt
  • Posted: 31 January 2011 06:14 AM

Any idea anyone?



Replies: 0
avatar
  • tkaap
  • Posted: 01 February 2011 04:15 AM

It’s not the keyboard shortcut that you’re using that is being undone, but it’s the time-change itself that is being undone.  (For example, mouse-click on several times, then see that you can undo those time changes).  That makes it a bit harder, but it we can combine them into one action, then we can undo them in one action.

Take a look at the -ock and -cck flags on undoInfo.  I think they should let you do what you’re looking for here.  For instance, you can open a chunk (possibly through a hotkey) do your scrubbing, then close the chunk and undo:

global proc open(){
undoInfo 
-ock;
}
global proc step(){
currentTime 
-edit `findKeyframe -timeSlider -which next`;
}
global proc close(){
undoInfo 
-cck;
undo;
}

open
();
step();
step();
step();
step();
step();
close();


Replies: 1
/img/forum/dark/default_avatar.png

Thank you for the reply. I understood you until the open a chunk, and close a chunk? Are you saying I can set a keyboard shortcut with this script and maya wont include this action in the list of Undo’s.

Author: CoreyArt

Replied: 01 February 2011 05:03 AM  
avatar
  • tkaap
  • Posted: 02 February 2011 05:21 AM

Sorry for the confusing terms.  The -ock and -cck flags are the abbreviations for “open chunk” and “close chunk”.  The idea is that you are creating a ‘chunk’ of commands that the undo queue should treat like a single command.  Any commands run between when you ‘open’ and when you ‘close’ a chunk should be treated as a single command.  That will mean that if you hit ‘undo’ they will all be undone in a single step. 

You should take care to always close the chunk afterward, though, or else Maya’s undo function might not work correctly.

You were asking to have the time changes ignored entirely, but Maya doesn’t work that way.  This might be the best compromise. 

So a good workflow might be:
1) Open a chunk with the ‘undoInfo -ock’ command.  You can assign this to a hotkey, or to a shelf button.

2) Scrub the timeline to your heart’s content.

3) Close the chunk with the ‘undoInfo -cck’ command.  This can also be assigned a hotkey or shelf button.  If you’re feeling really fancy you can assign them both to the same hotkey and make it a toggle.

4) If you want to undo the scrubbing (and go back to the time that you were at before you started scrubbing), call ‘undo’.  My little close() function calls does both steps 3) and 4) at the same time.

This is just a way to encapsulate the timeline changes.  The bottom part of my example code is just an example of how you might use it—it opens, scrubs the time, then closes and calls undo.

Is that clearer now?

-T



Replies: 1
/img/forum/dark/default_avatar.png

Thank you very much. I get the idea now. Undo all the scrubbing in one undo basically. Now.....

global proc open(){
undoInfo -ock;
}

Set this to a hot key to open a command ?…

global proc close(){
undoInfo -cck;
undo;
}

Set this to a hotkey to close a command right?

Now you said there is a way to combine commands so Im not constantly worrying about opening commands and closing commands when trying to scrub through my keys. I can set a combination of commands to hotkeys like < and > and just hit undo when ready and it will undo all my scrubbing or is this not how it can work?

Author: CoreyArt

Replied: 03 February 2011 06:03 AM  
avatar
  • tkaap
  • Posted: 04 February 2011 06:45 AM

I think probably the best you can get is:

1) < or > set to a function that will open the chunk (if necessary) and do the scrub action
2) scrub with < and/or >
3) Call some other function to close the chunk and undo.  Just calling ‘undo’ won’t quite work.  I suppose you -could- override the undo hotkey temporarily to call this close-and-undo proc, but that would be risky since if something goes wrong it might break the undo mechanism.

Would that be a workflow that could work for you?

-T



Replies: 0