Skip to main content
Lazlo_Hollyfeld
Inspiring
July 29, 2013
Answered

Not sure why I get parameter count mismatch with param group.

  • July 29, 2013
  • 1 reply
  • 2859 views

Hi Again,

So, for all you regulars out there, I'm sure you're getting tired of my questions.  I'm in the thick of development with AE plugs, so I'll probably be here more often than you'd like!

I'm having trouble understanding why I'm getting a parameter count mismatch error when I group some parameters with PF_ADD_TOPIC().

Here is the enum I have in my .h file:

enum {

    MY_TOPIC_LAYER_START,

    MY_ENABLE_LAYER,

    MY_FORM,

    MY_TOPIC_LAYER_END,

    MY_NUM_PARAMS

};

Here is the code I have in my ParamsSetup():

{

          PF_Err                    err                    = PF_Err_NONE;

          PF_ParamDef          def;

    AEFX_CLR_STRUCT(def);

    PF_ADD_TOPIC("Options", MY_TOPIC_LAYER_START);

        AEFX_CLR_STRUCT(def);

        PF_ADD_CHECKBOXX("Enable Layer", true, PF_ParamFlag_CANNOT_TIME_VARY, MY_ENABLE_LAYER);

        AEFX_CLR_STRUCT(def);

        PF_ADD_LAYER("Form Group", 0, MY_FORM);

    AEFX_CLR_STRUCT(def);

    PF_END_TOPIC(MY_TOPIC_LAYER_END);

    printf("\nMy Plugin has %d parameters",MY_NUM_PARAMS);

          out_data->num_params = MY_NUM_PARAMS;

          return err;

}

So, why am I getting a parameter count mis-match error?  What do I need to change?

Thanks!

This topic has been closed for replies.
Correct answer Lazlo_Hollyfeld

Well I googled around a bit and found this thread with the same question asked by the one and only Andrew Kramer way back in 2007. He solved it by adding one the the out_data->num_params value.  It also worked for me, although I really don't see that being done in the Paramarama example.  What gives?  If I do:

out_data->num_params = MY_NUM_PARAMS + 1;

The plugin runs fine and I don't get any mismatch count errors.  By I'd like to understand why.  The user bbb (who I also see throughout the comments in the SDK) states:

...because every plug-in gets an input layer as params[0].

Well, I suppose that could have been useful information placed in the SDK documentation when discussing implemeting parameters.  So, why is it that the examples do not need to +1 their out_data->num_params?

1 reply

Lazlo_Hollyfeld
Lazlo_HollyfeldAuthorCorrect answer
Inspiring
July 30, 2013

Well I googled around a bit and found this thread with the same question asked by the one and only Andrew Kramer way back in 2007. He solved it by adding one the the out_data->num_params value.  It also worked for me, although I really don't see that being done in the Paramarama example.  What gives?  If I do:

out_data->num_params = MY_NUM_PARAMS + 1;

The plugin runs fine and I don't get any mismatch count errors.  By I'd like to understand why.  The user bbb (who I also see throughout the comments in the SDK) states:

...because every plug-in gets an input layer as params[0].

Well, I suppose that could have been useful information placed in the SDK documentation when discussing implemeting parameters.  So, why is it that the examples do not need to +1 their out_data->num_params?

Community Expert
July 31, 2013

well, notice that the enumration of the param names usually starts with 1 and not 0. i.e.:

enum {

     PARAM_YO = 1,

     PARAM_MAMA,

     NUM_PARAMS

};

so num params now equals 3, which is the number of added params, plus the default layer input.

some examples start with an "input" entry at the enumration with, and give ti the value 0, thus ending up with the same end result.

that's all there is to it.