3Ds MAX如何打开新建并运行脚本(MaxScript)

2025-10-20 18:38:15

1、双击桌面图标进行3Ds Max主程序

3Ds MAX如何打开新建并运行脚本(MaxScript)

2、关闭欢迎屏幕。

3Ds MAX如何打开新建并运行脚本(MaxScript)

3、打开 菜单栏 Maxscript->新建脚本

3Ds MAX如何打开新建并运行脚本(MaxScript)

4、然后在打开的编辑器进行输入代码,此处我们给出示例,大家可以直接复制我下边的代码(黑体字部分)到编辑器中:

----------------源程序开始----------------------

--created by: 雪上行者 百度经验

--生成一个雪山飞壶脚本

--日期:2015年7月9日

 

--第一步.生成一个box 长方体设置box参数

box length:140 width:140 height:5 \                     

               lengthsegs:30 widthsegs:30 heightsegs:2 \

               pos:[0, 0, 0] wirecolor:[50,250,245]\

mapCoords:off

--修改box 加入噪波修改使之成为一个凸起的山

addModifier $box01(NoiseModifier fractal:true \      

                                 seed:9 \

                                                 scale:100.0 \

                                                 strength:[0, 0, 60] )

 

--第二步.生成一个水壶并设置参数 赋予chahu变量

chahu=Teapot radius:9 \

              smooth:on \

                       segs:4 \

                       body:on \

                       handle:on \

                       spout:on \

                       lid:on \

                       mapCoords:off \

                       pos:[-117, -18, 65]\

                       wirecolor:[233, 154, 229]

 

--第三步.生成一个粒子雪景及设置参数并赋予变量sn

sn = snow   pos:[4, 16, 100] \

           wirecolor:[255, 255,255] \

           viewportcount:100 \

                rendercount:100 \

                flakesize:2.0 \

                speed:10.0 \

                variation:2.0 \

                tumble:0.0 \

                tumblerate:1.0 \

                display:0 \

                start:(-30) \

                life:(65) \

                constant:true \

                emitterwidth:200 \

                emitterheight:200

sn.hideEmitter = true

 

--第四步.生成一个“雪山飞壶” 字体,赋予变量t

t = text size:20 pos:[0,200,57] font:"宋体"  --设置字体

t.text = "雪山飞壶"           --字为

rotate t 90 [1,0,0]      --字体绕x轴旋转90度

addModifier t (extrude amount:(-10))  --挤压成立体字

textMat = standardMaterial diffuse:[178, 102, 178] --加入材质光

t.mat = textMat

 

--第五步.生成一个目标摄象机

cam=Targetcamera fov:45 nearclip:1 farclip:1000 \

              nearrange:0 farrange:1000 \

              mpassEnabled:off mpassRenderPerPass:off \

              pos:[20.1, -191.169, 89.275] \  --isSelected:on

              target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [-9.8, 52.891, 11.745]))

--第六步.茶壶动画

animate on

(  at time 100       --时间为100帧

   (

   move chahu [228.0, 0.0, 0.0]        --茶壶沿x轴位移

   rotate chahu (angleaxis 360.0 [0,1,0]) --茶壶沿y轴旋转360度

   move t [0, -200, 0]   --字效沿y轴位移

   scale t [1.4, 1.4, 1.4]  --缩放字效

  

   )

)

--第七步.生成一个“雪上行者 百度经验” 字体,赋予变量b

b= text size:50 pos:[20,-200,0] font:"隶书"  --设置字体

b.text = "雪上行者 百度经验"           --字为

rotate b -10 [0,0,1]      --字体绕x轴旋转90度

textMat = standardMaterial diffuse:[0,0, 0] --加入材质光

b.mat = textMat

max zoomext sel all     --放大视图

max time play          --场景创建完成 自动播放动画

3Ds MAX如何打开新建并运行脚本(MaxScript)

5、然后点击文件->保存

3Ds MAX如何打开新建并运行脚本(MaxScript)

6、此处我们保存为 雪上行者百度经验雪山飞壶。

3Ds MAX如何打开新建并运行脚本(MaxScript)

7、然后关闭编辑器即可

3Ds MAX如何打开新建并运行脚本(MaxScript)

8、打开 菜单栏 Maxscript->运行脚本

3Ds MAX如何打开新建并运行脚本(MaxScript)

9、选择我们刚才保存的 雪上行者百度经验雪山飞壶.ms文件

3Ds MAX如何打开新建并运行脚本(MaxScript)

10、然后我们就可以看到动画成功创建,并已经自动播放了。

3Ds MAX如何打开新建并运行脚本(MaxScript)

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢