Git Product home page Git Product logo

duaef's Introduction

DuAEF

Duduf After Effects ExtendScript Framework

TODO

  • Check if magic preset is still needed (in DuAE.init() )

What's this?

DuAEF is a set of classes, methods and tools to ease the scripting process in After Effects, as long as adding features (like pngquant, ffmpeg, or json) not available in After Effects/ExtendScript. It is very easy to use and documented.

Links

How to use the framework in an After Effects script?

Just include the framework in your script with this simple code:

#include DuAEF.jsxinc

After this, all objects and methods from DuAEF will be available, in the DuAEF namespace.

Comprehensive reference

The framework reference is available here.

Other tools

  • The tools subfolder contains some useful scripts, which can be used as example cases of DuAEF use.
  • DuBuilder is a stand-alone application written in Qt/C++ to build the scripts. It replaces all includes with the actual source code and lets you distribute your scripts as single files instead of a main script with a lot of includes.

duaef's People

Contributors

nico-duduf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rstrblstr jz5 msongz

duaef's Issues

Labeling Limbs in Hominoid Rig

A Feature Request/ Bug report. When you create a Hominoid rig in Duik Bassel.2 v16.230 It labels the control layers R and L for the R and L Limbs "Hand R Hand L" and "Foot R and Foot L" However the control layers are not Labeled for R and L limbs
the Structures for the L side are named with just the body part "S | Hand " and "S | Forearm" etc.
The Structures for the R side are named wit a "2" after them "S | Hand 2" and "S | Forearm 2" etc
This makes it unnecessarily confusing to set up a character.
If you could just label the Structures wit R and L it would be much easier to do setup "S | Hand R" and "S | Hand L" etc.

Missing stuff in the Ae scripting API & expressions

Numbers do not have any signification, they're not a priority level, but just useful for further reference.

Very important

  1. Access to Master Properties source properties. This is the most important missing feature for Duik.

  2. Property.id UUIDs for layers and effects, like Item.id, accessible in expressions too, with the associated method PropertyGroup.propertyById(int)

  3. Expressions: add compById() to be able to get a comp with its id, not just its name or index

  4. FootageItem.asComp A boolean for FootageItem when its a PSD or AI file to know if it's been imported as comp or footage

  5. FootageItem.sourceLayer The layer name in the source file when mainSource is a PSD or AI file imported as composition

  6. Fix the expression editor with the Graph Editor

  7. A way to declare "time constants" in expressions. Either a new keyword like timeconst instead of const, or something like React hooks where a var update is triggered only if a dependency changes:
    var t = Math.round(time);
    var myVar = useMemo(() => 10, [t]);
    This would be a way to improve a lot the performance of some expressions.

  8. valueAtTime() in expressions may have another arg to get either the pre or post-expression value. This is a way to fix circular dependencies and "force" the order of the evaluation of the expressions.

  9. API for the puppet tool (ability to create puppet pins via scripting)

A bit less important

  1. "Batch methods". Performance is currently very poor when hiding, shying, etc a lot of layers for example, because Ae tries to update at each iteration of the loop, although when doing this natively it is much faster. A bunch of methods like CompItem.hideLayers(Array) could improve performance. A workaround (not tested yet, I will) being to select layers and executeCommandId if and only if there is a corresponding command id...

OR

  1. A app.suspendUpdate(bool) method to suspend all app update while a script is doing a lot of stuff. Like when Duik has to create a whole lot of layers and it's awefully slow, even though that would be very, very quick if only Ae were not trying to catch up and just sit a bit until the script has finished.

OR

  1. Threads really working. BUT I'm pretty sure it's going to take years to fix all issues like "the script does not get the right prop value because Ae is not in sync" so the first and only method we need with threads would be $.waitForTheApp()!

OR, even better

  1. Threads, signals and slots. Like Qt (and a bit like the current stuff.onClick = method, but with A LOT of signals emitted by Ae: LayerCollection.numLayersChanged, app.ready, Layer.nameChanged, ItemCollection.numItemChanged... If the signals could pass vars to the "slot" function, that would be great: ItemCollection.newItem(Item), app.aboutToOpen(File), CompItem.nameChanged(previousName)...

  1. FootageItem.isSequenceA boolean to differentiate between Image sequence and still frame for the mainSource of FootageItem

  2. Project.isModified, boolean to check if the project has been changed since the last save (the info given by the * in the title bar of Ae)

  3. An easy way to add custom metadata to project files (I'm going to test with the XMP API, but it seems more complicated than it should be). Would be a nice way to store per-project settings and other stuff! (Edit: using XMP acrually works very well)

  4. toWorld, fromWorld, toComp, etc transform methods available in scripts would improve a lot the performance (and ease of code) of many scripts currently relying on matrices and other math. Calculations like that should be done on the C++ side.
    On that matter a math lib, with interpolation methods, matrices, quaternions could help a lot, calculations being made natively would help both coding and performance. Scripers are rarely mathematicians evem though they can manipulate these objects.

  5. Methods to create pseudo effects at run time (even just a app.createEffect(XML) would enable scripts to create custom effects on the fly depending on specific contexts. That would be awesome

  6. A "Script button" control in effects and pseudo effect: a simple button in an effect which runs a script or function, providing it a few info: at least the layer containing the effect. That can be done with the C API, but it's a lot to learn for such a simple thing... Duik would benefit a lot from this, finally getting rid of this terrible "select something then click a button" workflow

  7. Access to Property.matchName in expressions.

  8. A "String Control" effect in the the expression controls.

Could be nice

  1. a way to differenciate native effects (i.e. installes with the Creative Cloud installer) from third party effects

  2. Create menu items tied to functions, for a better integration of scripts. This can be done in Maya, Blender, Nuke... and makes scripts fit much better in the user workflow. The crowded "window" menu is a really big pain for everyone, as well as having panels with just a couple of buttons which could just be simple (context) menu entries

Ae prefs snippet

(function changeAEPref() {
  var prefInfo = {
    section: 'Main Pref Section v2',
    key: 'Pref Name',
    file: PREFType.PREF_Type_MACHINE_INDEPENDENT,
  };

  var minAEVersion = 12.0;

  if (parseFloat(app.version) < minAEVersion) {
    alert("AE version too low!");
    return;
  }

  if (!app.preferences.havePref(prefInfo.section, prefInfo.key, prefInfo.file)) {
    alert("Can't find pref!");
    return;
  }

  // Toggle the pref, save to disk, and reload so it's active in the current session
  var newValue = true;

  try {
    app.preferences.savePrefAsBool(
      prefInfo.section,
      prefInfo.key,
      newValue,
      prefInfo.file
    );

    app.preferences.saveToDisk();
    app.preferences.reload();

  } catch (e) {
    alert("Can't change prefs!\n" + e);
  }
})();

By zack lovatt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.