Copiar link para a área de transferência
Copiado
Hi,
I'm learning how to create extension (flex - extension builder) for Illustrator and how to make it communicate with a plugin.
The samples provided in the SDK detailed how to load /unload extension from a menu item from Illustrator, and how to add / remove EventListeners
to make the magic happen.
to sum up, this is something like that:
1- click on the menu item
2- load extension
3- add listeners
4- do your stuff......
5- remove listeners
6- unload extension
Basically my plugin is a module/service which is in charge of dealing with / modifying artwork tree. It has no User Interface.
My extension will have a user of this service.
What I would like to do is to load my extension as soon as my plugin is loaded, and unload the extension when the plugin will be unloaded.
Or notify when extension is loaded or unloaded.
Is that possible and hw could I achieve that?
Thx,
Thomas.
I have finally managed to do what I wanted.
Just like it has been done in the SDK sample, I have used a Controller class to deal with event listeners and extensions.
The plugin class, Illustrator notification system is used, and I have overwritten PostStartupPlugin, StartupPlugin, SetGlobal, SetGlobal, .. methods.
This is working pretty fine.
Copiar link para a área de transferência
Copiado
Hi Thomas,
Yes that is possible. If we use your summary as an example in order to load/unload your extension when the plugin is loaded/unloaded you would move the code in step 2 from the menu click event to the event that you want your plugin to be loaded in. Then you would move the code from the menu being unclicked to the unload event.
As a more concrete example if we take the code in FreeGridPlugin.cpp
if(visible)
{
result = freeGridDialogController->UnloadExtension();
freeGridDialogController->SetPanelReady(false);
}
else
{
result = freeGridDialogController->LoadExtension();
}
you would take:
result = freeGridDialogController->UnloadExtension();
freeGridDialogController->SetPanelReady(false);
and put that under your unload listener and put
freeGridDialogController->LoadExtension();
under your load listener.
I would just warn that the C++ plugin load and unload events are to do with Illustrator loading and unloading your plugin in memory and I would guess are not necessary the events that you would want to use for your UI as it may well load on startup and disappear seemingly arbitrarily to the user and reappear when it is reloaded. You might want to pick an event that is more closely tied to the function of your extension
I hope that helps.
Let me know if you have any further questions.
Thanks,
Robert
Copiar link para a área de transferência
Copiado
I have finally managed to do what I wanted.
Just like it has been done in the SDK sample, I have used a Controller class to deal with event listeners and extensions.
The plugin class, Illustrator notification system is used, and I have overwritten PostStartupPlugin, StartupPlugin, SetGlobal, SetGlobal, .. methods.
This is working pretty fine.
Encontre mais inspiração, eventos e recursos na nova comunidade da Adobe
Explore agora