MAXScript101_4.1 Loops and Loop Control
来源:互联网 发布:开淘宝店要下载什么软件 编辑:程序博客网 时间:2024/06/05 16:18
MAXScript101_4.1 Loops and Loop Control
1. The While loop
while <test_expr> do <body_expr>
eg.
-- get an object's full path name
fn get_pathname obj =
(
local pn = obj.name
-- repeat while there are more parents
while obj.parent != undefined do
(
-- follow link out to next parent & prepend its name
obj = obj.parent
pn = obj.name + "/" + pn
)
"$" + pn
)
-- usage:
get_pathname $Bip01
--"$Bip01"
get_pathname $Bip01LCalf
--"$Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 L Thigh/Bip01 L Calf"
2. Loop Control
Continue Command: 不执行continue之后的语句,直接下一个循环
eg.
--如果在被选的物体中,存在非Editable_Mesh的物体,则弹出对话框并执行下一个循环语句;
-- 统计Editable_Mesh的物体的个数,面的总数及定点的综述
-- scan all in selection
Exit Command:跳出循环
-- 场景:两个小球分别沿着一个轨道运懂,
-- 当两小球运动到两者间距离最短时,将spray放到两小球中间,并且开始释放
Return Command: 结束整个程序
function findByUserProp propName propValue =
(
-- 如果找到某一obj,它存在参数提供的propValue,则返回该obj;
for obj in objects do
if getUserProp obj propName == propValue then
return obj
-- 否则,返回undefined
undefined
)
-- getUserProp <node> <key_string>
返回结点的用户属性,如果不存在,则返回undefined
视频教程: http://vimeo.com/19514070
- MAXScript101_4.1 Loops and Loop Control
- Control-Loops
- 【sql调优之执行计划】nested loops join and nested loop join outer
- ActionScript 3.0 - Conditionals and Loops
- Why is one loop so much slower than two loops?
- loops
- Loop, data, and MapReduce
- thread loop and handler
- Go 语言实现exercise--Loops and Functions
- Sharing Message Loops Between Win32 and WPF
- Python Tutorial :Loops and List Comprehensions 其他
- 第十三章 while and for Loops
- Java Basics Part 9/20 - Loop Control
- c++ program -->1 case structure and loop statement
- MAXScript101_4.2 Case Expressions
- Java Notes: Loops and Arrays & Methods and Class
- message loop and win prok
- Function in loop and closure
- 常用的快速Web原型图设计工具
- 提高代码质量及字节码如何防止内存错误
- openMP编程探索2——循环并行化
- Web界面原型设计工具
- BMP文件格式详解(BMP file format)
- MAXScript101_4.1 Loops and Loop Control
- C/C++代码审查表
- sql 分页技术
- 老帖:今天我被炒了,一位36岁软件工程师的困惑
- 使用Vim打造IDE--taglist
- byte文件的获取函数
- java(Web)中相对路径,绝对路径问题总结
- CentOS 5.3 安装后的基本软件配置
- centos笔记