Adjusting params when plugin applied for the 1st time
Hello,
When my plugin is applied for the first time on a layer, I need to set 4 points parameters at corners of the layer. As an example, I initialize the lower right corner like this :
// Lower Right Corner
paramID = ...;
AEFX_CLR_STRUCT(def);
PF_ADD_POINT("LR Corner", 100, 100, 0, paramID);
The problem with this approach is that the lower right corner is initialized to [layer_width, layer_height] and that is not a valid coordinate. How can I make it initialize
to [layer_width - 1, layer_height - 1] ?
I tried doing it during PF_Cmd_UPDATE_PARAMS_UI call but the values do not stick:
PF_ParamDef def;AEFX_CLR_STRUCT(def);
def = *params[paramIndex];
def.u.td.x_value = FLOAT2FIX(layer_width - 1);
def.u.td.y_value = FLOAT2FIX(layer_height - 1);
def.uu.change_flags = PF_ChangeFlag_CHANGED_VALUE;
paramUtilSuiteP->PF_UpdateParamUI(in_data->effect_ref, (PF_ParamIndex)paramIndex, &def);
thank you,