ShapeLayer

Shape layers contain vector graphics objects called shapes. By default, a shape consists of a path, a stroke, and a fill. (See About paths and Strokes and fills for shapes.)

You create shape layers by drawing in the Composition panel with the shape tools or the Pen tool in . (See Creating shapes and masks.)

Shape paths have two varieties: parametric shape paths and Bezier shape paths. Parametric shape paths are defined numerically, by properties that you can modify and animate after drawing, in the Timeline panel. Bezier shape paths are defined by a collection of vertices (path points) and segments that you can modify in the Composition panel. You work with Bezier shape paths in the same way that you work with mask paths. All mask paths are Bezier paths.

Shape paths, paint operations, and path operations for shapes are collectively called shape attributes. You add shape attributes using the Add menu in the Tools panel or in the Timeline panel. Each shape attribute is represented as a property group in the Timeline panel, with properties that you can animate, just as you do with any other layer property. (See About animation, keyframes, and expressions.)

This type of layer acts as a container for all the primitive shape types.

Mapped field: ty

Mapped Field Value: 4

Hierarchy

Constructors

constructor

Properties

anchor

anchor: Property = new Property(this, PropertyType.ANCHOR)

autoOrient

autoOrient: boolean = false

blendMode

blendMode: BlendMode = BlendMode.NORMAL

classNames

classNames: string[] = []

effects

effects: any

height

height: number = 0

id

id: string = ""

inPoint

inPoint: number = 0

Optional index

index: undefined | number

is3D

is3D: boolean = false

name

name: string = ""

opacity

opacity: Property = new Property(this, PropertyType.OPACITY)

Optional orientation

outPoint

outPoint: number = 0

Protected parent

parent: any

position

position: Property = new Property(this, PropertyType.POSITION)

Optional rotation

Optional rotationX

Optional rotationY

Optional rotationZ

scale

scale: Property = new Property(this, PropertyType.SCALE)

shapes

Optional skew

Optional skewAxis

startTime

startTime: number = 0

timeStretch

timeStretch: number = 1

Readonly type

type: SHAPE = LayerType.SHAPE

width

width: number = 0

Accessors

colors

  • get colors(): string[]

  • Returns string[]

    Array of colors.

totalFrames

  • get totalFrames(): number

  • Returns number

    Number of frames.

Methods

createShape

createShapeFromJSON

  • createShapeFromJSON(json: Record<string, any>): Shape

  • Parameters

    • json: Record<string, any>

    Returns Shape

fromJSON

  • fromJSON(json: Record<string, any>): ShapeLayer

  • Parameters

    • json: Record<string, any>

    Returns ShapeLayer

    ShapeLayer instance

toJSON

  • toJSON(key?: undefined | string): Record<string, any> | undefined

  • Parameters

    • Optional key: undefined | string

    Returns Record<string, any> | undefined

    JSON object

Last updated