Copy link to clipboard
Copied
Hi,
I'm new in scripting, i did an html 5 panel for after effects but there is only 1 jsx file working. I started from the "after effect" example which is in the new CEP package.
Also, I found the link below :
CEP 6 HTML Extension Cookbook for CC 2015 · Adobe-CEP/CEP-Resources Wiki · GitHub
but still don't understand, someone could help me on this one.
Copy link to clipboard
Copied
To answer the question -> Are you trying to use more than one jsx source file?
The answer is Yes, i got X number of jsx files, and i want to load them all.
In my UI, i have one button to launch each script.
in each script i put those lines. for example :
$._ext = {
camrig : function()
{
CreateCam();
}
};
But it seems that it work only for the first script found by "MainScript.jsx"
I dont know if i'm clear, tell me if it's not the case.
Copy link to clipboard
Copied
We are doing the same in an extension. Code below (cleaned up from angular):
var csInterface = new CSInterface();
var extensionRoot = csInterface.getSystemPath(SystemPath.EXTENSION) + "/jsx/";
//we store multiple jsx files in a "jsx" folder in our extension's root folder
csInterface.evalScript('$._ext.evalFiles("' + extensionRoot + '")');
in one of the jsx files (only needs to be one of them)--
$._ext = {
evalFiles: function(jsxFolderPath) {
var folder = new Folder(jsxFolderPath);
if (folder.exists) {
var jsxFiles = folder.getFiles("*.jsx");
for (var i = 0; i < jsxFiles.length; i++) {
var jsxFile = jsxFiles;
$._ext.evalFile(jsxFile);
}
}
}
}
Copy link to clipboard
Copied
I should mention that for the script above, we defined $ beforehand as an empty object ($ = {}).
Here's some more documenation on how to set it up:
http://www.davidebarranca.com/2014/01/html-panels-tips-2-including-multiple-jsx/
Find more inspiration, events, and resources on the new Adobe Community
Explore Now