on cbCustomRange changed stat do ( if cbCustomRange.checked==truethen ( Start.enabled=true End.enabled=true ) else ( Start.enabled=false End.enabled=false ) )
)
Button _BakePC "开始缓存" width:130 height:64 progressbar Bake_prog color:green on _BakePC pressed do ( if PCpath.text==""then messagebox "请选择输出文件夹以保存顶点缓存文件" else if $==undefined then messagebox"选择烘培物体" else ( for i = 1 to selection.count do--遍历所有选择的物体,一般只会选择1个 ( A= selection as array OBJname = A[i].name + ".xml" FilePathName= PCpath.text PointCacheName= FilePathName +@"\"+ OBJname addmodifier A[i] (Point_Cache ()) --添加点缓存修改器 A[i].modifiers[#Point_Cache].filename=PointCacheName if cbCustomRange.checked then --如果开启了自定义,就设置插件内如下参数 ( A[i].modifiers[#Point_Cache].playbackType=2 A[i].modifiers[#Point_Cache].playbackStart=Start.value A[i].modifiers[#Point_Cache].playbackEnd=End.value ) else ( A[i].modifiers[#Point_Cache].playbackType=0 ) cacheOps.recordcache A[i].modifiers[#point_cache] --记录点信息 cacheOps.DisableBelow A[i].modifiers[#point_cache] --关闭下面的修改器,一般就是skin Bake_prog.value = 100.*i/A.count ) Messagebox "生成完毕" ) ) ) createdialog PointCacheTool