• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Usage of AEGP_EffectCallGeneric() / PF_Cmd_COMPLETELY_GENERAL

Community Expert ,
Mar 21, 2019 Mar 21, 2019

Copy link to clipboard

Copied

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):

[.........]

AEGP_SuiteHandler suites(in_data->pica_basicP);

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 Correctly

                    err = suites.EffectSuite2()->AEGP_EffectCallGeneric(S_my_id, effectH,

                                                            &fake_timeT, (void*)"Message");

                }

            }

        }

    }

}

[.........]

Effect B (to receive command):

[.........]

static PF_Err

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;

}

[.........]

PF_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)

        {

        case PF_Cmd_COMPLETELY_GENERAL:

            // This is not getting triggered

            err = RespondtoAEGP(in_data,

                out_data,

                params,

                output,

                extra);

            break;

[.........]

TOPICS
SDK

Views

983

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2019 Mar 21, 2019

Copy link to clipboard

Copied

there's a strange limitation with EffectCallGeneric. you can't call one

instance from another instance of the same effect.

for example, you can't call a blur from a blur. you can call a blur from a

levels.

is that your use case?

On Thu, Mar 21, 2019 at 8:29 PM justintaylor <forums_noreply@adobe.com>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2019 Mar 21, 2019

Copy link to clipboard

Copied

Thanks, I did see that mentioned in another post, but no that's not my use case. I'm sending the message from one effect to an entirely different effect.

Once I get this method working I want to call it from ExtendScript with ExternalObject as a DLL, but for now, I'm just trying to get it to work correctly in C++ space if that makes sense.

Think I'm just missing some step. Do you have to register PF_Cmd_COMPLETELY_GENERAL somehow before using it or should it work as long as it's listening for that option in EffectMain()?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2019 Mar 22, 2019

Copy link to clipboard

Copied

no, you don't need to register in any way, but let's check some silly

little detail?

does your plug-ins entry point respond to this selector? not all SDK

samples have that command defined in their call switch in the entry point

function...

On Thu, Mar 21, 2019 at 11:36 PM justintaylor <forums_noreply@adobe.com>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2019 Mar 22, 2019

Copy link to clipboard

Copied

Yes, I have the selector as an option on the switch in EffectMain() of Effect B ( see below ), but even when I set a break point at the EffectMain() switch, it isn't getting hit from the AEGP_EffectCallGeneric() from the other effect. However, when I debug Effect A, it appears that it's identifying Effect B, setting the reference, and running the call correctly...

[.........]

PF_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)

        {

        case PF_Cmd_COMPLETELY_GENERAL:

            // This is not getting triggered

            err = RespondtoAEGP(in_data,

                out_data,

                params,

                output,

                extra);

            break;

[.........]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 14, 2020 Aug 14, 2020

Copy link to clipboard

Copied

LATEST

@justintaylor Did you manage to fix this issue?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines