Last active
November 25, 2022 19:53
-
-
Save raganmd/9a6ea5558b9c38d2ec986794b3648533 to your computer and use it in GitHub Desktop.
TouchDesigner | Set Custom Pars to Defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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