Skip to main content
Known Participant
April 16, 2009
Question

Is it possible to delete an Effect sitting on the same effect plugin c++ code?

  • April 16, 2009
  • 1 reply
  • 3038 views

Hello,

Let me explain My problem.

I have developing an Effect plugin, "MyEffect" .

This effect has one UI + defualt "About" and "Reset" buttons + one "Remove " ( Which is a "Options..." ) button.

The "Remove" button functionality is: When I click on "Remove" button, the "MyEffect" effect should remove from the Layer/Composion.

The plugin EntryPoint function is called with a command "PF_Cmd_DO_DIALOG" clicking on "Remove" button. Here I want to remove this "MyEffect" effect from Layer/Comp.

So, My question is, Is it possible to delete/remove an effect sitting on the same effect plugin c++ code?

Hope, you understand the problem!.

This topic has been closed for replies.

1 reply

Community Expert
April 16, 2009

no, it's impossible to do from within the effect itself.

you'll get an error on AE7 and a crash on CS3.

but I believe you'll find the solution pretty familiar...

that separate AEGP of ours?

leave it a message along with the layerH and the effect index of the effect you want to delete,

and the AEGP will delete it during the idle hook.

I don't see any other way to do it. (without causing a crash, of course).

Known Participant
April 17, 2009

Hi Shachar,

Thanks for your reply!

>>     that separate AEGP of ours?

Not getting the above line in your prevoius msg.

Actually My question is, "Is it possible to delete an Effect sitting on the same effect plugin c++ code?", wrong.

What exactly I want is...

I'm developing an effect plugin, that execute 2 scripts.

-     one script is for applying an effect ( we are discussing this issue in onother thraed, you already knew it. )     and

-     other script is for removing an effect

When I click on "Remove" button, the second script should executes and it removes the applied effect from the Layer/Comp.

I'm just guessing that, 3 plugins are required to solve this problem.

Plugin1:  Create UI + call plugin2 + call plugin3

Plugin2:  Execute the script1 ( i.e., apply the effect )

Plugin3:  Execute the script2 ( i.e., remove the effect )

am I correct?

Community Expert
April 17, 2009

no matter how you turn it around,

an effect can not delete itself.

why is that?

because it's exit data refers to a no longer existing effect.

crash, burn, screams, horror.

the only solution (that i know of) is to get another effect or script to do

that for you,

and to do that when that effect (or any other effect in the same stack) is

NOT in use.

if you want your "options" button to delete your effect, then you should

create a system in which the effect calls a different effect or AEGP,

that will delete the calling effect AFTER it finished processing and exited.

you can do that in the same way we discussed launching scripts. (or am i

confusing you with someone else?)