-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheggImportOptions.mel
110 lines (99 loc) · 3.49 KB
/
eggImportOptions.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
global proc int eggImportOptions ( string $parent,
string $action,
string $initialSettings,
string $resultCallback )
//
// Description:
// This script posts the OBJ file translator options.
// The optionsString is of the form:
// varName1=value1;varName2=value2;...
//
// Parameters:
// $parent - the elf parent layout for this options layout. It is
// always a scrollLayout.
// $action - the action that is to be performed with this invokation
// of this proc. Valid options are:
// "query" - construct the options string and pass it
// to the resultCallback.
// "post" - post all the elf controls.
// $initialSettings - the current options string in effect at the
// time this script is invoked.
// $resultCallback -
// This is the proc to be called with the result string.
// resultCallback ( string $optionsString )
//
// Returns:
// 1 if successfull.
// 0 otherwise.
//
{
int $bResult;
string $currentOptions;
string $optionList[];
string $optionBreakDown[];
int $index;
if ($action == "post") {
setParent $parent;
columnLayout -adj true objTypeCol;
radioButtonGrp
-l "Merge with Current Scene"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objMerge;
radioButtonGrp
-l "Import Model"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objModel;
radioButtonGrp
-l "Import Animation"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objAnim;
$currentOptions = $initialSettings;
if (size($currentOptions) > 0) {
tokenize($currentOptions, ";", $optionList);
for ($index = 0; $index < size($optionList); $index++) {
tokenize($optionList[$index], "=", $optionBreakDown);
if ($optionBreakDown[0] == "merge") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objMerge;
} else {
radioButtonGrp -e -sl 1 objMerge;
}
} else if ($optionBreakDown[0] == "model") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objModel;
} else {
radioButtonGrp -e -sl 1 objModel;
}
} else if ($optionBreakDown[0] == "anim") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objAnim;
} else {
radioButtonGrp -e -sl 1 objAnim;
}
}
}
}
$result = 1;
} else if ($action == "query") {
if (`radioButtonGrp -q -sl objMerge` == 1) {
$currentOptions = $currentOptions + "merge=1";
} else {
$currentOptions = $currentOptions + "merge=0";
}
if (`radioButtonGrp -q -sl objModel` == 1) {
$currentOptions = $currentOptions + ";model=1";
} else {
$currentOptions = $currentOptions + ";model=0";
}
if (`radioButtonGrp -q -sl objAnim` == 1) {
$currentOptions = $currentOptions + ";anim=1";
} else {
$currentOptions = $currentOptions + ";anim=0";
}
eval($resultCallback+" \""+$currentOptions+"\"");
$result = 1;
} else {
$bResult = 0;
}
return $bResult;
}