Skip to main content
Known Participant
March 14, 2019
Answered

call CEP from plugin

  • March 14, 2019
  • 2 replies
  • 3245 views

Hi,

I've a double question about the cep thread communication from a plugin, I didn't find answer in previous threads.

firstly , is there a solution to embbed some CEP in a plugin ?

secondly, I made an experiment using AEGP_ExecuteScript(). the plugin call it when a button is pressed. (in UserchangedParam thread)

I tried to use some json inside the script. The json lib is present in cep but not in classical extendscript. And it works. If the json file has an error, the after effect script debuger show  the CEP script with the error. (I don't use external library in script side).

but sometimes  I randomly  get a script error  : AE  doesn't know the JSON class functions. It seems in this case that  it  does'n't access to the CEP lib but only the classical extendscript...

Correct answer shachar carmi

as far as i know, you can't make AE load a CEP unless it's in one of the

designated CEP folders. i can think of 2 partial solutions:

1. place a shortcut in the CEP folder to your effect's folder. that way

(maybe) you can have your code placed somewhere else.

2. create an empty CEP that when loaded calls AE with a function you

define, such as "FetchPanelCode()". that function returns a string with the

HTML code that the panel can then evaluate.

2 replies

crazylafoAuthor
Known Participant
April 25, 2019

After some deep looking in documentation and exemples I still have problems with html<-->c++ communications in AE.

-From plugin to cep I "cheated" using script find menucommandid() and executeCommand(). But is there a proper way to call a cep from a plugin ?

-from cep to plugin how to send properly data using events and how to catch them in the plugin part ?

I sow a exemple un redgiant coloristaIV. but it s commercial and so protected.  in this exemple each modifications in the cep GUI apply the values in live to the plugin effect, including in ARB data....

Bruce Bullis
Community Manager
Community Manager
May 13, 2019

C++ plug-ins and CEP panels can communicate using Vulcan (CSXS Events).

crazylafoAuthor
Known Participant
May 13, 2019

Is there an official  Vulcan implementation in c++ sdk ?

For now I found a solution with the jsx script using aegp_executescript. The script call Vulcan to dispatch event  from plugin to plugin.

From cep to plugin I use an invisible checkbox in plugin part to catch  message from cep. It s homemade but it works.

Community Expert
March 14, 2019

a JSON and a string representing an array or dictionary are very similar,

but not exactly the same. there's a free library out there that defines the

JSON standard for use in extendscript. it allows you to do

JSON.stringify(), for instance.

why does your script sometimes work? maybe there's another script on your

system that defines the JSON standard, and once defined it's available for

all scripts.

crazylafoAuthor
Known Participant
March 14, 2019

I sow this JSON-js/json2.js at master · douglascrockford/JSON-js · GitHub  and I think I have to add it in the script part.

It's a bit strage, the script was tested on different systems, mac or windows. If I get the error 'JSON is undefined' and restart after effect, it works well again...

But last question : is there a proper solution to call the cep engine  and to put a dialog window/ui  written in html/js  inside  a plugin  (not to put it in extension)  ?

shachar carmiCommunity ExpertCorrect answer
Community Expert
March 14, 2019

as far as i know, you can't make AE load a CEP unless it's in one of the

designated CEP folders. i can think of 2 partial solutions:

1. place a shortcut in the CEP folder to your effect's folder. that way

(maybe) you can have your code placed somewhere else.

2. create an empty CEP that when loaded calls AE with a function you

define, such as "FetchPanelCode()". that function returns a string with the

HTML code that the panel can then evaluate.