Copy link to clipboard
Copied
I was experimenting with the SDK's parameters to improve my plugin user experience. Basically, I just want some settings to be collapsed in an "advanced settings" section.
To do so I used the PF_ADD_TOPIC and PF_END_TOPIC macros. The topic is well displayed in premiere in the effects pannel, but all the settings within the topic's section have a value of zero during the execution of the program, no matter the parameters within the section.
static PF_Err
ParamsSetup (
PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *output )
{
PF_Err err = PF_Err_NONE;
PF_ParamDef def;
AEFX_CLR_STRUCT(def);
PF_ADD_FLOAT_SLIDERX(
STR(StrID_Ratio_Param_Name),
TINTER_RATIO_MIN,
TINTER_RATIO_MAX,
TINTER_RATIO_MIN,
TINTER_RATIO_MAX,
TINTER_RATIO_DFLT,
PF_Precision_TENTHS,
PF_ValueDisplayFlag_PERCENT,
PF_ParamFlag_RESERVED1,
RATIO_DISK_ID
);
AEFX_CLR_STRUCT(def);
PF_ADD_COLOR(
STR(StrID_Color_Param_Name),
TINTER_DEFAULT_RED,
TINTER_DEFAULT_GREEN,
TINTER_DEFAULT_BLUE,
COLOR_DISK_ID
);
AEFX_CLR_STRUCT(def);
PF_ADD_TOPIC(
STR(StrID_Debug_Topic),
DEBUG_TOPIC_DISK_ID
);
AEFX_CLR_STRUCT(def);
PF_ADD_FLOAT_SLIDER(
STR(StrID_Border_Width),
BORDER_MIN_WIDTH,
BORDER_MAX_WIDTH,
BORDER_MIN_WIDTH,
BORDER_MAX_WIDTH,
AEFX_AUDIO_DEFAULT_CURVE_TOLERANCE,
BORDER_DEFAULT_WIDTH,
PF_Precision_INTEGER,
PF_ValueDisplayFlag_PIXEL,
PF_FSliderFlag_NONE,
BORDER_WIDTH_DISK_ID
);
AEFX_CLR_STRUCT(def);
PF_END_TOPIC(
DEBUG_TOPIC_DISK_ID
);
AEFX_CLR_STRUCT(def);
out_data->num_params = PLUGIN_NUM_PARAMS;
return err;
}Here is the related part of my header file :
#define TINTER_RATIO_MIN 0
#define TINTER_RATIO_MAX 100
#define TINTER_RATIO_DFLT 50
#define TINTER_DEFAULT_RED 255
#define TINTER_DEFAULT_GREEN 255
#define TINTER_DEFAULT_BLUE 255
#define BORDER_MIN_WIDTH 0
#define BORDER_MAX_WIDTH 0
#define BORDER_DEFAULT_WIDTH 5
enum {
// Always keep first
PLUGIN_INPUT = 0,
// Effect settings
TINTER_RATIO,
TINTER_COLOR,
// Debug settings
BORDER_WIDTH,
// Always keep last
PLUGIN_NUM_PARAMS
};
enum {
// Effect settings
RATIO_DISK_ID = 1,
COLOR_DISK_ID,
// Debug settings
BORDER_WIDTH_DISK_ID,
// Topics
DEBUG_TOPIC_DISK_ID,
};Can someone tells me / spots / knows what am I doing wrong ? If you also have used this parameter in the passed, I am interested in working code snippets.
You should have a unique ID for begin and end, and you need to have it in both enums:
enum
{
SKELETON_INPUT = 0,
SKELETON_DEBUG_BEGIN,
SKELETON_DEBUG_LEFT,
SKELETON_DEBUG_TOP,
SKELETON_DEBUG_RIGHT,
SKELETON_DEBUG_BOTTOM,
SKELETON_DEBUG_END,
SKELETON_NUM_PARAMS
};
enum
{
DEBUG_BEGIN_ID = 1,
DEBUG_LEFT_ID,
DEBUG_TOP_ID,
DEBUG_RIGHT_ID,
DEBUG_BOTTOM_ID,
DEBUG_END_ID,
};
Copy link to clipboard
Copied
Update
Someone on another forum mentionned that the topic begin and end's ids had to be different. But I tried it, and it didn't solve the issue.
Copy link to clipboard
Copied
Hi anatole,
Thanks for the message. Unfortunately, crafting an expression for you is a bit outside my expertise. I hope that a dev or community member will come along soon, though. Sorry to ask for your patience.
Thanks,
Kevin
Copy link to clipboard
Copied
No problem, thanks for anwsering anyway!
Copy link to clipboard
Copied
You should have a unique ID for begin and end, and you need to have it in both enums:
enum
{
SKELETON_INPUT = 0,
SKELETON_DEBUG_BEGIN,
SKELETON_DEBUG_LEFT,
SKELETON_DEBUG_TOP,
SKELETON_DEBUG_RIGHT,
SKELETON_DEBUG_BOTTOM,
SKELETON_DEBUG_END,
SKELETON_NUM_PARAMS
};
enum
{
DEBUG_BEGIN_ID = 1,
DEBUG_LEFT_ID,
DEBUG_TOP_ID,
DEBUG_RIGHT_ID,
DEBUG_BOTTOM_ID,
DEBUG_END_ID,
};
Copy link to clipboard
Copied
Hi James, thanks for you awnser !
I have checked my code and it seems the problem was not coming from the topic, but from the float sliders... I tried a topic with a color parameter in it, and it worked...
Even so, I'll mark your awnser as correct since I didn't know you had to use two unique Ids for the begin and end topic.
I noticed that you placed the parameter ids between the topic's ids inside the enum. Is it mendatory for it to work well, or is it for readability ?
Copy link to clipboard
Copied
Hi!
In the first enum, the order has to match the order in params setup. So in that enum the params need to be inside the topic. You can make empty topics (begin + end) to serve as plain text params, and they won't be twirlable if there's no params inside them.
Copy link to clipboard
Copied
I tested it out, and it worked out great ! Thank you very much for your help !
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more