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.
| Function | Returns | What it does |
|---|---|---|
goldCount node | integer | How many Standard materials the stack carries. |
goldAt node index | string | The material's values, as text. |
goldSetAt node index field value | boolean | Sets one value by name. An unknown name is refused and nothing is written; so is a bendQuadK outside 0 to 100. |
goldClearAt node index field | boolean | Clears the tick of matFriction, matGrip or strainRateLimit and keeps the number, as unticking does. Other names are refused. |
goldChanAt node index channel | boolean | Binds the material to a channel;
"" = the whole garment. |
goldPreset node index | boolean | Applies 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 channel | boolean | The 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