Skip to content

Instantly share code, notes, and snippets.

@raganmd
Created May 7, 2019 02:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save raganmd/3edfd21ac9a0d3c73e5a0c84517a9c49 to your computer and use it in GitHub Desktop.
import json
# import TouchDesigner JSON modules
TDJ = op.TDModules.mod.TDJSON
# list comprehension to narrow our scope to only the custom page we want
target_page = [page for page in op('base_example').customPages if page == 'Test']
# convert pars into json
json_page_pars = TDJ.pageToJSONDict(target_page[0])
# pretty print our json
pretty_pars = json.dumps(json_page_pars, indent=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment