项目作者: adobe-extension-tools

项目描述 :
Utilities for AE
高级语言: JavaScript
项目地址: git://github.com/adobe-extension-tools/ae-lib.git
创建时间: 2017-12-20T19:47:24Z
项目社区:https://github.com/adobe-extension-tools/ae-lib

开源协议:

下载


ae-lib

Utility functions and prototype patches for After Effects

What’s included:

  1. // work with a PropertyGroup as if it's an array
  2. interface PropertyGroup {
  3. forEach: (cb: (property: PropertyBase, index: number, self: PropertyGroup) => void) => void
  4. map: <T = any>(cb: (property: PropertyBase, index: number, self: PropertyGroup) => T) => T[]
  5. filter: (cb: (property: PropertyBase, index: number, self: PropertyGroup) => boolean) => PropertyBase[]
  6. toArray: () => PropertyBase[]
  7. }
  8. // work with a LayerCollection as if it's an array
  9. interface LayerCollection {
  10. forEach: (cb: (property: Layer, index: number, self: LayerCollection) => void) => void
  11. map: <T = any>(cb: (property: Layer, index: number, self: LayerCollection) => T) => T[]
  12. filter: (cb: (property: Layer, index: number, self: LayerCollection) => boolean) => Layer[]
  13. toArray: () => Layer[]
  14. }
  15. // some utility functions, they will become available on the global "utils" variable
  16. interface Utils {
  17. // take the current selection and store it in an array
  18. serializeSelection(): string[]
  19. // restore the selection by providing the serialized variant provided by the method above
  20. restoreSelection(serializedSelection: string[]): void
  21. // add a marker to a layer
  22. tag(layer: Layer, tag: number, value: string): void
  23. // retrieve the marker's value on a layer at a given time
  24. getTag(layer: Layer, tag: number): string
  25. // check if a layer has a marker at given time
  26. hasTag(layer: Layer, tag: number): boolean
  27. // get a unique path for a property, for example: ['ADBE Transform', 'ADBE Rotation']
  28. toPropertyPath(property: PropertyBase, pretty?: boolean): string[]
  29. // get a property on a layer by providing a path, see the example of a path above
  30. getPropertyAtPath(layer: Layer, propertyPath: string[]): PropertyBase | null
  31. // get a unique name for a layer or property
  32. getUniqueName(collection: any, prefix: string): string
  33. }
  34. interface Global {
  35. utils: Utils
  36. }
  37. declare var utils: Utils

More info soon…