Copy link to clipboard
Copied
I am guessing Adobe is pushing towards using HTML5 instead of native OS-dependant code, which would be fine if the tools wouldn't be so awkward, but whatever.
If I am to use HTML5, where exactly is PlugPlug? It's mentioned all over the place, yet seems to be accessible nowhere.
I need to communicate between the HTML5 UI and my C++ plugin.
Copy link to clipboard
Copied
I have the same question. There is the FreeGrid example in the Illustrator SDK which uses the PlugPlug library, but the header files used there seem Illustrator specific. Can anyone help?
Copy link to clipboard
Copied
PlugPlug is included with the install of Adobe Apps, you can require it in Extendscript like so:
try {
var xLib = new ExternalObject("lib:\PlugPlugExternalObject");
} catch (e) {
alert(e);
}
if (xLib) {
var eventObj = new CSXSEvent();
eventObj.type = 'myType';
eventObj.data = 'myData';
eventObj.dispatch();
}
I know you can also write your own ExternalObject libraries and access them the same way, but I haven't had a chance to look into that yet. bbb_999​ would know where to find examples on that.
Copy link to clipboard
Copied
The OP's and my question does not relate to ExtendScript, but how to send CSXSEvents from a Plugin, e.g. an AEGP, to a HTML5 Panel provided by a CEP. In the Illustrator SDK we can find an example, FreeGrid, that does just that for an Illustrator plugin written in C++. But this cannot be transfered to After Effects, as the headers provided with the Illustrator SDK rely on Illustrator specific types and classes.
Copy link to clipboard
Copied
After a lot of research there is no way in AE sdk (for now..). justintaylor is right, the only way is to execute script from plugin to call CEP and to sendData. (with AEGP_executescript)
To catch data from cep to plugin I cheated creating an invisble checkbox called by CEP with global variable. If someone has a proper solution...
Copy link to clipboard
Copied
zankol40675219​ Got it, was just explaining how PlugPlug works. I'm not familiar with FreeGrid, but since PlugPlug exists (triggering a CSXSEvent from Extendscript through C++ to CEP) seems like there's gotta be a way to do this straight from C++ to CEP. I haven't found a solution yet but have been meaning to research it when I have some time. Basically, we need a simplified version of PlugPlug that skips the Extendscript step...
Copy link to clipboard
Copied
Thanks for your answers.
It has been suggested in other threads to use ExtendObject in the CEP js-code to load an AEGP and call it's functions. With this you could sort of communicate between the CEP and your plugin. But to me that seems strange, as the AEGP would need proper loading, pointers to handles etc. that the Host application prodivides and I don't think ExtendObject could do that. But maybe I'm mistaken. Has anyone tried this yet?
Copy link to clipboard
Copied
I am guessing Adobe is pushing towards using HTML5 instead of native OS-dependant code...
From where do you perceive any such 'push'? Different APIs are available, to deal with different parts of the application's object model(s).
Copy link to clipboard
Copied
bbb_999 I don't see how that is relevant here. Instead, could you say something about the questions at hand?
Copy link to clipboard
Copied
I don't see how that is relevant here.
See first line, of original post.
Instead, could you say something about the questions at hand?
Justin is right.
Here's an example of a PPro panel's ExtendScript sending a message, and that same panel's JavaScript responding to the message. I'm told the Illustrator C++ SDK contains similar message-listening code.
Copy link to clipboard
Copied
bbb_999​ thanks, are there any examples of how to build your own C++ library that works like PlugPlug or AdobeXMPScript with your own custom C++ functions you can then call from ExtendScript? I didn't see anything in the AE SDK, but not sure if I'm missing something.
Copy link to clipboard
Copied
I'll have a look at the Illustrator C++ SDK, time permitting. The referenced snippet of CSXS-sending ExtendScript code, works in AE too.
Copy link to clipboard
Copied
bbb_999​ I think I found a reference to the ExternalObject example here​ but I'm not sure what directory "sdkInstall/sdksamples/cpp/" in the Adobe ExtendScript SDK is referring to (or if it exists anymore). Any ideas where that might be? Thanks!
Copy link to clipboard
Copied
I think they mean the /sdk directory, adjacent to ExtendScript Toolkit.

Copy link to clipboard
Copied
Awesome thanks Bruce! Gonna start checking this out... If anyone is on Windows, the directory is:
C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\SDK\Samples\cpp\build\basicexternalobject\win
Copy link to clipboard
Copied
bbb_999​ I got the BasicExternalObject and SampleLib examples compiled in the AE library directory, however when trying to access it in Extendscript (on AE 16.1.1), I keep getting an I/O Errors on both libraries. Any ideas what would cause this? I think they were designed for Bridge, so do I need to customize/target the build for AE aside from building in the correct folder?
try {
var yLib = new ExternalObject("lib:\BasicExternalObject");
alert(yLib);
} catch (e) {
alert(e);
}

Copy link to clipboard
Copied
Any ideas what would cause this?
"Whereof one cannot speak, thereof one must be silent."
- Wittgenstein
I'll find a better-informed assessment.
Copy link to clipboard
Copied
@bbb_999 What you are writing is unhelpful. The issue is how to communcate between CEP and Plugins written in C++ using CXSX events, i.e. how to listen to them and dispatch them from within the plugin. Please read what crazylafo​ and I have written above.
Copy link to clipboard
Copied
What you are writing is unhelpful.
Did you investigate the Illustrator SDK, as I suggested? The DrawArt / DrawArt UI samples demonstrate plug-in / panel communication.
Copy link to clipboard
Copied
The examples in the Illustrator SDK depend on plugplug-headers that are specific to Illustrator and the Illustrator SDK, as I mentioned above. That's the problem.
Copy link to clipboard
Copied
bbb_999​ Would you guys ever consider releasing the source code for PlugPlug or a simplified version of PlugPlug? This would provide us with a working ExternalObject example for multiple apps and give insight into accessing CEP from the C++ SDK.
Copy link to clipboard
Copied
Would you guys ever consider releasing the source code for PlugPlug or a simplified version of PlugPlug?
It's within the realm of possibility, though different products would likely prioritize that work differently.
Copy link to clipboard
Copied
I'm not sure about this, but I just checked SDKPlugPlug.cpp / .h (which appears to be a simple wrapper that loads PlugPlugOwl.framework / .dll and exposes a couple methods) in AI SDK and it looks like it only depends on AIFoldersSuite from AI SDK. This dependency can be probably removed as it is used only to construct a path to PlugPlugOwl.framework/.dll, which can be easily done without this suite. Bruce Bullis​, do you think that PlugPlug.framework / .dll in AE / Pr could be loaded and used the same way as PlugPlugOwl in AI SDK example? I don't know whether it's the same lib but it looks like it contains all the methods that SDKPlugPlug requires (PlugPlugLoadExtension, PlugPlugUnloadExtension, PlugPlugAddEventListener, PlugPlugRemoveEventListener, PlugPlugDispatchEvent) but I don't have a clue what happens under the hood and whether it's safe to use it this way. Thanks!
Copy link to clipboard
Copied
Bruce Bullis, do you think that...
I have no informed opinion on that, but it sounds worth trying.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now