-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathswitchToCMD.mel
More file actions
39 lines (27 loc) · 1.04 KB
/
switchToCMD.mel
File metadata and controls
39 lines (27 loc) · 1.04 KB
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
global proc switchToCMD(string $cmdType){
global string $gCommandLine;
global string $gCommandLineSourceButton;
$cmdType = `tolower $cmdType`;
$cmdLineAnnot = $cmdType == "mel" ? uiRes("m_initCommandLine.kCmdLineAnnotMEL") :
uiRes("m_initCommandLine.kCmdLineAnnotPython");
// swtich cmd line
commandLine -e -sourceType $cmdType -inputAnnotation $cmdLineAnnot $gCommandLine;
// change ui
$lbl = `labelFromCommandSourceType $cmdType`;
iconTextButton -e -label $lbl -width 46 $gCommandLineSourceButton;
// upd optionVar
optionVar -sv commandLineSourceType $cmdType;
// ready to go
// setFocus $gCommandLine;
}
global proc doFocusOnShell(){
global string $gCommandLine;
setFocus $gCommandLine;
}
global proc doToggleCMDShell(){
global string $gCommandLine;
global string $gCommandLineSourceButton;
$curSrc = `commandLine -q -st $gCommandLine`;
$nextSrc = $curSrc == "mel" ? "python" : "mel";
switchToCMD $nextSrc;
}