Copy link to clipboard
Copied
Hi, everyone!
I have an issue with PF_ADD_POPUP param in managing version of plugins.
In my params, the first param is PF_ADD_POPUP on version 1.
I am going to add few more paramers on version 2.
If the order should be changed on UI. the value is not keeping.
I used same IDs of old params always.
version 1.
enum
{
MOVEMENT_DIRECTION,
AMOUNT_SLIDER,
MATRANSIT_NUM_PARAMS
};
enum
{
MOVEMENT_DIRECTION_ID, // PF_ADD_POPUP
AMOUNT_SLIDER_ID,
};
version 2:
enum
{
NEW_FIELD_SLIDER,
MOVEMENT_DIRECTION,
AMOUNT_SLIDER,
MATRANSIT_NUM_PARAMS
};
enum
{
MOVEMENT_DIRECTION_ID,
AMOUNT_SLIDER_ID,
NEW_FIELD_SLIDER_ID
};
This problem is appearing only if first param is PF_ADD_POPUP on old version.
Please let me know if it is my issues or premiere pro problem.
Thanks.
i see...
i checked in my plug-ins, and i see i start the _ID enums with the value 1 instead of 0.
peraps using the value 0 on the first param triggers the auto-assign thingie you mentioned, regadless of having non-0 values on the subsequent params...
you'll need to test to check.
if that is the case, then you might have an issue with re-ordeirng params for existing projects saved with the old version... (better fix it on an early version rather than on a late one, or consider shipping both ver
...Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks for your replay
I can see following as:
if it was zero, it was assumed that the programmer hadn’t bothered to ID params; After Effects then assigned each its own ID. This assumption works fine if you never set param IDs, but not so well if you start numbering your IDs from NULL. That’s why.
enum
{
MOVEMENT_DIRECTION_ID,
AMOUNT_SLIDER_ID,
NEW_FIELD_SLIDER_ID
};
The first parameter id is set by 0 as you can see on enum.
In the case, how can we keep original values on new version?
Thanks.
Copy link to clipboard
Copied
let's make sure about getting the basics right...
when declaring each param, do you use the _ID enum?
PF_SLIDER(..., AMOUNT_SLIDER_ID)
or do you use the non _ID enum?
Copy link to clipboard
Copied
Thanks for your replay.
PF_SLIDER(..., AMOUNT_SLIDER_ID)
I am using the _ID enum.
Thanks.
Copy link to clipboard
Copied
then perhaps the problem is in the reading of the data and not it's storage...
in the NON _ID enum, the first param's enum value should be 1.
value 0 is reserved to the default invisible layer param that serves as the effect's input. perhaps that's the problem?
Copy link to clipboard
Copied
in .cpp
static PF_Err ParamsSetup(
PF_InData* in_data,
PF_OutData* out_data,
PF_ParamDef* params[],
PF_LayerDef* output)
{
PF_ParamDef def;
AEFX_CLR_STRUCT(def);
PF_ADD_BUTTON(
STR(StrID_Login_Param_Name),
STR(StrID_Login_Button_Name),
0,
PF_ParamFlag_SUPERVISE,
LOGIN_ID
);
AEFX_CLR_STRUCT(def);
PF_ADD_POPUP(STR(StrID_MovementDirection_Param_Name),
4,
1,
STR(StrID_MovementDirection_Param),
MOVEMENT_DIRECTION_ID);
AEFX_CLR_STRUCT(def);
PF_ADD_SLIDER(
STR(StrID_Amount_Param_Name),
0,
100,
0,
100,
30,
AMOUNT_SLIDER_ID);
....
in .H file
enum
{
SHIFTERBOUNCE_INPUT = 0,
LOGIN,
MOVEMENT_DIRECTION,
AMOUNT_SLIDER,
....
};
enum
{
MOVEMENT_DIRECTION_ID,
AMOUNT_SLIDER_ID,
LOGIN_ID,
....
Thanks.
Copy link to clipboard
Copied
Above code is for new version.
There is no the LOGIN parameters on old version.
Copy link to clipboard
Copied
i see...
i checked in my plug-ins, and i see i start the _ID enums with the value 1 instead of 0.
peraps using the value 0 on the first param triggers the auto-assign thingie you mentioned, regadless of having non-0 values on the subsequent params...
you'll need to test to check.
if that is the case, then you might have an issue with re-ordeirng params for existing projects saved with the old version... (better fix it on an early version rather than on a late one, or consider shipping both versions with the old one flagged OBSOLETE, so old projects use the old version and new applications of the effect will use the new version)
Copy link to clipboard
Copied