我是maxscript的新手,我尝试用maxscript动画(显示)数字从0到220。我的问题是,我想要使整数范围,但使用这段代码,它正在生成浮点数。救救我!
b=box name: "ControlBox" wirecolor:blue height:1
t=text name: "ControlledText" wirecolor:red
t.baseobject.renderable=true
theCtrl = float_script()
theCtrl.addNode "TheText" t
theCtrl.addNode "TheBox" b
theCtrl.SetExpression "TheText.text = TheBox.height as string\n0"
t.kerning.controller=theCtrl
animate on at time 100 b.height=220
max tool zoomextents all
playAnimation()发布于 2016-10-10 01:11:43
将表达式中的TheBox.height更改为int(TheBox.height)。如果您想在截断之前舍入到下一个较低/更高的数字,也可以使用ceil和floor函数。
https://stackoverflow.com/questions/39948230
复制相似问题