Maxscript-更改场景中所有关键帧上所有Box对象的值? [英] Maxscript - Changing the value for all Box objects in a Scene, on different Keyframes?
问题描述
我是Maxcscript的新手,我尽力解释一个问题,
I am new to Maxcscript, I try to explain a problem the best I can,
我正在尝试在Maxscript中创建一个脚本,该脚本会将场景中所有框对象在其第一个关键帧上的高度更改为零.
I am trying to make a script in Maxscript, that would change a height to a zero of all box objects in a scene on their first keyframe.
我有几个场景,每个场景都有许多盒子,有的有12个,有的有20个,等等. 并且所有盒子都设置了动画-但在不同的关键帧上,例如第一个盒子从第12-23帧开始设置动画,第二个盒子从30-45帧开始设置动画,等等. 现在,我正在使用此脚本来更改框的高度:
I have several scenes that all have a number of boxes, some have 12, some 20 boxes, etc. And all boxes are animated - but on different keyframes, for example first box is animated from 12-23rd frame, second box is animated from 30-45 frame, etc. (so I cant put specific frame number in a script) Right now I am using this script to change a height of a box:
set animate on
modPanel.setCurrentObject $.baseObject
$.height = 0
使用此脚本,我必须手动转到每个框的第一个关键帧,然后执行该脚本. 因此,Maxscript中是否有一种方法可以制作一个可以进入场景中每个框的脚本-转到其第一个关键帧,旋转动画并将其高度更改为零?从场景的第一个框到最后一个框?
using this script I have to manualy go to every boxs first keyframe and then execute the script. So, Is there a way in Maxscript to make a script that would go to every box in a scene - go to their first keyframe, turn animate and change its height to a zero; from first to last box in a scene?
推荐答案
我也是初学者.
但是试试这个吗?
I am a beginner too.
but try this?
actionMan.executeAction 0 "40021" -- Selection: Select All
for i in $ do
(
if matchpattern i.name pattern: "*Box*" == true do --ObjectName matching part
(
local foo = i.height.track --set Your Animation Controller
slidertime = getkeytime foo 1
set animate on
i.height = 0
set animate off
)
)
这篇关于Maxscript-更改场景中所有关键帧上所有Box对象的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!