When there are several toggle OP_NumericParameter’s their values are retrieved incorrectly when calling getParInt() in execute method.
I used CPlusCplusCHOP as an example. I’ve added the following code to setupParameters method:
{
OP_NumericParameter np;
np.name = "One";
np.label = "One";
np.defaultValues[0] = 1.0;
ParAppendResult res = manager->appendToggle(np);
assert(res == PARAMETER_APPEND_SUCCESS);
}
{
OP_NumericParameter np;
np.name = "Two";
np.label = "Two";
np.defaultValues[0] = 1.0;
ParAppendResult res = manager->appendToggle(np);
assert(res == PARAMETER_APPEND_SUCCESS);
}
And then, added this code to the execute method:
int one = inputs->getParInt("One");
int two = inputs->getParInt("Two");
inputs->enablePar("Speed", one == 1);
inputs->enablePar("Scale", two == 1);
However, “Speed” and “Scale” do not react properly when I change toggles. Am I misusing them?
Build x64 53040