Chapter 2 · Examples
2.5A Small Tool of Your Own
rollout TenPixQuick "TenPix Cloth - Quick Tools" (
fn setQuality panelSubsteps iter ctc stretch = (
for o in objects where o.modifiers[#Tnpix_Solver] != undefined do (
local s = o.modifiers[#Tnpix_Solver]
s.substeps = panelSubsteps -- the panel's number
s.iterations = iter
s.contactPasses = ctc
s.stretchQuality = stretch
)
)
button btnMake "Make Selected Cloth" width:150
button btnDraft "Draft Quality (all)" width:150
button btnHigh "High Quality (all)" width:150
on btnMake pressed do (
for o in selection do (
addModifier o (Tnpix_Garment())
o.modifiers[#Tnpix_Garment].edgeLength = 2.0
addModifier o (Tnpix_Gravity())
addModifier o (Tnpix_Solver())
)
)
on btnDraft pressed do setQuality 1 1 1 1
on btnHigh pressed do setQuality 8 4 4 4
)
createDialog TenPixQuick 170 110
What you should see: a small window with three buttons. Select meshes and click Make Selected Cloth: they become simulation-ready cloth with your defaults. Before a quick preview, Draft Quality drops every Solver in the scene to the Draft step; before the final, High Quality raises them all. The Quality tool on the TenPix toolbar does the same with all four steps.