AFTEREFFECTS

News, Information & Workflows from Users & the Adobe Ae Team

scripting changes in After Effects CC (12.0-12.2)

This article describes the changes to the After Effects scripting interface implemented in After Effects CC (12.0). You can use this article together with the most recent full version of the After Effects scripting guide (for After Effects CS6), which you can find on the After Effects Developer Center page.

There were no significant changes in the scripting interface for After Effects CC (12.1) or After Effects CC (12.2).


ScriptUI Drover adpapter

ScriptUI is now based on the same controls as the main application.

The scripting reference for ScriptUI is in the Adobe Creative Cloud JavaScript Tools Guide (PDF).


access to effect’s internal version string

Added: Application effects object’s version attribute to get an effect’s internal version string. This value might be different than the version number the plug-in vendor decides to show in the effect’s about box.


ability to get and set preview mode

Added: ViewOptions fastPreview property to access the state of the Fast Previews menu with the scripting interface. This is a read/write attribute using an enumerated value:

Value Fast Previews menu option
FastPreviewType.FP_OFF Off (Final Quality)
FastPreviewType.FP_ADAPTIVE_RESOLUTION Adaptive Resolution
FastPreviewType.FP_DRAFT Draft
FastPreviewType.FP_FAST_DRAFT Fast Draft
FastPreviewType.FP_WIREFRAME Wireframe

If you try to get or set the attribute’s value in the Layer or Footage panel, you’ll get an error message.

The Draft preview mode is only available in ray-traced 3D compositions. If you try to use it in a Classic 3D composition, you’ll get an error: “Cannot set Draft fast preview mode in a Classic 3D composition.”


access to layer sampling method

Added: layer.samplingQuality and LayerSamplingQuality enum to set/get layer sampling method (bicubic or bilinear):

Example:
// Set layer to bicubic sampling

app.project.activeItem.layer(1).samplingQuality = LayerSamplingQuality.BICUBIC;

// Set layer to bilinear sampling

app.project.activeItem.layer(1).samplingQuality = LayerSamplingQuality.BILINEAR;


changed preference and settings methods

Preferences and settings methods now take a third argument to specify the target preferences file if Section/Key is not in “Adobe After Effects 12.x Prefs.txt”. If the third argument is not passed, default value (PREFType.PREF_Type_MACHINE_SPECIFIC) is used and After Effects tries to save/get from the “Adobe After Effects 12.x Prefs.txt” preferences file. The third argument is enum PREFType value.

You can now pass the preference type with a script with new PREFType enum:

  • PREF_Type_MACHINE_SPECIFIC
    Adobe After Effects 12.x Prefs.txt
  • PREF_Type_MACHINE_INDEPENDENT
    Adobe After Effects 12.x Prefs-indep-general.txt
  • PREF_Type_MACHINE_INDEPENDENT_RENDER
    Adobe After Effects 12.x Prefs-indep-render.txt
  • PREF_Type_MACHINE_INDEPENDENT_OUTPUT
    Adobe After Effects 12.x Prefs-indep-output.txt
  • PREF_Type_MACHINE_INDEPENDENT_COMPOSITION
    Adobe After Effects 12.x Prefs-indep-composition.txt
  • PREF_Type_MACHINE_SPECIFIC_TEXT
    Adobe After Effects 12.x Prefs-text.txt
  • PREF_Type_MACHINE_SPECIFIC_PAINT
    Adobe After Effects 12.x Prefs-paint.txt

Example:
// Section ["Settings_test_section"] is saved in "Adobe After Effects 12.x Prefs.txt" without third argument

app.settings.saveSetting("test_section", "test_key1", "test_key1_value");

if (app.settings.haveSetting("test_section", "test_key1"))
var current_set = app.settings.getSetting("test_section", "test_key1");

// Section ["Settings_test_section2"] is saved in "Adobe After Effects 12.x Prefs-indep-general.txt"

app.settings.saveSetting("test_section2", "test_key1", "test_key1_value", PREFType.PREF_Type_MACHINE_INDEPENDENT);

if (app.settings.haveSetting("test_section2", "test_key1", PREFType.PREF_Type_MACHINE_INDEPENDENT))
var current_set2 = app.settings.getSetting("test_section2", "test_key1", PREFType.PREF_Type_MACHINE_INDEPENDENT);

Example:
alert(app.preferences.getPrefAsString("Text Style Sheet", "Font Family Name", PREFType.PREF_Type_MACHINE_SPECIFIC_TEXT));

TAGGED AS:

Sorry, the comment form is closed at this time.

Sorry, the comment form is closed at this time.

Try After Effects Now!

Join The Discussion