Storage

From TouchDesigner 099 Wiki

Each operator has an attached Python "storage" dictionary. Values stored in this dictionary are persistent, and saved with the operator. The storage dictionary contents may be manipulated directly with methods such as OP.fetch() or OP.store() described below, or examined with an Examine DAT.

The storage dictionary is accessible directly via n.storage. There are also a number of utility functions associated with storage, which can be found here: OP Storage.

Automatic Cooking

When an immutable element of storage changes, expressions that depend on it will automatically cook. For information about cooking of mutable elements (lists, dicts, sets), see deeply dependable collections.

Preserving in Files

Storage is saved with .toe and .tox files and loaded on startup.

Also see: StorageManager Class, Storage in OP_Class.