[SOLVED] How to "reset all parameters" using Python script?

“Reset all parameters” is an option in the OP menu open by right-click. How to access it with Python?

Not sure if you can access that specific command, but this code would do the same thing I believe:

for p in op(<whatever>).pars():
	p.val = p.default
1 Like

Thanks, it works.

hi there

i need exactly that function associated with a custom parameter button “Reset” inside the same COMP.
but, i cant translate this code to this function of getting the default value of all custom parameters from the COMP associated with a Reset Button.

could somebody give me some light?
thank you!!!

Use a parameterExecute in the Component and point it to “Reset” button.
In the onPulse method you write:

for parameter in par.owner.customPars:
    parameter.val = parameter.default
1 Like

it is getting errors.
is everything ok with the code and with my setups below?

below is what i am doing:


(also tried with parexec1 inside video_1)

and, the code inside parexec1 is:

python is verry strict about tabs! Move the for loop one tab so it actually is inside the onPulse function.

2 Likes

now it has no errors! :slight_smile:
but not setting the parameters to default.

the parameter execute receives the message from the momentary button. but, not reaching the custom parameters to default. any ideas?

thank you!!

working with button Pulse.
custom parameter button momentary doesnt work with that function.

thank you for the help!