Chapter 3 · Reading a scene
3.3The scene report
The report prints every Solver group, each garment's stack (top first) with what each TenPix modifier is set to, then the objects outside any Solver group, the TenPix Winds and the threads objects. Run tpaReport() and read the whole result before you suggest anything.
global tpaStack, tpaDetails, tpaReport
-- one line per modifier, top first: stack index, name, class, switches, sharing
fn tpaStack o = (
local s = ""
for j = 1 to o.modifiers.count do (
local m = o.modifiers[j]
local c = classOf m
s += " [" + (j as string) + "] " + m.name + " <" + (c as string) + ">"
if not m.enabled do s += " LIGHT BULB OFF"
if isProperty m #tnEnabled do ( if not m.tnEnabled do s += " tnEnabled OFF" )
if c == Tnpix_Collision do ( if not m.active do s += " active OFF" )
local n = (tpaUsers m).count
if n > 1 do s += " (shared by " + (n as string) + " objects)"
s += "\n"
)
s
)
-- what each TenPix modifier on o is set to
fn tpaDetails o = (
local s = ""
for m in o.modifiers do (
local c = classOf m
if c == Tnpix_Pin then s += " Pin " + m.name + ": channel '" + m.channel + "', weight " + (m.weight as string) + ", follows " + (if isValidNode m.followObject then m.followObject.name else "nothing (holds in place)") + ", dynamic " + (m.dynamic as string) + (if m.activeTime then ", frames " + (m.activeFrom as string) + "-" + (m.activeTo as string) else "") + "\n"
else if c == Tnpix_Preserve then s += " Preserve " + m.name + ": channel '" + m.channel + "'\n"
else if c == Tnpix_Stitch then s += " Stitch " + m.name + ": channel '" + m.channel + "', to " + ((for x in m.stitchTo where isValidNode x collect x.name) as string) + ", to self " + (m.stitchToSelf as string) + ", tightness " + (m.tightness as string) + ", strength " + (m.strength as string) + "\n"
else if c == Tnpix_Tear then s += " Tear " + m.name + ": by " + (m.tearBy as string) + " (0 map, 1 stretch, 2 pressure), channel '" + m.channelName + "', threshold " + (m.threshold as string) + ", stretch ratio " + (m.stretchRatio as string) + "\n"
else if c == Tnpix_Rigid then s += " Rigid " + m.name + ": pieces from " + (m.piecesFrom as string) + " (0 channel, 1 mesh elements), channel '" + m.channel + "', rigidity " + (m.rigidity as string) + ", mass mode " + (m.massMode as string) + " | " + (TnpixTool.rigidInfo o) + "\n"
else if c == Tnpix_Volume then s += " Volume " + m.name + ": mode " + (m.mode as string) + " (0 keep volume, 1 pressure), channel '" + m.volumeChannel + "', ratio " + (m.volumeRatio as string) + ", pressure " + (m.pressure as string) + ", buoyancy " + (m.buoyancy as string) + "\n"
else if c == Tnpix_Soft_Body then s += " Soft Body " + m.name + ": material " + (m.material as string) + ", channel '" + m.softChannel + "'\n"
else if c == Tnpix_Forces then s += " Forces " + m.name + ": strength " + (m.strength as string) + ", channel '" + m.forceChannel + "', warps " + ((for x in m.forceNodes collect (if isValidNode x then x.name else "(deleted)")) as string) + ", muted " + (m.forceMuted as string) + "\n"
else if c == Tnpix_Self_Collision then (
s += " Self Collision: thickness " + (m.thickness as string) + ", panel friction " + (m.friction as string)
s += (if m.overrideMaterialFriction then " (Override material friction ON: the panel's friction, or a garment's own number below, on every point)" else " (Override material friction off: each garment's material friction acts; the panel's only where no material sets one)")
s += ", mode " + (m.mode as string) + " (0 basic, 1 advanced, 2 optimized), relaxation passes " + (m.passes as string) + ", query diameter " + (m.queryDiameter as string) + ", layer ordering " + (m.layerOrdering as string) + ", hold strength " + (m.layerHoldStrength as string) + " | " + (TnpixTool.selfColLayers o) + "\n"
for k = 1 to m.memberHandles.count do (
local mo = maxOps.getNodeByHandle m.memberHandles[k]
s += " garment list " + (k as string) + ": " + (if isValidNode mo then mo.name else "(deleted)") + ", layer " + (if k <= m.memberLayers.count then (m.memberLayers[k] as string) else "-") + ", friction " + (if k <= m.memberFrictions.count then (m.memberFrictions[k] as string) else "-") + ", thickness " + (if k <= m.memberThicknesses.count then (m.memberThicknesses[k] as string) else "-") + " (-1 = not set)\n"
)
)
else if c == Tnpix_Collision then s += " Collision: " + ((TnpixTool.colCount o) as string) + " row(s); DynSlide is a row's Friction, and a row's Friction and Grip act only with its Override material at 1 or 2 (3.7)\n" + (TnpixTool.rows o) + "\n"
else if c == Tnpix_Garment then s += " Garment: mode " + (m.mode as string) + " (0 remesh, 1 OpenVDB), edge length " + (m.edgeLength as string) + "\n"
else if c == Tnpix_Gravity then s += " Gravity: magnitude " + (m.magnitude as string) + ", direction " + (m.direction as string) + "\n"
else if c == Tnpix_Cache then s += " Cache: " + (TnpixTool.cacheInfo o) + "\n"
else if c == Tnpix_Wrap then s += " Wrap: proxies " + ((for x in m.proxies where isValidNode x collect x.name) as string) + ", bind frame " + (m.bindFrame as string) + " | " + (TnpixTool.wrapInfo o) + "\n"
)
for k = 0 to (TnpixTool.goldCount o) - 1 do s += " Material Standard " + (k as string) + ": " + (TnpixTool.goldAt o k)
for k = 0 to (TnpixTool.matCount o) - 1 do s += " Material Advanced " + (k as string) + ": " + (TnpixTool.matAt o k)
if (tpaFirst o Tnpix_Channel) != undefined do s += (TnpixTool.chans o)
s
)
fn tpaReport = (
local s = "Scene " + maxFilePath + maxFileName + " | unit " + (units.SystemType as string) + " x " + (units.SystemScale as string)
s += " | frames " + ((animationRange.start.frame as integer) as string) + " to " + ((animationRange.end.frame as integer) as string) + " at " + (frameRate as string) + " fps\n"
if TnpixTool == undefined then s += "TenPix Cloth is not loaded.\n" else (
s += "Licence: " + (TnpixTool.licInfo()) + "\n"
-- the Solver groups: each Solver instance and the objects that carry it
local svs = #(), grp = #()
for o in objects do for m in o.modifiers where (classOf m) == Tnpix_Solver do (
local k = findItem svs m
if k == 0 then ( append svs m; append grp #(o) ) else append grp[k] o
)
for i = 1 to svs.count do (
local sv = svs[i]
s += "\n== SOLVER GROUP " + (i as string) + ": " + ((for o in grp[i] collect o.name) as string) + "\n"
s += " substeps " + (sv.substeps as string) + ", iterations " + (sv.iterations as string) + ", contact passes " + (sv.contactPasses as string) + ", stretch quality " + (sv.stretchQuality as string) + ", smoothing " + (sv.smoothingIterations as string) + ", post collision passes " + (sv.postCollisionPasses as string) + ", fast motion collision " + (sv.ccd as string) + ", deep rescue " + (sv.deepRescue as string) + "\n"
s += " collision system " + (sv.collisionSystem as string) + " (4 = Surface True Geometry), world scale " + (sv.worldScale as string) + ", weight mode " + (sv.weightMode as string) + " (1 = Real), unlimited ground " + (sv.unlimitedGround as string) + "\n"
s += " start shape: " + (TnpixTool.live grp[i][1] "shape" 0) + "\n"
for o in grp[i] do s += " -- " + o.name + "\n" + (tpaStack o) + (tpaDetails o)
)
s += "\n== OUTSIDE ANY SOLVER GROUP\n"
for o in objects where (tpaFirst o Tnpix_Solver) == undefined do (
local tn = for m in o.modifiers where matchPattern ((classOf m) as string) pattern:"Tnpix*" collect m.name
if tn.count > 0 do s += " -- " + o.name + ": " + (tn as string) + "\n" + (tpaDetails o)
local c = classOf o.baseObject
if c == TenPix_Wind do (
local b = o.baseObject
s += " TenPix Wind " + o.name + ": mode " + (b.mode as string) + " (0 automatic, 1 map), type " + (b.windType as string) + ", speed " + (b.speed as string) + " m/s, map " + (b.map as string) + ", direction map " + (b.directionMap as string) + ", map size " + (b.mapSize as string) + " m, push across " + (b.pushAcross as string) + ", drag along " + (b.dragAlong as string) + "\n"
)
if c == Tnpix_Threads_Object do s += " Threads object " + o.name + " shows " + (o.baseObject.threadsFrom as string) + "\n"
)
)
s
)
What the report reads, and from where:
| What you want to know | Where it comes from |
|---|---|
| The Solver groups | refs.dependentNodes on a Solver, or the loop above |
| A garment's stack | o.modifiers; index 1 is the top of the stack |
| Colliders and their rows | TnpixTool.colCount, TnpixTool.rows (the row numbers that colSet takes) |
| Garment layers | TnpixTool.selfColLayers (each garment's layer, and whether it was typed or follows the Solver group's order) |
| Material values and their channel | TnpixTool.goldAt / TnpixTool.matAt; the text names the channel the material is bound to (channel <name>), and goldAt shows matFriction and matGrip (auth 1 = switched on) |
| Friction | 3.7: the materials, the Self Collision panel and its garment list, the collider rows |
| Channels | TnpixTool.chans: the channel table, with the row selected on the panel |
| Caches | TnpixTool.cacheInfo: file=, found=, playing=, the frames (frames 0-120 (121)), and stopped=1 for a recording that stopped early |
| Rigid pieces | TnpixTool.rigidInfo: the pieces and points, once a simulation has started |
| Wrap | proxies and bindFrame, plus TnpixTool.wrapInfo |
| Start shape | TnpixTool.live node "shape" 0: the modelled mesh, a kept shape, or the frame it was kept from |
| Wind | each TenPix Wind's properties on its base object; Tnpix Forces forceNodes and forceMuted |