Skip to content

A TouchDesigner tox asset used to load immutable config variables from an external file

License

Notifications You must be signed in to change notification settings

JohnENoonan/touch-env-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TouchDesigner Environment Variable Loader

This is a tox asset used to load immutable config variables from an external file

Usage

This tool can be used to load either a json file or a delimited env file. Example files are example.env and example.json

API

op.env.Get("VARIABLE_NAME") # returns None if key is not present, else a td.Cell object
op.env.Exists("VARIABLE_NAME") # returns boolean

Callbacks

Callbacks are available from the docked dat. The function processEnv will be called on every update to the script or to the input env file. You can edit the dat in place and make any changes needed.

JSON Syntax

Loading a json file supports all types except for arrays. In the event of an array it will be processed as a string. For example

{
	"test" : [1, 2, 3]
}

will be evaluated as

Test [1, 2, 3]

About

A TouchDesigner tox asset used to load immutable config variables from an external file

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages