Copy link to clipboard
Copied
Hi,
Is there a (safe) way to dynamically add or remove items
from a popup-menu type parameter for an effect plugin?
Thanks.
No. Parameter setup, including populating pop-up lists, happens before the effect is applied to a sequence.
Copy link to clipboard
Copied
No. Parameter setup, including populating pop-up lists, happens before the effect is applied to a sequence.
Copy link to clipboard
Copied
BBB is right that you can't dynamically add or remove items from a popup menu. But you can rename the choices, and this might be all that is needed in some situations. Here's some code to demonstrate it, which would work in the Supervisor sample:
my_global_dataP globP = reinterpret_cast<my_global_dataP>(DH(in_data->global_data));
AEGP_SuiteHandler suites(in_data->pica_basicP);
AEGP_EffectRefH meH = NULL;
PF_ParamType param_type;
PF_ParamDefUnion param_union;
ERR(suites.PFInterfaceSuite1()->AEGP_GetNewEffectForEffect(globP->my_id, in_data->effect_ref, &meH));
ERR(suites.EffectSuite3()->AEGP_GetEffectParamUnionByIndex(globP->my_id, meH, SUPER_FLAVOR_DISK_ID, ¶m_type, ¶m_union));
if (param_type == PF_Param_POPUP)
{
strcpy((char*)param_union.pd.u.namesptr, "Chocolate|(-|Strawberry|(-|And more!");
}
if (meH){
ERR2(suites.EffectSuite2()->AEGP_DisposeEffect(meH));
}
Specifically, changing the number of items in the menu doesn't work, because modifying param_union.pd.num_choices doesn't seem to stick.Copy link to clipboard
Copied
Hi,
Is there a way to add or remove items from pop up menu dynamically? I'm asking this again because in 'Compound Blur' effect there is a pop up menu (Blur Layer) which shows all the layers in the project. As and when any layer is added/deleted the pop up menu is updated. If there is no way of doing it, then how is it done in Compound Blur?
Thanks & Regards,
Dheeraj.
Copy link to clipboard
Copied
Layer and Path parameters are the exceptions; the contents of other pop-ups are static, and cannot be changed during the AE session.
Copy link to clipboard
Copied
Thanks for the response.
Copy link to clipboard
Copied
You can also check the "Supervisor" sample in the SDK, it shows how to do it.