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

Sublime Text Build for After Effects

Engaged ,
Aug 13, 2013 Aug 13, 2013

Any Sublime text experts out there... ? Made a build system to send current file to be executed in AFX...

I did try it with the -s and feeding a  line of code and it works. So when I switch to sending the current file....

It switches over to AFX but does nothing... can't figure it out. I am aware of the build system from AEtuts but I

am trying to figure stuff out and learn as I go along.... (Not an expert in Sublime/Python/cmd line)

//Contents of my build file...

{

  

    "cmd": ["afterfx", "-r", "\"$file\""]

}

//Which sends (I think) to the command line.

Running afterfx -r "C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\ScriptUI Panels\AED_CornerCutters\AED_AdjustmentLayer.jsx"

After Effects is called but doesn't read the jsx....

Any ideas?

TOPICS
Scripting
5.7K
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
Community Beginner ,
Aug 14, 2013 Aug 14, 2013

Hi,

I believe AE doesn't load your script because it's in a folder inside the ScriptUI panels.

just, try to change that path:

"C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\ScriptUI Panels\AED_CornerCutters\AED_AdjustmentLayer.jsx"

to that:

"C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\ScriptUI Panels\AED_AdjustmentLayer.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
Engaged ,
Aug 15, 2013 Aug 15, 2013

Thanks for the reply but same deal - not working - just popping over to After Effects and doing nothing.

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
Explorer ,
Aug 19, 2013 Aug 19, 2013

Hi,

I'm the guy from that thing at AeTuts+ Instead separating it in 3 different arguments, you could just do

"cmd": ["afterfx -r $file"]

and this should be alright. Althought if you want to test what's your path you can do

"cmd": ["echo $file"]

I've also had some problems with Windows and to had encoding like:

"cmd": [...],

"encoding": "cp850"

don't ask me why but it fixed some bugs.

It's all untested code but I hope it can help you!

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
Engaged ,
Aug 19, 2013 Aug 19, 2013

Hi Sebastian - Know you well on the web, only watched your mini - documentary there last week.

Many thanks - will try that when I return from holidays...

I already tried your build, but it's not exactly what I need. Anyway I am pretty happy to code and pop across to ESTK to send to AFX, it's no big deal really, just an extra click. This is just to get script to run in AFX - when not needing to bug check.

Really appreciate that.

A

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
Explorer ,
Aug 20, 2013 Aug 20, 2013

Cool good to know!

Also, just to let you know, I also realized that testing in After Effects would sometimes not be enough so I rebuilt the Sublime Text build system to be a real plugin for ExtendScript. To only "build" files (copy paste it to After Effects/PS/Ai/etc. folder and compile #includes if wanted). You can get more details here https://github.com/seblavoie/sublime-extendscript or on the packages site https://sublime.wbond.net/packages/ExtendScript.

Cheers,

Seb

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
Engaged ,
Aug 22, 2013 Aug 22, 2013

Merci beaucoup pour l'assistance!

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
Explorer ,
Aug 22, 2013 Aug 22, 2013

Sans problème!

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 ,
Aug 23, 2013 Aug 23, 2013

Is it possible to send the code directly from sublime without saving/copying procedure? Much like ExtendScript Toolkit does it.

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
Explorer ,
Aug 26, 2013 Aug 26, 2013
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
Participant ,
Aug 26, 2013 Aug 26, 2013

Sebastien,

I noticed on the AeTuts+ page that some comments referred to the fact that the debugger in ESTK cannot be used with your build system.  Is this still the case?  If not, how can we use the debugger with your build system?

Thanks!

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
Explorer ,
Aug 26, 2013 Aug 26, 2013

Not yet, right now I use the previously mentionned Sumblime Text plugin and alt+tab to extendscript then ctrl+r when I need to run/test it. I tried creating an applescript to open the file from the estk but there seems to be some issues which may be related (somebody correct me if I'm wrong) to the fact that the estk relies on flash.

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
Advocate ,
Aug 26, 2013 Aug 26, 2013

I wouldn't doubt it. The dockable script panels in AE are all Flash based. That's why they take forever to load if you have a lot of docked scripts. You'll see a flash of white (the Flash artboard), then the UI will load. My AE at work takes about a minute or so to launch due to all the scripts I have docked in my interface.

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
Enthusiast ,
Oct 09, 2013 Oct 09, 2013

Sebastien Lavoie wrote:

I tried creating an applescript to open the file from the estk but there seems to be some issues which may be related (somebody correct me if I'm wrong) to the fact that the estk relies on flash.

I tried this too, just today.  Here is the AppleScript I wrote just to see if I could bring an application to the front:

tell application "ExtendScript Toolkit"

  activate

end tell

When I run this within the AppleScript Editor, nothing happens.  However, if I change "ExtendScript Toolkit" to literally any other application the script does in fact work as expected.  So when I replace "ExtendScript Toolkit" with "Safari", "Adobe After Effects CC", "Mail", or "Chrome" those applications are placed in the front.  Has anybody been able to, at they very least, bring ESTK to the front with AppleScript?

Thanks!

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
Enthusiast ,
Oct 09, 2013 Oct 09, 2013

Okay, after reading this resource, under `The Process Class`, I discovered that you can go through the System Events application to bring ESTK to the forefront.

tell application "System Events" to set frontmost of process "ExtendScript Toolkit" to true

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
Enthusiast ,
Oct 16, 2013 Oct 16, 2013
LATEST

Just following up with the solution I'm using for building in Sublime, but debuggin in ESTK. 

Here is the full AppleScript I am using in Sublime's build system:

tell application "System Events"

          tell process "ExtendScript Toolkit"

                    set frontmost to true

                    click menu item "Run" of menu "Debug" of menu bar 1

          end tell

          tell application "Adobe After Effects CC"

  activate

          end tell

end tell

Here is the script I am using in Sublime:

{

     "shell_cmd": "osascript ~/path/to/above/applescript.scpt"

}

This assumes that ESTK is already running and has the script you want to debug open.  It also assumes, that you've got the `Automatic Reload of Changed Files` switched on under the `General` section in the `Documents` tab of ESTK's preferences.

If anybody can rework the above apple script so that it launches ESTK with the current file open in Sublime, that would be awesome.  Thanks!

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
Engaged ,
Aug 27, 2013 Aug 27, 2013

"shell":true

is the only other thing I needed to add to the build file - so it loads cmd.exe and runs it through it. That was the reason it was doing nothing.

Working now! so I can hot key it to run in AFX and turn on the debugger - so the ESTK will pop up for errors.

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
Explorer ,
Aug 27, 2013 Aug 27, 2013

Yes but since you inject the code directly to After Effects you probably won't be able to use things such $.write(). You will have to rely to alert() which isn't as detailed. If I am wrong and you *can* use $.write, I'd be really interested in what is in your shell/cmd file.

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
Engaged ,
Aug 27, 2013 Aug 27, 2013

Hi Sebastian -

I am not using a .bat file or anything  - just sending the script from Sublime to Afx via cmd.exe.

So it's just the bare build file... to run the script in AFX

Running afterfx -r C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\tester.jsx

All I need.

Sometimes I use utility functions to switch between ESTK stuff and AFX - the snippet below switches between alert type boxes

in AFX or silent ESTK logging depending on a estkLogging variable.

//----------------------------------------------------------------------------------------------

function logger(str,des){

                                                  //logs to an alertbox or does a writeln in the ESTK

                                                  des = des||""; //optional 2 parameters or one.

                                                  if (logging==true){//enable logging.

                                                                      if(estkLogging==true){          $.writeln(str + "   :   "+des);          $.writeln("-------------------------------");}

                                                                      else{feedback(str + "   :   "+des) ;}

                                                  }  //if

                                        }//close logger funct.

  //--------------------------------------------------------------------------------------------

Also - native AFX feedback in the info panel...


write("This text appears in Info panel ");

writeln("This text appears on f irst line");

writeln("This text appears on second line");


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