Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CEP html5 panel multiple JSX

New Here ,
Nov 03, 2015 Nov 03, 2015

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.

TOPICS
Scripting
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2015 Nov 04, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 04, 2015 Nov 04, 2015

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);
             }

           }

     }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 04, 2015 Nov 04, 2015
LATEST

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/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines