My rather complex scopes plugin has quite a few parameters, which I've grouped using topics to keep things neat. The user can choose which scopes to turn on-or-off using a checkbox for each. Turning a checkbox on shows the group of parameters; turning it off hides the group of parameters. I use code like this in a function called from PF_Cmd_USER_CHANGED_PARAM andPF_Cmd_UPDATE_PARAMS_UI:
AEGP_StreamRefH wfm_streamH = NULL;
A_Boolean hide_wfmB = !params[QPGA_SCOPE_OPTION_WFM]->u.bd.value; // Set hide_wfmB to the inverse of the checkbox value
AEGP_EffectRefH meH = NULL;
AEGP_SuiteHandler suites(in_data->pica_basicP);
ERR(suites.PFInterfaceSuite1()->AEGP_GetNewEffectForEffect(NULL, in_data->effect_ref, &meH));
// Example - Waveform monitor only, but in the code for real there's one of these for each of the five scope groups
ERR(suites.StreamSuite2()->AEGP_GetNewEffectStreamByIndex(NULL, meH, QPGA_WFM_TOPIC_START, &wfm_streamH));
// etc...
// Toggle visibility of parameters
ERR(suites.DynamicStreamSuite2()->AEGP_SetDynamicStreamFlag(wfm_streamH, AEGP_DynStreamFlag_HIDDEN, FALSE, hide_wfmB));
// etc...
if (meH){
ERR2(suites.EffectSuite2()->AEGP_DisposeEffect(meH));
}
if (wfm_streamH){
ERR2(suites.StreamSuite2()->AEGP_DisposeStream(wfm_streamH));
}
// etc...
This works fine whenever the checkbox is toggled, however the problem arises if I save my effect instance as an effect preset. When I apply the preset to a new layer, for example, I get all of the parameters in the hidden groups showing up minus their group topics, when they should be hidden away. These two images show what the controls should look like, and what they do look like:
Desired result:
![qpga_params_correct.jpg]()
Actual result if applying via an effect preset:
![qpga_params_incorrect.jpg]()
The params between the red lines are those from the other four groups that shouldn't be displayed.
I hope this makes sense. My hunch is that I need to turn on-or-off *every* parameter within a group. This will require a lot of stream ref handles though and seems a bit inelegant/inefficient!
One thing I'm not doing is using sequence data - I did try this as it was part of the example project (Supervisor, I think), but it didn't affect the outcome. I figured sequence data was a red herring here anyway.
Thanks in advance!
Christian