Skip to main content
Inspiring
July 26, 2023
Answered

AE Custom UI Event -- which parameter is it for?

  • July 26, 2023
  • 1 reply
  • 349 views

Several SDK samples show custom parameter UI, but they only have 1 each. And that assumption is baked into the handler (see below).

Is there a way to know in PF_Event_DRAW or PF_Event_DO_CLICK which parameter is receiving that event? it must be here...

Here's how the SDK samples do it... they just assume which parameter it is!

PF_Err DoDrag(PF_InData	*in_data, PF_OutData *out_data,	PF_ParamDef *params[], PF_LayerDef		*output, PF_EventExtra*event_extra)
{
...
...
    // params index hard coded! wont work
    // for two custom params, will it :(
    params[ECW_UI_COLOR]->u.cd.value.blue = someValue
...
...
}
This topic has been closed for replies.
Correct answer James Whiffin

Hi David

 

In Handle Event you can see which effect index it is, and then delegate specific code for each:

PF_Err
HandleEvent(
            PF_InData        *in_data,
            PF_OutData        *out_data,
            PF_ParamDef        *params[],
            PF_LayerDef        *output,
            PF_EventExtra    *extra)
{
    
    PF_Err            err     = PF_Err_NONE;

    if (extra->effect_win.index == SS3_GRAD)

 

1 reply

James Whiffin
James WhiffinCorrect answer
Legend
July 27, 2023

Hi David

 

In Handle Event you can see which effect index it is, and then delegate specific code for each:

PF_Err
HandleEvent(
            PF_InData        *in_data,
            PF_OutData        *out_data,
            PF_ParamDef        *params[],
            PF_LayerDef        *output,
            PF_EventExtra    *extra)
{
    
    PF_Err            err     = PF_Err_NONE;

    if (extra->effect_win.index == SS3_GRAD)

 

Inspiring
July 27, 2023

perfect, whew, thankyou!