Chapter 1 · Introduction

1.3Solver Groups and Instances

The Solver simulates every object that carries the same Solver instance, together, as one Solver group. Two garments with two separate Solvers are two separate simulations and never touch. To make garments interact (a shirt under a jacket), create the modifier once and add that one object to each garment:

s = Tnpix_Solver()
addModifier $Shirt s
addModifier $Jacket s        -- same instance: one Solver group

Share the group-wide modifiers the same way: one Gravity, one Collision and one Self Collision instance across the Solver group. Tnpix Forces acts per garment: each garment is pushed by its own, and one instance shared across the Solver group pushes them alike. Group-wide settings have one value for the Solver group; where two members carry different values, the member created first (lowest node handle) wins, whichever object evaluates first. The Tear is the exception: its group-wide settings come from all the Solver group's Tears (a Map Tear before a Pressure Tear before a Stretch Tear, then the lowest Threshold). Per-garment settings (painted channels and everything bound to them, an Advanced material without a channel, pins, a Preserve, stitches, the Tear's region, Forces, Volume, Rigid, Soft Body, Garment, Threads) are read from each object. Channels are merged by name across the Solver group: give each garment's channels their own names. A change on any member re-solves the whole Solver group.

The garments take their places in the Solver group in the order 3ds Max first evaluates them, and that order gives each garment without a layer of its own its self-collision layer. TnpixTool.selfColLayers reads it (Chapter 4).