多米诺骨牌v.1MEL语言

//
// 
//Script Name:多米诺骨牌v.1
//Author:疯狂小猪 
//Last Updated: 2011.10.5
//Email:wzybwj@163.com
// 
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------

global proc createDmn()
{
 if (`window -ex dmn`)
            deleteUI dmn;

     window
            -t "多米诺骨牌v.1" 
            -w 400 -h 300
            -menuBar true
            -menuBarVisible true
            dmn;
     menu
            -label "edit"
            -tearOff 0;
       menuItem
              -label "默认设置" -c "err";
       menuItem
              -label "退出"
              -c "deleteUI dmn";
     menu
           -label "help"
           -tearOff 0;
     
     
     columnLayout
                -cw 300   
                -adj true   
                -rowSpacing 5 ;
       button  
                -h 30
                -l "拾取曲线"
                -al "center"
                -c "loadCurve"
                selectLabel;
       textFieldGrp
               
                 -l  "曲线选择"
                 loadCurve;
                      
     columnLayout   
                -adj true
                -cal "left"       
                -rowSpacing 5 ;
       separator
                -style "in";
       text  
            -fn boldLabelFont
              -al "left"
              -l "创建设置:";
       intSliderGrp
                -field true
                -l"骨牌间隔"   
                -minValue 1 -maxValue 100.0
                -fieldMinValue 1 -fieldMaxValue 100
                -value 10 jiange;
       intSliderGrp
                -field true
                -l"距离长度"   
                -minValue 400 -maxValue 1000
                -fieldMinValue 400 -fieldMaxValue 1000
                -value 400 changdu;
       floatSliderGrp
                -field true
                -l"骨牌宽度"   
                -minValue 0 -maxValue 10
                -fieldMinValue 0 -fieldMaxValue 10
                -value 1.25 x;
       floatSliderGrp
                -field true
                -l"骨牌高度"   
                -minValue 0 -maxValue 10
                -fieldMinValue 0 -fieldMaxValue 10
                -value 3 y;
       floatSliderGrp
                -field true
                -l"骨牌厚度"   
                -minValue 0 -maxValue 10
                -fieldMinValue 0 -fieldMaxValue 10
                -value 0.3 z;
       separator
                -height 5
                -style "in";
       text  
              -fn boldLabelFont
              -al "left"
              -l "速度设置:";
      
       intSliderGrp
                -field true
                -l"单体倒塌速度"   
                -minValue 1 -maxValue 100.0
                -fieldMinValue 1 -fieldMaxValue 100
                -value 20 dtsudu;
       intSliderGrp
                -field true
                -l"全局倒塌速度"   
                -minValue 1 -maxValue 50
                -fieldMinValue 1 -fieldMaxValue 50
                -value 15 qjsudu;
       intSliderGrp
                -field true
                -l"倒塌角度极限"   
                -minValue 50 -maxValue 90
                -fieldMinValue 50 -fieldMaxValue 90
                -value 84 singleRot;
     columnLayout
                -adj 1     
                -cal "left"
                -cat "both" 5
                -columnWidth 68
                -rowSpacing 5;


       button  
                -h 30
                -l"创建骨牌"
                -al "center"
                -c "createDmn";
       button
                -h 30
                -l"删除骨牌"
                -al "center"
                 -c "deleteGp ";
       button
                -h 30
                -l"删除曲线"
                -al "center"
                -c "deleteCurve";
       button
                -h 30
                -l"创建动画"
                -c "addMotion"
                -al "center";
       button
                -h 30
                -l"删除动画"
                -c "deleteMotion"
                -al "center";
    
     setParent..;
     showWindow dmn;
}

global proc dmn()
{   
     $curveName = `textFieldGrp -q -tx loadCurve`;

     $mp = `intSliderGrp
                            -q -v changdu`;
     $jiange = `intSliderGrp
                            -q -v jiange`;
     $x = `floatSliderGrp
                            -q -v x`;
     $y = `floatSliderGrp
                            -q -v y`;
     $z = `floatSliderGrp
                            -q -v z`;
            polyCube
                   -ch on
                   -o on
                   -w $x
                   -h $y
                   -d $z
                   -cuv 4
                   -n gp1;
            move 
                   -r 0 ($y/2*-1) 0 gp1.scalePivot gp1.rotatePivot ;
            setAttr "gp1.translateY" ($y/2*-1);
            group
                   -name "gp";
            xform
                   -os
                   -piv 0 0 0;
            select
                   -cl  ;

            select
                   -r gp1  $curveName ;
            pathAnimation
                         -fractionMode true
                         -follow true
                         -followAxis z
                         -upAxis y
                         -worldUpType "vector"
                         -worldUpVector 0 1 0
                         -inverseUp false
                         -inverseFront false
                         -bank false
                         -startTimeU 1
                         -endTimeU                         
                         $mp;

                 for($ee=$jiange;$ee<=$mp;$ee+=$jiange)
                    {
                      currentTime $ee;
                      select
                            -r gp1 ;
                      duplicate
                            -rr;
                     }
             currentTime 1;
             cycleCheck -e 0;
             delete motionPath1;
}

 

 

global proc createDmn()
{    
    

     if(`objExists curve1`)
       {
            if(`objExists gp`)
              {
               delete gp;
               dmn;
               }
           else
               {
               dmn;        
                }          
         }
     else
         {
          confirmDialog
                       -message "你必须创建一条曲线!"
                       -button "确定";
                      
          }
  
}

 

 

global proc deleteCurve()
{
           select -cl;
           SelectAllNURBSCurves;
           $selection = `ls -sl`;
                  if(`size($selection)` == 0)
                        confirmDialog
                                     -message "场景中没有可删除曲线"
                                     -button "确定";
                  else
                      delete;
}

 

global proc deleteGp()
{
           if(`objExists gp`)
               delete gp;
           else
               confirmDialog
                            -message "场景中没有可删除的骨牌模型!"
                            -button "确定";
}

 

global proc loadCurve()
{
           $select = `ls -sl`;
            if(`size($select)` == 0)
             {
                             confirmDialog
                                           -message "你什么都没有选择"
                                           -button "确定";
             }
            else
            {
                 $selectShap = `listRelatives -f $select[0]` ;
                
                 if(`nodeType $selectShap` != "nurbsCurve")  
                   {
                             confirmDialog
                                           -button "确定"
                                           -message "你选择的不是曲线物体";
                    }
                 else
                    {
                     textFieldGrp -e -tx $selectShap loadCurve;
                     }
            }
           
}

global proc addMotion()
{
if(`objExists dmnMotion`)
    {
     delete dmnMotion;
      }
expression -s "select -cl;\r\nselect \"gp*\";\r\n$select = `ls -sl`;\r\n$num = (`size($select)` -1 )/2;\r\nint $singleSpeed = `intSliderGrp -q -v dtsudu`;\r\nint $globalSpeed = `intSliderGrp -q -v qjsudu`;\r\nint $finalRot = `intSliderGrp -q -v singleRot`;\r\n\r\n\r\n\r\nfor($i=1;$i<=$num;$i++)\r\n{\r\n string $attr=\"gp\"+$i+\".rx\";\r\n $rot=linstep(0+$i*$globalSpeed,$singleSpeed+$i*$globalSpeed,frame)*$finalRot;\r\n setAttr $attr $rot;\r\n}"  -o "" -n "dmnMotion" -ae 1 -uc all ;
}


global proc deleteMotion()
{
if(`objExists dmnMotion`)
{
      currentTime 1;
      delete dmnMotion;
 }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/388647.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

THINKPHP3.2视频教程

http://edu.51cto.com/lesson/id-24504.html lunix视频教程 http://bbs.lampbrother.net/read-htm-tid-161465.html TP资料http://pan.baidu.com/s/1dDCLFRr#path%252Fthink 微信开发&#xff0c;任务吧&#xff0c;留着记号了

mardown 标题带数字_标题中带有数字的故事更成功吗?

mardown 标题带数字统计 (Statistics) I have read a few stories on Medium about writing advice, and there were some of them which, along with other tips, suggested that putting numbers in your story’s title will increase the number of views, as people tend …

897. 递增顺序查找树-未解决

897. 递增顺序查找树 https://leetcode-cn.com/contest/weekly-contest-100/problems/increasing-order-search-tree/ package com.test;import java.util.ArrayList; import java.util.Collections; import java.util.List;/*** author stono* date 2018/9/2* 897. 递增顺序查…

Azure PowerShell (16) 并行开关机Azure ARM VM

《Windows Azure Platform 系列文章目录》 并行开机脚本&#xff1a; https://github.com/leizhang1984/AzureChinaPowerShell/blob/master/ARM/2StartAzureARMVM/StartAzureRMVM.txt 并行关机脚本&#xff1a; https://github.com/leizhang1984/AzureChinaPowerShell/blob/mas…

使用Pandas 1.1.0进行稳健的2个DataFrames验证

Pandas is one of the most used Python library for both data scientist and data engineers. Today, I want to share some Python tips to help us do qualification checks between 2 Dataframes.Pandas是数据科学家和数据工程师最常用的Python库之一。 今天&#xff0c;我…

Maya开发

Maya开发&#xff08;一&#xff09;-- 绪论 &#xff08;翻译自Maya官方文档&#xff09;2008-05-09 15:33 绪论 Autodesk Maya 是一个开放的产品,就是说任何Autodesk以外的人都可以改变Maya现有的特征,或者 增加新的特性.你可以用两个方法来修改MAYA: ME…

织梦在线报名平台php,DedeCMSv5

DedeCMS v5国内专业的PHP网站内容管理系统-织梦内容管理系统v5.8 Roadmap状态 ✅ 已完成 &#x1f528; 进行中 ❌ 未完成项目开发可以到织梦开发问题管理中进行交流反馈。&#x1f528; 调整DedeCMS目录结构&#xff0c;将原有include中外部访问的内容迁移出去&#xff1b;&am…

pom.xml文件详解

<project xmlns"http://maven.apache.org/POM/4.0.0" xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <!-- 父项目的坐…

软件工程第一次作业

&#xff08;1&#xff09;回想一下你初入大学时对计算机专业的畅想 当初你是如何做出选择计算机专业的决定的&#xff1f; 当初选择计算机专业是因为之前看大佬们参加信息竞赛&#xff0c;觉得很厉害、很有意思&#xff0c;而且也希望能自己做一款游戏出来&#xff0c;所以就选…

置信区间的置信区间_什么是置信区间,为什么人们使用它们?

置信区间的置信区间I’m going to try something a little different today, in which I combine two (completely unrelated) topics I love talking about, and hopefully create something that is interesting and educational.今天&#xff0c;我将尝试一些与众不同的东西…

事实上着就是MAYA4.5完全手册插件篇的内容

不过着好象侵权了&#xff0c;因为&#xff21;&#xff2c;&#xff29;&#xff21;&#xff33;声明不得一任何方式传播该手册的部分或全部_炙墨追零 Maya不为插件提供二进制兼容性。每当发布新版本时&#xff0c;旧插件的源代码要重新编译。然而&#xff0c;我们的目标是保…

制作alipay-sdk-java包到本地仓库

项目要用到支付宝的扫码支付&#xff0c;后台使用的maven 问了客服 官方目前没有 maven 的地址只能手动安装到本地了&#xff0c;如果建了maven 服务器也可以上传到服务器上 从支付宝官网上下载sdk 制作本地安装包 alipay-sdk-java.jar 放到D: 盘根目录下 执行命令&#xff1a…

php中wlog是什么意思,d-log模式是什么意思

D-Log是一种高动态范围的视频素材记录格式&#xff0c;总而言之这个色彩模式为后期调色提供了更大的空间。在相机和摄影机拍摄时&#xff0c;一颗高性能的传感器通常支持11档以上的动态范围&#xff0c;而在8bit的照片或视频上&#xff0c;以符合人眼感知的Gamma进行机内处理和…

PowerShell入门(三):如何快速地掌握PowerShell?

如何快速地掌握PowerShell呢&#xff1f;总的来说&#xff0c;就是要尽可能多的使用它&#xff0c;就像那句谚语说的&#xff1a;Practice makes perfect。当然这里还有一些原则和方法让我们可以遵循。 有效利用交互式环境 一般来说&#xff0c;PowerShell有两个主要的运行环境…

pca 主成分分析_通过主成分分析(PCA)了解您的数据并发现潜在模式

pca 主成分分析Save time, resources and stay healthy with data exploration that goes beyond means, distributions and correlations: Leverage PCA to see through the surface of variables. It saves time and resources, because it uncovers data issues before an h…

宏观数据提取

http://219.235.129.58/fbk/checkSession.jsp http://219.235.129.58/indicatorYear.do?methodgetDczdsXml&bgqbDm1 大列表 http://219.235.129.58/indicatorYear.do?methodgetDczdsXml&bgqbDm1&FBZD_FJD0300&timeTypeyear 第二层 http://219.235.129.58/…

UML-- plantUML安装

plantUML安装 因为基于intellid idea,所以第一步自行安装.setting->plugins 搜索plantUML安装完成后&#xff0c;重启idea 会有如下显示安装Graphviz 下载地址 https://graphviz.gitlab.io/_pages/Download/Download_windows.html配置Graphviz环境变量&#xff1a; dot -ver…

php不发送referer,php – 注意:未定义的索引:HTTP_REFERER

注意&#xff1a;未定义的索引&#xff1a;HTTP_REFERER$http_referer $_SERVER [‘HTTP_REFERER’]我使用这个从教程,它看起来不错代码也从包含文件中调用它我该怎么改&#xff1f;我添加了print_r($_ SERVER);现在页面给了我这个Array ([UNIQUE_ID] > UoSxWa56310AAAwUck…

HDU 最大报销额 (0 1 背包)

最大报销额 Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 29 Accepted Submission(s) : 11 Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书&#xff08;A类&#xff09…

rstudio 关联r_使用关联规则提出建议(R编程)

rstudio 关联r背景 (Background) Retailers typically have a wealth of customer transaction data which consists of the type of items purchased by a customer, their value and the date they were purchased. Unless the retailer has a loyalty rewards system, they …