forked from OliveMoustache/Public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mighty_DG2Parallel_play.mel
41 lines (32 loc) · 1.15 KB
/
mighty_DG2Parallel_play.mel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// DG to Parallel toggle script v1.2
// Olivier Ladeuix
// http://www.olivier-ladeuix.com/blog/
// Function:
// - When hitting the DG2Parallel hotkey, the script toggles the evaluation from DG to parallel on playback then stops the playback and reverts back to DG when hitting the hotkey again.
// - For better understanding of the mode used, the evaluation state appears on the Head Up Display (HUD) in the viewport.
// Usage suggestion:
// - Allocate the runtime command to a hotkey
// - the Runtime command is :
// mighty_DG2Parallel();
// Suggested hotkey: shift + v
// (v for regular playback toggle)
// see http://www.olivier-ladeuix.com/blog/2013/05/25/rethinking-mayas-hotkeys-for-animation/
global proc mighty_DG2Parallel()
{
SetEvaluationManagerHUDVisibility(1);
string $playState = `play -q -state`;
print $playState;
if ($playState == 0)
{ print $playState;
evaluationManager -mode parallel;
playButtonForward;
playbackStateChanged;
print "======= Playback switched to parallel ========"; }
else {
evaluationManager -mode "off";
playButtonForward;
playbackStateChanged;
print "Switched to DG";
}
;
}