Skip to content

Instantly share code, notes, and snippets.

@raganmd
Last active November 25, 2022 19:53
Show Gist options
  • Save raganmd/9a6ea5558b9c38d2ec986794b3648533 to your computer and use it in GitHub Desktop.
Save raganmd/9a6ea5558b9c38d2ec986794b3648533 to your computer and use it in GitHub Desktop.
TouchDesigner | Set Custom Pars to Defaults
def reset_defaults(touch_designer_operator:OP) -> None:
# get our custom parmameters for an operator
custom_pars = touch_designer_operator.customPars
# loop through all pars and reset them to their defaults
for each_par in custom_pars:
touch_designer_operator.par[each_par.name] = each_par.default
# to use this function, you pass in an operator - below is an example of how
# to reset the custom pars on an operator called `base1`
reset_defaults(op("base1"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment