Chapter 4 · The TnpixTool Interface

4.6Material Standard

The Standard material keeps its values in a record, so they are read and written by name; Appendix A lists the names. Writing a value also marks it as set, which is what makes it act.

FunctionReturnsWhat it does
goldCount nodeintegerHow many Standard materials the stack carries.
goldAt node indexstringThe material's values, as text.
goldSetAt node index field valuebooleanSets one value by name. An unknown name is refused and nothing is written; so is a bendQuadK outside 0 to 100.
goldClearAt node index fieldbooleanClears the tick of matFriction, matGrip or strainRateLimit and keeps the number, as unticking does. Other names are refused.
goldChanAt node index channelbooleanBinds the material to a channel; "" = the whole garment.
goldPreset node indexbooleanApplies stock fabric index (0–11, Appendix A) to the first Standard material. It writes only the values the fabric carries.
goldSet node field value / goldChan node channelbooleanThe same as goldSetAt / goldChanAt on the first Standard material.
TnpixTool.goldPreset $Shirt 1                     -- Silk onto the first Standard material
TnpixTool.goldSetAt  $Shirt 0 "densityAll" 0.3
TnpixTool.goldSetAt  $Shirt 1 "bendGoldK" 12.0     -- the second Standard material
TnpixTool.goldChanAt $Shirt 1 "sleeves"
TnpixTool.goldClearAt $Shirt 1 "matFriction"
TnpixTool.goldAt     $Shirt 1