Usage of AEGP_EffectCallGeneric() / PF_Cmd_COMPLETELY_GENERAL
Trying to trigger an effect function from outside the effect. I apply both effects to a layer, and then trigger the message, but it's not recieved on the other end.
I believe I'm able to send AEGP_EffectCallGeneric() correctly by targeting the right layer (following the ProjDumper / Shifter examples), but I'm not able to trigger the other effect with PF_Cmd_COMPLETELY_GENERAL.
Am I missing a step here? Thanks!
Effect A (to send command):
[.........]
A_long num_effectsL, num_paramsL;
A_char effect_nameAC[AEGP_MAX_ITEM_NAME_SIZE] = { '\0' };
AEGP_LayerH layerH = NULL;
AEGP_CompH compH = NULL;
AEGP_EffectRefH effectH = NULL;
AEGP_ItemH comp_itemH = NULL,
active_itemH = NULL;
AEGP_CompH parent_compH;
AEGP_LayerIDVal id;
AEGP_ItemType item_type = AEGP_ItemType_NONE;
ERR(suites.ItemSuite8()->AEGP_GetActiveItem(&active_itemH));
if (active_itemH) {
ERR(suites.ItemSuite8()->AEGP_GetItemType(active_itemH, &item_type));
}
if (!err) {
if (AEGP_ItemType_COMP == item_type) {
A_long layer_indexL = 0;
FILE *out;
AEGP_LayerH layerH = NULL;
AEGP_CompH compH = NULL;
ERR(suites.CompSuite4()->AEGP_GetCompFromItem(active_itemH, &compH));
ERR(suites.LayerSuite5()->AEGP_GetCompLayerByIndex(compH, layer_indexL, &layerH));
//AEGP_GetLayerFromLayerID()
ERR(suites.EffectSuite2()->AEGP_GetLayerNumEffects(layerH, &num_effectsL));
for (A_long jL = 0; !err && jL < num_effectsL; jL++) {
ERR(suites.EffectSuite2()->AEGP_GetLayerEffectByIndex(S_my_id, layerH, jL, &effectH));
if (!err && effectH) {
AEGP_InstalledEffectKey key;
ERR(suites.EffectSuite2()->AEGP_GetInstalledKeyFromLayerEffect(effectH, &key));
ERR(suites.EffectSuite2()->AEGP_GetEffectName(key, effect_nameAC));
if (!strcmp(effect_nameAC, "Effect B")) {
A_Time fake_timeT = { 0, 100 };
// Message Sending Correctlyerr = suites.EffectSuite2()->AEGP_EffectCallGeneric(S_my_id, effectH,
&fake_timeT, (void*)"Message");
}
}
}
}
}
[.........]
Effect B (to receive command):
[.........]
RespondtoAEGP (
PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *output,
void* extraP)
{
PF_Err err = PF_Err_NONE;
AEGP_SuiteHandler suites(in_data->pica_basicP);
suites.ANSICallbacksSuite1()->sprintf( out_data->return_msg,
"%s",
reinterpret_cast<A_char*>(extraP));
PF_STRCPY( out_data->return_msg,
STR(1234));
out_data->out_flags |= PF_OutFlag_DISPLAY_ERROR_MESSAGE;
return err;
}
[.........]
EffectMain(
PF_Cmd cmd,
PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *output,
void *extra)
{
PF_Err err = PF_Err_NONE;
try
{
switch (cmd)
{
// This is not getting triggered
err = RespondtoAEGP(in_data,
out_data,
params,
output,
extra);
break;
[.........]
