SDK error: UpdateParamUI passed ParamDef of wrong type
Hi
I'm working on a plugin and using the Supervisor examble as base. I have a dropdown (SUPER_DROPDOWN_CYCLE) and a float slider (SUPER_SLIDER_CYCLE_SEED). The dorpdown have two values. Iterate and random. When I select iterate I want to disable the slider and when selecting random I want to disable the slider.
I have the code below, but I get this error: "After Effetcs Error: Internal verification failure, sorry! {UpdateParamUI() passed ParamDef of wrong type.}"
Any help?
Thanks,
Jakob
static PF_Err
UserChangedParam(
PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *outputP,
const PF_UserChangedParamExtra *which_hitP)
{
PF_Err err = PF_Err_NONE;
return err;
}
static PF_Err
UpdateParameterUI(
PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *outputP)
{
PF_Err err = PF_Err_NONE,
err2 = PF_Err_NONE;
my_global_dataP globP = reinterpret_cast<my_global_dataP>(DH(out_data->global_data));
my_sequence_dataP seqP = reinterpret_cast<my_sequence_dataP>(DH(out_data->sequence_data));
AEGP_StreamRefH flavor_streamH = NULL,
color_streamH = NULL,
slider_streamH = NULL,
checkbox_streamH = NULL;
PF_ParamType param_type;
PF_ParamDefUnion param_union;
A_Boolean hide_themB = FALSE;
AEGP_EffectRefH meH = NULL;
AEGP_SuiteHandler suites(in_data->pica_basicP);
// Before we can change the enabled/disabled state of parameters,
// we need to make a copy (remember, parts of those passed into us
// are read-only).
PF_ParamDef param_copy[SUPER_NUM_PARAMS];
ERR(MakeParamCopy(params, param_copy));
// Toggle enable/disabled state of Cycle Seed
// IF I LEAVE THIS NEXT PART OUT THERE WILL BE NO ERROR
if (!err &&
(CYCLE_ITERATE == params[SUPER_DROPDOWN_CYCLE]->u.pd.value)) {
param_copy[SUPER_SLIDER_CYCLE_SEED].param_type = PF_Param_FLOAT_SLIDER;
param_copy[SUPER_SLIDER_CYCLE_SEED].ui_flags &= ~PF_PUI_DISABLED;
ERR(suites.ParamUtilsSuite3()->PF_UpdateParamUI(in_data->effect_ref,
SUPER_SLIDER_CYCLE_SEED,
¶m_copy[SUPER_SLIDER_CYCLE_SEED]));
}
else if (!err &&
(CYCLE_RANDOM == params[SUPER_DROPDOWN_CYCLE]->u.pd.value) &&
(!(param_copy[SUPER_SLIDER_CYCLE_SEED].ui_flags & PF_PUI_DISABLED))) {
param_copy[SUPER_SLIDER_CYCLE_SEED].param_type = PF_Param_FLOAT_SLIDER;
param_copy[SUPER_SLIDER_CYCLE_SEED].ui_flags |= PF_PUI_DISABLED;
ERR(suites.ParamUtilsSuite3()->PF_UpdateParamUI(in_data->effect_ref,
SUPER_SLIDER_CYCLE_SEED,
¶m_copy[SUPER_SLIDER_CYCLE_SEED]));
}
return err;
}