Chapter 1 · Purpose and connection

1.3Working through the connection

  • Calls share one session. Every call runs in the same 3ds Max session, so functions and variables defined at the top level stay until 3ds Max closes. Wrap a multi-line script in ( ... ) to keep its locals inside it. Some servers add those brackets themselves and refuse a script that already starts with one; with such a server, send the script without its outer pair.
  • Return text as the script's value. Build a string and make it the last expression. Lines printed to the Listener may not reach you.
  • Check every return value. A TenPix call that refuses writes nothing and returns false, -1, or a string that begins with *** or refused:. A refusal is never a silent success.
  • Make each change one undo step. Wrap it as undo "TenPix: <what>" on ( ... ) so the artist can take it back with Ctrl+Z. Functions that change something can be undone wherever the same change made on the panel can.
  • Work in chunks. A call holds 3ds Max until it returns. Simulate a few dozen frames per call. Start long jobs only when the artist has said go: a cache save of a long range, a Batch Sim run.
  • Keep garments shown. 3ds Max does not evaluate a hidden object, so keep every garment of a Solver group shown.
  • Capture what the artist sees. Use their viewport and their camera. If you need to frame the cloth (max tool zoomextents all), say so first, because it changes their view.