AEGP_EffectCallGeneric

Hello world!

I've got 2 effects, one that generates one mesh, the other is a rendering engine. To send my net, I use:

ERR (suites. EffectSuite2()-> AEGP_EffectCallGeneric (pluginID, effectH, & fake_timeT, (void *) meshT));

The rendering engine collects this mesh, store it in the sequence, and use it to return.

Everything works, but I noticed what looks like a memory problem:

Whenever the effect of mesh sends the data, the memory used by the AE increases and does not return to a lower level.

I don't know that the rendering engine is not responsible (this also happens when it is turned off or délettrée).

Side effect of mesh, I tried not to calculate what anyone and simply send an empty mesh (I mean 2 triangles filled with zeros), and it still happens...

Everyone has noticed this problem before? Is there something that I am missing with AEGP_EffectCallGeneric?

See you soon,.

François

Phew... glad you found the error...

your second question is not really a matter of "copy", but rather a

property/planning issue. (of all kinds)

Let's ignore the face you pass it the first world as a pointer and that

you want to keep somewhere else.

is what you're really saying, "I have this world that I want to store.

somewhere. How can I copy it in the place of storage? »

IMHO, it's the wrong way to look at this, and here's why:

1. the PF_EffectWorld structure does not contain the pixel data.

PF_EffectWorld-> data is only a pointer the the current buffer.

is that you do the following:

PF_EffectWorld a;

B PF_EffectWorld;

a = b;

you will have two structures of the separate world, both pointing to the same bit of

memory where the pixels are stored.

2. the pixel are given not create nor destroyed when the PF_EffectWorld is

created or destroyed.

It is simply a wrapper, referring to an AEGP_WorldH. the AEGP_WorldH is a

handle to an opaque data structure that AE allocates owner.

you ask EI for the assignment of this buffer using:

Suites. WorldSuite3()-> AEGP_New();

You can to create an equivalent of PF_EffectWorld using:

Suites. WorldSuite3()-> AEGP_FillOutPFEffectWorld();

It does not create a copy of the pixel buffer. It will just create a

PF_EffectWorld pointing to the same pixel buffer.

removal of the PF_EffectWorld release of the pixel buffer. only the

use of the suites. WorldSuite3()-> AEGP_Dispose() will free up the buffer.

in this case, even if you keep the PF_EffectWorld, he will then point to

invalid data.

so now, it's a question of who runs this world you want to save. as long

as the inner AEGP_WorldH has not been eliminated, you can copy the

PF_EffectWorld a simple way, I showed in section 1.

who owns a particular universe? It's pretty simple to tell.

extractions of plugin effect during rendering layer (for example, the entry)

call the buffer, the output buffer and layer params) belong to the EA and will be

released during the call to render returns if you want to or not.

another time (what I think) where you will have a filled world, it is

your plug-in that manages and it is at you disposal when

you are finished.

AE, which has the world's then you can bet she'll get drawn form

under your feet at any time given. in this case, you have no choice but to copy

the pixel buffer. You probably want to use PF_COPY().

BUT!

to copy, you must first allocate a world to copy in. (this will solve

This issue of 'fixed size' you thought you had). Suppose that you want to copy

the entry stamp.

you'd probably do something like:

1. create a new AEGP_WorldH WorldSuite3()-> AEGP_New(). divide into

the width/height of the inputP.

2. wrap in a PF_EffectWorld to help

WorldSuite3()-> AEGP_FillOutPFEffectWorld().

3. copy the pixel form a buffer of data to another using PF_COPY(). you

fits the image if you like to use this call...

Now you can to send these data to some other plug-ins using the call effect

Generic. Just send in the AEGP_WorldH. (and possibly also the)

PF_EffectWorld)

in the sequence data the other plugin, you must have an AEGP_WorldH

variable to which you assign just the value of those sent since the

call of plug-ins, as follows:

seqDataWorldH = otherPluginWorldH;

You can now use the AEGP_FillOutPFEffectWorld again to fill a local!

PF_EffectWorld structure, or you can upgrade the already filled with structure

the vocation of the plug-in.

seqDataEffectWorld = otherPluginEffectWorld;

When you are finished with the pixels, just call WorldSuite3()-> AEGP_Dispose().

It doesn't matter what copy AEGP_WorldH you have one. they all reference to

the same handle in AE.

Make sure that you have only this one once...

and what of all the wrapped PF_EffectWorlds? nothing. Just leave their

go out of reach and out of mind.

TADA!

Friday, May 22, 2015 at 12:31, francois leroy [email protected]>

Tags: After Effects

Similar Questions

  • Get the version of the effect of CEAP

    Hi all

    Someone knows a way to query the version of the effect within the CEAP?

    Best regards

    Yuri

    Hi Yuri,

    You can use AEGP_EffectCallGeneric.

    You can pass any data, then your version of the effect can be part of.

    You can check this thread for more details:

    Architecture for effect and CEAP communication boards

    See you soon,.

    François

  • Programmatically create the puppet pin

    Hi all

    I would like to ask whether it is possible create programmatically puppet pins...

    I tried to copy the structure of water courses ("ADBE FreePin3", "ADBE FreePin3 Mesh", 'ADBE FreePin3 PosPin Position',...) pins created manually with

    corresponding values, but when I create, broadcast this way they are disabled (AEGP_DynStreamFlag_DISABLED - and greyed in the user interface).

    I assume that the Summit "index ADBE FreePin3 PosPin Vtx" is just an index in the table stored internally in the form of arbitrary data so that the mesh and the PIN must be created somehow before you set these values.

    I found this thread where they try to do the same thing using scripts (also unsuccessfully)Create of corner puppet on a mesh existing via script

    I have some ideas on how this could be done using the SDK, but all involve them diving into the dark waters...

    -call the method EffectSuite::AEGP_EffectCallGeneric with mouse fake click events (PF_Cmd_EVENT) or some directly if the effect of FreePin supports PF_Cmd_COMPLETELY_GENERAL orders

    -use 'FreePin Suite' - which is not a part of the public SDK but can be acquired using AquireSuite... - but as it is not public, I guess it works with a memory that's not so sure touch even if I managed to get/create file header appropriate for this suite

    Perhaps there is a simple and elegant to create those pins that I completely forgot, then I'd be really grateful for any suggestions

    Thank you very much!

    Martin

    Here, I just find a workaround...

    Step 1: save an animation preset with a puppet effect applied (with desired number of pine trees - but it does not matter where you place the pins)

    step 2: apply this preset to a layer (using AEGP_ExecuteScript ("app.project.item (index) .layer (index) .applyPreset (presetName) ;")) - which will add the puppet with pins effect

    step 3: change the flow of existing pine vertex offset values by using stream suite

    step 4: reset (Pines which will reload the State internal - will jump to the right place)

    step 5: change position of vertex streams using the suite of flow

    So all you need is a set of files .ffx with a different number of pins puppet used - because they cannot be added programmatically - but it is possible to modify existing ones...

    Thanks a lot for your support!

    See you soon,.

    Martin

  • Custom effect reset problem.

    Hello

    I'm having a problem with effect reset. In the custom effect, I have a SLIDER. Every time Reset is selected, the cursor returns to the default value. I understand that this is normal behavior but I want the slider to keep the old value before resetting.

    So is there a way to store the old just before resetting value so I can put it back after reset? Or is there a way to tell the effect is not to restore the particular setting?

    Thank you

    Dheeraj.

    hhhmmmm...

    You can't tell a param to ignore the reset.

    what you can do is to store these data with sequence data.

    and on SEQUENE_RESETUP you can re-apply this value.

    the SEQUENE_RESETUP call is quite rare, so you don't mind re - apply the value even if not necessary.

    If you use this param to what I think you use this param (unique identifier), then you can skip using a setting in General,

    and store this data in the sequence only data.

    If another effect wants to read these data can be done through AEGP_EffectCallGeneric().

    one last thing, you can try (which could be a tricky) is to define a different default value for this cursor when calling param_setup.

    That would cause each instance of your effect to reset this setting to a different value.

    but it's all in theory.

    I'm not even sure that you get several calls param_setup per session.

    just throwing some ideas out there.

  • Deliver the custom effect CEAP meets.

    Hello

    I checked the projects ProjectDumper-Shifter. I noticed that ProjectDumper communicates with leverage of speeds in

    Suites. EffectSuite2()-> AEGP_EffectCallGeneric (S_my_id, effectH, & fake_timeT, (void *) "ProjDumper say hello to Shifter");

    But when I tried to communicate my Cherie at checkout by using the AEGP_EffectCallGeneric call, I get not all reminders.

    In the project of the Fund, I'm handling PF_Cmd_COMPLETELY_GENERAL also. But when AEGP_EffectCallGeneric() is called Sweetie, I don't get the call to EntryPoint in fund project.

    This is sample code:

    In my dear Bill:

    A_Time fake_timeT = {0, 100};

    Suites. EffectSuite2()-> AEGP_EffectCallGeneric (S_my_id, / * > > * /)
    effectPH, / * > > * /.
    & fake_timeT, / / const A_Time * timePT, / * > > use the time base of the layer to which the effect is applied. */
    PF_Cmd_COMPLETELY_GENERAL, / * > > new version parameter 2 * /.
    (void *) "Hello");

    In the project of the Fund:

    DllExport
    PF_Err
    () EntryPointFunc
    PF_Cmd cmd,
    PF_InData * in_data,
    PF_OutData * out_data,.
    PF_ParamDef * params [],.
    PF_LayerDef * output,
    void * extraP)
    {

    PF_Err err = PF_Err_NONE;

    switch (cmd)

    {

    case PF_Cmd_COMPLETELY_GENERAL:
    ERR = RespondToAEGP(in_data,out_data,params,output,extraP);
    break;

    }
    }

    Am I missing something? What else should I do to get the callback for EntryPointFunc() to the project of Fund ?

    Thank you

    Dheeraj

    This should give AEGP_EffectRefH corresponding to the right of withdrawal?

    evil.

    but we will discuss them later.

    Suppose for a moment that you get a valid effectRefH.

    you tell him you call the effect return as soon as the effect called the CEAP via a suite.

    you wait until the effect out of his appeal? Maybe it's "always busy with original call where he calls your CEAP.

    If you want to be sure that it's free, you expect that the effect over call and then only communicate with her.

    You can do it by using idle_hook.

    When the effect called the CEAP, the CEAP sets a flag and waiting for a call to idle_hook.

    When that comes, he sees it has a flag and initiates the effectCallGenreic at a time where the effect is probably slow.

    Another alternative based on the suumption you answer immeidately without leaving the initial release of appellant first,

    is to respond through this same as a result of the appeals.

    When an effect called your CEAP via your suite it can pass empty structure or a pointer to any piece of data and have the CEAP fill with data and instructions.

    the process continues with the effect calling without using effectCallGeneric.

    Back to this thing from the beginning.

    as far as I know, the AEGP_GetNewEffectForEffect works for the call effect, regardless of the pIndata-> effect_ref passed to the function.

    You can use this function from effects with a NULL value for a pIndata-> effect_ref, and there is work.

    you need to get the effectPH of the old fashioned way, using AEGP_GetLayerEffectByIndex.

    Currently, there are several ways for you to get the AEGP_EffectRefH.

    the first would be to have the effect to find his own effectRef using GetNewEffectForEffect

    and have the effect that deliver to the CEAP via your suite.

    This Ref effect would be valid also for a long time that the effect of the appellant has not yet released. This Ref effect should also be discarded.

    Once the effect left his call, your can not count on the valid effectRef bieng more.

    It might work, but it fails if any other plugin has acquired an effectRef in the meantime.

    you might deliver effect it is LayerH to the ECAP and the CEAP search than LayerH for your effect and get his reff using AEGP_GetLayerEffectByIndex.

    the LayerH is less likely to change according to you what is an EffectRefH, but still, you can't count on it 100%.

    Unfortunately, there is no API a broad and lasting way project to recognize an effect.

    the evidence only solution full 100% would be to send the CEAP the itemID of the model and the correct layer layerID and throw the CEAP for the corresponding model in the project and the corresponding layer in the comp and the correct effect on the layer.

    the itemID layerID last during the life of the project and are stored with the project.

    they will change only the project is imported into another project.

    for a short term follow up of the effects I personally store the layerH and scan this layer for the correct effect.

    I tell myself that I need to convert to the complete solution, but I guess I'm too lazy to implement (and it sacns the whole project every time it is used).

    You must decide how much faith you put in with the effectRefH, layerH or compH not change under you, without notice.

Maybe you are looking for