玛雅MEL用户界面

上传人:jiups****uk12 文档编号:45530244 上传时间:2018-06-17 格式:PPT 页数:33 大小:1.65MB
返回 下载 相关 举报
玛雅MEL用户界面_第1页
第1页 / 共33页
玛雅MEL用户界面_第2页
第2页 / 共33页
玛雅MEL用户界面_第3页
第3页 / 共33页
玛雅MEL用户界面_第4页
第4页 / 共33页
玛雅MEL用户界面_第5页
第5页 / 共33页
点击查看更多>>
资源描述

《玛雅MEL用户界面》由会员分享,可在线阅读,更多相关《玛雅MEL用户界面(33页珍藏版)》请在金锄头文库上搜索。

1、MEL用户界面5.24MEL用户界面图形用户界面confirmDialog对话框询问信息string $returnVal=confirmDialog-title “IADATS“-message “Are you sure?“-button “Yes“-button “No“-button “I am not sure“-defaultButton “Yes“-cancelButton “Im not sure“-dismissString “Oops“;confirmDialog -title “Warning“-message “To be deleted!“-button “OK“;w

2、arning “Oops!too many!“; error “I have made a misstake!“MEL用户界面用户选择文件string $filePath=fileDialog -directoryMask “*.ma“;MEL用户界面用户验证利用正则表达式-验证整数 验证浮点数 验证字符串Maya利用Match命令来验证一个字符串或者字符串一 部分是否匹配正则表达式。match “blue“ “afdafdabdjaldsjfkuksjedf“;/不返回match “blue“ “sdsbluedfd“;MEL用户界面用户输入文本串promptDialog -message

3、“type a string containing the word blue please!“;string $typeString=promptDialog -q;string $type_match=match “blue“ $typeString;int $found_match=!strcmp “blue“ $type_match;print $found_match;匹配名称match “(blue)+“ “bluebluedaafa“;match “+/-0,10-9+$” $testString;/match “+/-0,10-9+$“ “- 6873647“;/;验证整数ma

4、tch “a-zA-Z0-9a-zA-Z_*$”;/验 证对象的名字简单对话框输入实例创建对话框提示输入球体名称验证输入是否有效错误报告创建对话框提示输入球体数量验证输入是否有效错误报告创建指定数量的球体简单对话框输入实例proc int validObjectName(string $testString)proc int validObjectNum(string $testString)global proc makeSpheres(string $myspherename,int $myspherenum)global proc makeSphereUI()global proc ma

5、keSpheres(string $myspherename,int $myspherenum)int $count=0;for($count=0;$count$myspherenum;$count+) string $thisname=($myspherename+($count+1);sphere -name $thisname;move ($count*5) 0 0; 12string $getBaseNumButton=promptDialog-title “SphereNum“-message “How many spheres would you like?“-text “Numb

6、er“;string $baseNum=promptDialog -q;/字符串if(!validObjectNum($baseNum) confirmDialog -title “Error“ -message “Wrong Number!“ -button “OK“;error “Bad Number!“; 3int $numSpheres=$baseNum;/转换数字if($numSpheres=0) confirmDialog -title “Error“ -message “The number should be positive!“ -button “OK“;error “The

7、 number should be positive!“; makeSpheres($baseName,$numSpheres);proc int validObjectName(string $testString) string $matchingPart=match “a-zA-Z0-9a-zA-Z*$“ $testString;int $goodMatch=!strcmp $matchingPart $testString;return $goodMatch; proc int validObjectNum(string $testString) string $matchingPar

8、t=match “+/-0,10-9+$“ $testString;/ 数字部分int $goodMatch=!strcmp $matchingPart $testString;return $goodMatch; 常用控件按钮string $myWindow=window; rowLayout;button -label “Make a sphere“ -command “sphere“; showWindow $myWindow;常用控件检验框浮点输入框浮点输入框+滑条(整型)checkBoxfloatFieldGrpstring $myWindow=window;rowLayout;ch

9、eckBox -label “Make a sphere“; showWindow $myWindow; / string $myWindow=window;rowLayout;string $mycheckBox=checkBox -label “Make a sphere“ -onCommand “sphere -name“blue“ -offCommand “delete blue“; showWindow $myWindow; string $myWindow=window;rowLayout;string $myfloatFieldGrp=floatFieldGrp -label “

10、sphere number“; showWindow $myWindow;/floatFieldGrp/string $myWindow=window;rowLayout;string $myfloatFieldGrp=floatSliderGrp -min 0 -max 10 -label “sphere number“ -field true; showWindow $myWindow;文本输入框:textFieldGrp; textFieldButtonGrp选择按钮:radioButtonGrpstring $window = window; columnLayout; radioBu

11、ttonGrp -numberOfRadioButtons 3 -label “Three Buttons“ -labelArray3 “One“ “Two“ “Three“; radioButtonGrp -numberOfRadioButtons 4 -label “Four Buttons“ -labelArray4 “I“ “II“ “III“ “IV“; showWindow $window; window -title “window demo“ -iconName “win“ -minimizeButton off-widthHeight 300 400-menuBar true

12、; menu -label “menu 1“;menuItem -label “menu item 1“;menuItem -label “menu item 2“; menu -label “menu 2“;menuItem -label “menu item 3“;menuItem -label “menu item 4“; showWindow;布局类型对于窗口包含控件必须包含布局columnLayoutformLayoutframeLayoutrowColumnLayoutcolumnLayoutformLayoutframeLayoutrowColumnLayou t创建原始几何体对

13、话框允许用户从对话框输入一个空间位置在该位置创建球体,圆锥体或立方体。1.创建构造物体的任务过程2.创建图形用户界面proc makeObject(float $x,float $y,float $z,int $style) switch($style) case 1: sphere; break; case 2: cone; break; case 3: polyCube; break; default:error -showLineNumber true “Invaild object type“; break; move $x $y $z;/无分隔符 global proc makePrimitiveUI() global string $positionGrp; string $myWindow=window -title “Create Window“ -rtf true; columnLayout; $positionGrp=floatFieldGrp -numberOfFields 3; rowLayout -nc 3; butt

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号