Git Product home page Git Product logo

ae-lib's Introduction

ae-lib

Utility functions and prototype patches for After Effects

What's included:

// work with a PropertyGroup as if it's an array
interface PropertyGroup {
  forEach: (cb: (property: PropertyBase, index: number, self: PropertyGroup) => void) => void
  map: <T = any>(cb: (property: PropertyBase, index: number, self: PropertyGroup) => T) => T[]
  filter: (cb: (property: PropertyBase, index: number, self: PropertyGroup) => boolean) => PropertyBase[]
  toArray: () => PropertyBase[]
}

// work with a LayerCollection as if it's an array
interface LayerCollection {
  forEach: (cb: (property: Layer, index: number, self: LayerCollection) => void) => void
  map: <T = any>(cb: (property: Layer, index: number, self: LayerCollection) => T) => T[]
  filter: (cb: (property: Layer, index: number, self: LayerCollection) => boolean) => Layer[]
  toArray: () => Layer[]
}

// some utility functions, they will become available on the global "utils" variable
interface Utils {
  // take the current selection and store it in an array
  serializeSelection(): string[]
  // restore the selection by providing the serialized variant provided by the method above
  restoreSelection(serializedSelection: string[]): void
  // add a marker to a layer
  tag(layer: Layer, tag: number, value: string): void
  // retrieve the marker's value on a layer at a given time
  getTag(layer: Layer, tag: number): string
  // check if a layer has a marker at given time
  hasTag(layer: Layer, tag: number): boolean
  // get a unique path for a property, for example: ['ADBE Transform', 'ADBE Rotation']
  toPropertyPath(property: PropertyBase, pretty?: boolean): string[]
  // get a property on a layer by providing a path, see the example of a path above
  getPropertyAtPath(layer: Layer, propertyPath: string[]): PropertyBase | null
  // get a unique name for a layer or property
  getUniqueName(collection: any, prefix: string): string
}

interface Global {
  utils: Utils
}

declare var utils: Utils

More info soon...

ae-lib's People

Contributors

vespakoen avatar

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.