Copy link to clipboard
Copied
I would like to change a slider to match the size of the input data. These are not defined at setup time, so I try to change them in UpdateUI (I have also tried ParamChange).
The problem is that I cannot change the valid_min/valid_max values and they remain stuck at whatever value setup in ParamsSetup.
I use the following code to change my slider:
PF_ParamDef centerParams = *(params[PARAM_S_PROTECTED_CENTER]);
centerParams.u.fs_d.valid_max = (PF_FpShort)in_data->width;
centerParams.uu.change_flags = PF_ChangeFlag_CHANGED_VALUE;
ERR(suites.ParamUtilsSuite3()->PF_UpdateParamUI(in_data->effect_ref, PARAM_S_PROTECTED_CENTER , ¢erParams));
This does nothing for valid_max, am I missing something, or is just not possible?
Help is greatly appreciated 🙂
Hi Rasmus,
Are you developing your effect plug-in for use in After Effects? Or Premiere Pro?
According to the header comments for PF_UpdateParamUI() in AE_EffectSuites.h, valid_min/max are not among the parameters that can be changed.
AE holds strictly to this specification. PPro is more flexible in this regard (I can explain, if you are developing for PPro).
You could define the min/max to be the widest possible range, and then use PF_UpdateParamUI() to set the UI range dynamically, according to
...Copy link to clipboard
Copied
Hi Rasmus,
Are you developing your effect plug-in for use in After Effects? Or Premiere Pro?
According to the header comments for PF_UpdateParamUI() in AE_EffectSuites.h, valid_min/max are not among the parameters that can be changed.
AE holds strictly to this specification. PPro is more flexible in this regard (I can explain, if you are developing for PPro).
You could define the min/max to be the widest possible range, and then use PF_UpdateParamUI() to set the UI range dynamically, according to the input data.
Zac
Copy link to clipboard
Copied
Thanks, it is for both AE and Pr.
I can probably do as you suggest, set the slider values dynamically and then make a check on the actual value to make sure it does not exceed the slider values.
Copy link to clipboard
Copied
Thanks for the help, I thought I could create a workaround as you suggested.
To keep the value in check (within slider min max) I would need to be able to update the slider value, which is not possible.
I ended up using a percentage, which I can then use in accordance with the input width.