Arrays 通过proc传递字符串数组
这是我在MEL中的代码,但我不知道为什么它没有运行:Arrays 通过proc传递字符串数组,arrays,scripting,global,maya,mel,Arrays,Scripting,Global,Maya,Mel,这是我在MEL中的代码,但我不知道为什么它没有运行: window -width 150; columnLayout -adjustableColumn true; button -label "Button 1" -command "Base"; button -label "Button 2" -command "Top"; button -label "Button 3" -command "test"; showWindow; global string $Ba
window -width 150;
columnLayout -adjustableColumn true;
button -label "Button 1" -command "Base";
button -label "Button 2" -command "Top";
button -label "Button 3" -command "test";
showWindow;
global string $BaseCurves, $TopCurves;
global proc Base () {
$BaseCurves=`ls -sl`;
}
global proc Top () {
$TopCurves=`ls -sl`;
}
global proc test () {
print $TopCurves[0];
}
我不知道我为什么会有这个错误:
"$TopCurves" is an undeclared variable.
请尝试以下代码:
global string $BaseCurves;
window -width 150;
columnLayout -adjustableColumn true;
button -label "Button 1" -command "Base";
button -label "Button 2" -command "Top";
button -label "Button 3" -command "test";
showWindow;
global proc Base() {
$BaseCurves=`ls -sl`;
};
global proc Top() {
$TopCurves=`ls -sl`;
};
global proc test() {
string $TopCurves[0];
};
请尝试以下代码:
global string $BaseCurves;
window -width 150;
columnLayout -adjustableColumn true;
button -label "Button 1" -command "Base";
button -label "Button 2" -command "Top";
button -label "Button 3" -command "test";
showWindow;
global proc Base() {
$BaseCurves=`ls -sl`;
};
global proc Top() {
$TopCurves=`ls -sl`;
};
global proc test() {
string $TopCurves[0];
};