RESOLVED: Parameter Execute DAT default script

In the latest build the default for on value change is:

def onValueChange(par, prev):
return

Surely this should be:

def onValueChange(par, val, prev):
return

Either form will work, but we’ve changed the behavior of the new, shorter form, to address an issue with Parameter toggle values.
These were presenting val + prev values as strings “on” and “off” instead of booleans True, and False.

We left support for the older format for backward compatibility.
With the new format, you can use par.eval() for the current value.

Cheers,
Rob.

In simple cases you can even use just “par”, because of its contextual behavior.

We’re putting this in the comment for Parameter Execute DAT, so nobody gets messed up in the future:

def onValueChange(par, prev):
# use par.eval() to get current value
return