星期三, 8月 31, 2011

批次輸出 cache

(
fn outputCache obj folderPath recordStart recordEnd sampleRate mode:1 =
(
try( deletemodifier obj obj.modifiers[#Point_Cache_Binding] ) catch()
try( deletemodifier obj obj.modifiers[#Point_Cache] ) catch()
local pcMod = undefined
if mode == 1 then pcMod = copy(pointCache()) else pcMod = copy(PointCacheWSM())
if pcMod == undefined do ( print "unknow mode" ; return false )
addmodifier obj pcMod
pcMod.fileCount = 0
pcMod.recordStart = recordStart
pcMod.recordEnd = recordEnd
pcMod.sampleRate = sampleRate
pcMod.filename = (folderPath +"\\"+obj.name+".xml")
if getCommandPanelTaskMode() != #modify do setCommandPanelTaskMode #modify
modpanel.setCurrentObject obj.modifiers[1]
classof obj
cacheOps.RecordCache obj.modifiers[1]
true
)
-- 用法 --
selObjs = selection as array
for obj in selObjs do
(
outputCache obj "c:\\Temp\\Out" 0.0 161.0 1 mode:2
)
)
最近寫的小型工具,有須要請自己取用。
又很久沒寫blog了,都在玩ssf4啊…