-
1. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
shachar carmi May 18, 2010 1:28 PM (in response to dheeraj_c)besides what;s listed on the other thread, i don't know of a way of being notified of your effect being deleted.
the only other solution i can think of is:
make your effects have a unique identifier (either a hidden param or in the sequence data).
these effects should notify your AEGP of their existence and store their identifier with it.
on idle_hook, the AEGP scans the project and looks for the effects it has listed, matching their identifier.
if any of them is missing, it must mean it was erased.
this will let you know an effect was erased in a very short delay from the delete operation.
-
2. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
dheeraj_c May 18, 2010 11:18 PM (in response to shachar carmi)Thanks Shachar for the reply.
Before trying Idle_hook I want to ask a doubt about RegisterCommandHook.
Currently I'm doing this :
I have registered for AEGP_RegisterCommandHook(S_my_id,
AEGP_HP_BeforeAE,
AEGP_Command_ALL,
CommandHook,
NULL));Whenever an custom effect is deleted through Timeline tab, I get the callback but if the effect is deleted through Effect Controls tab, I don't receive any callbacks. Why is it?
What else I need to do for receiving effect/layer delete callbacks when they are deleted from any panel?
-
3. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
shachar carmi May 19, 2010 1:57 AM (in response to dheeraj_c)dumb question:
are you using AEGP_RegisterCommandHook from within an effect or an AEGP?
because you shoud use that from an AEGP.
this way you'll monitor all commands, and won't have a case in which the effect get's deleted before he get's the command call.
-
4. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
dheeraj_c May 19, 2010 2:10 AM (in response to shachar carmi)Hi Shachar,
1. I'm using AEGP_RegisterCommandHook from an AEGP only. But I'm not getting all delete callbacks (as of now when the effect is deleted from Effect Controls tab).
2. Also I get a call before an effect is deleted. The effect is deleted after I get the callback. I tried using AEGP_HP_AfterAE but when I checked the documentation it's written like (currently always AEGP_HP_BeforeAE). Will I get a callback after the command is executed?
Many thanks Shachar.
-
5. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
shachar carmi May 19, 2010 3:53 AM (in response to dheeraj_c)AEGP_RegisterCommandHook doesn't tell you something is being deleted.
it tell you that a delete command is being launched.
even if nothing is seceted and nothing is deleted, you still get the call
when the user hits delete.
that means that you get that call before AE processes the delete command.
indeed AEGP_HP_AfterAE is not implemented at this time, so no help from
there.
as for not getting the delete callback from the ECW,
are you not getting any call at all, or just not the delete command?
it could be that there's a "remove effect" call instead of "delete" when he
ECW is concerend.
i realy don't know. try listening to all calls just before you delete an
effect. maybe you're getting some call after all.
-
6. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
dheeraj_c May 19, 2010 4:15 AM (in response to shachar carmi)Thanks Shachar.
I'm getting some callback when I add an effect to ECW but not when I delete from ECW. Nothing at all. Don't know why it's behaving like this.
-
7. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
shachar carmi May 19, 2010 4:35 AM (in response to dheeraj_c)good question.
i honestly don't know.
there are a few was of deleting an effect:
1. delete key
2. backspace key
3. cut (cmd+x)
4, using edit menu commands
there are at least 3 ways of deleting layers form the ECW.
1. selecting 1 effect and hitting
2. selecting 2 or more effects and deleting together
3. hitting cmdshifte (remove all effects)
these are different scenarios in which i can expect different behaviours.
for instance, if you select one effect, it's custom UI gets active.
if you select 2 effect then their UI isn't active.
when the UI is active some other calls are sent to the effect.
do you not get call for any of the above?
do some send something?
-
8. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
dheeraj_c May 19, 2010 5:39 AM (in response to shachar carmi)If the focus is on the Timeline effect then all the ways of deleting the effect/layer you mentioned gives a callback but if the focus is on the ECW, I do not get any callbacks.
-
9. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
shachar carmi May 19, 2010 5:52 AM (in response to dheeraj_c)well,
i have no idea why it does that.
the only work around i can think of is to use AEGP_GetMainHWND (or the mac
equivalent which i cannot recall right now),
and register an os level keyboard event handler.
then your get all keyboard events regardless of AE wanting to give them to
you or not.
-
10. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
dheeraj_c May 19, 2010 6:57 AM (in response to shachar carmi)Thank you Shachar for sharing your ideas.
I will search for mac equivalent of AEGP_GetMainHWND() and try to get the callbacks.
-
11. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
dheeraj_c May 20, 2010 3:01 AM (in response to shachar carmi)Hi Shachar,
Can you please tell me how to register for keyboard events without overriding NSWindow?
Because even if I have the NSWindow object of AE there is no way for me to listen for keyboard events without overriding it.
-
12. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
shachar carmi May 20, 2010 3:58 AM (in response to dheeraj_c)it seems that i was wrong.
sorry for having sent you on a wild goose chase...
read the following:
http://www.cocoabuilder.com/archive/cocoa/128594-nswindow-delegate-handling-keyboard-event s.html
one of the guys who answered there is an apple cocoa engineer.
he says that i the main window cinsumes the keyboard event, then the
following responders don't get that event.
so unless you override AE main window, you cant get these events.
well,
back to the drawing board.
-
13. Re: Callback when a layer/effect is deleted or when undo/redo is performed.
dheeraj_c May 20, 2010 4:17 AM (in response to shachar carmi)No issues Shachar. Thanks for the link.


