function-store / FunctionStore_tools

TouchDesigner workflow tools and UX improvements and more
MIT License
136 stars 0 forks source link

Custom Par Promoter only sets default for first par in a ParGroup #14

Closed RaphiePS closed 6 months ago

RaphiePS commented 6 months ago

Hiya! I would submit a pull request, but Toxes aren't the most GitHub friendly format. Let me know if there's a better way to contribute than the following.

I've found that when promoting a custom par, sometimes (weirdly, only sometimes) only the first parameter in a group will get the correct default value promoted. It seems to happen when the pargroup being promoted is itself promoted from a child OP's built-ins.

Adding this to customParPromoterExt after line 91 (new_pars = new_par.pars()) seems to do the trick:

for i, old_par in enumerate(pg):
  new_pars[i].val = old_par.val
  new_pars[i].default = old_par.default

Thanks for all your work on these great tools!

function-store commented 6 months ago

lovely, thanks a lot I will include this fix in the next release!