Skip to content

Instantly share code, notes, and snippets.

@raganmd
Created February 7, 2022 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raganmd/1bc0d7ed83c91969cfdd472a927f9cf9 to your computer and use it in GitHub Desktop.
Save raganmd/1bc0d7ed83c91969cfdd472a927f9cf9 to your computer and use it in GitHub Desktop.
TouchDesigner is par default script DAT
# me - this DAT
# scriptOp - the OP which is cooking
#
# press 'Setup Parameters' in the OP to call this function to re-create the parameters.
def onSetupParameters(scriptOp):
page = scriptOp.appendCustomPage('Custom')
p = page.appendOP('Targetop', label='Target Operator')
return
# called whenever custom pulse parameter is pushed
def onPulse(par):
return
def onCook(scriptOp):
scriptOp.clear()
rows = []
header = ['par', 'default_val', 'non_default_val']
rows.append(header)
for each_par in op(scriptOp.par.Targetop.eval()).pars():
default = each_par.isDefault
current_val = each_par.val
name = each_par.name
print(name)
if not default:
rows.append([name, each_par.val, current_val])
else:
pass
for each_row in rows:
scriptOp.appendRow(each_row)
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment