Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PathProperty

Hierarchy

Index

Constructors

constructor

Properties

Readonly name

name: string = "Property name"

Readonly numKeys

numKeys: number = 0

The number of keyframes on the property

Readonly propertyIndex

propertyIndex: number = 0

The index number of the property in it's property group

Readonly speed

speed: PathValue

A 1D, positive speed value equal to the speed at which the property is changing at the default time. This element can be used only for spatial properties.

Readonly value

value: PathValue

Readonly velocity

velocity: PathValue

The temporal velocity value at the current time. For spatial properties, such as Position, it returns the tangent vector value. The result is the same dimension as the property.

Methods

createPath

  • Creates a path object from a set of points and tangents.

    Parameters

    • points: Points = ...

      An array of number pair arrays representing x,y coordinates of the path points. The array length must be at least 1, and can be of any greater length.

    • inTangents: Points | [] = ...

      An array containing number pair arrays representing the [x,y] offset coordinates of the tangent handles to the path points. Required unless no parameters are passed (i.e., createPath()). The array length must be the same as points, or you can pass an empty array ([]), which will assume the same length as points and [0,0] for all tangents.

    • outTangents: Points | [] = ...

      See inTangents

    • is_closed: boolean = true

    Returns PathValue

inTangents

  • inTangents(time?: number): Points
  • Retrieves the path's in tangent point array

    Parameters

    • Optional time: number

      The time at which to sample the path

    Returns Points

isClosed

  • isClosed(): boolean
  • Returns boolean

    Whether a path is closed (the last point connected to the first)

key

  • Parameters

    • index: number

      The index of the keyframe to return (e.g. the 1st keyframe)

    Returns Key<PathValue>

    The keyframe at the specified index on the property

loopIn

  • Loops a segment of time that is measured from the first keyframe on the layer forward toward the Out point of the layer. The loop plays from the In point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • numKeyframes: number = 0

      determines what segment is looped: The segment looped is the portion of the layer from the first keyframe to the numKeyframes+1 keyframe. The default value of 0 means that all keyframes loop

    Returns PathValue

loopInDuration

  • Loops a segment of time that is measured from the first keyframe on the layer forward toward the Out point of the layer. The loop plays from the In point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • duration: number = 0

      The number of composition seconds in a segment to loop; the specified range is measured from the first keyframe

    Returns PathValue

loopOut

  • Loops a segment of time that is measured from the last keyframe on the layer back toward the In point of the layer. The loop plays until the Out point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • numKeyframes: number = 0

      determines what segment is looped: The segment looped is the portion of the layer from the last keyframe to the thisProperty.numKeys - numKeyframes keyframe. The default value of 0 means that all keyframes loop

    Returns PathValue

loopOutDuration

  • Loops a segment of time that is measured from the last keyframe on the layer back toward the In point of the layer. The loop plays until the Out point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • duration: number = 0

      The number of composition seconds in a segment to loop; the specified range is measured from the last keyframe backwards.

    Returns PathValue

nearestKey

normalOnPath

  • normalOnPath(percentage?: number, time?: number): Vector2D
  • Get the calculated x,y coordinates of the normal for an arbitrary point along a path.

    Parameters

    • Optional percentage: number

      How far along the path to get the point, between 0 and 1.

    • Optional time: number

      The time at which to sample the path

    Returns Vector2D

outTangents

  • outTangents(time?: number): Points
  • Retrieves the path's out tangent point array

    Parameters

    • Optional time: number

      The time at which to sample the path

    Returns Points

pointOnPath

  • pointOnPath(percentage?: number, time?: number): Vector2D
  • Get the x,y coordinates of an arbitrary point along a path.

    Parameters

    • percentage: number = 0.5

      How far along the path to get the point, between 0 and 1.

    • time: number = 0

      The time at which to sample the path

    Returns Vector2D

points

  • points(time?: number): Points
  • Retrieves the points array for a path

    Parameters

    • time: number = 0

      The time at which to sample the path

    Returns Points

propertyGroup

  • Parameters

    • countUp: number

      The number of levels in the property hierarchy to ascend, e.g. countUp = 1 will return the parent PropertyGroup.

    Returns PropertyGroup

    The group of properties (PropertyGroup object) relative to the property of which the expression is written

smooth

  • smooth(width?: number, samples?: number, time?: number): PathValue
  • Smooths the property values over time, converting large, brief deviations in the value to smaller, more evenly distributed deviations. This smoothing is accomplished by applying a box filter to the value of the property at the specified time.

    Parameters

    • width: number = 0.2

      The range of time (in seconds) over which the filter is averaged.

    • samples: number = 5

      The number of discrete samples evenly spaced over time; use a larger value for greater smoothness (but decreased performance). Generally, you’ll want samples to be an odd number so that the value at the current time is included in the average.

    • time: number = 0

    Returns PathValue

speedAtTime

  • Parameters

    • time: number

      The composition time in seconds to get the speed at

    Returns PathValue

    A 1D, positive speed value equal to the speed at which the property is changing at the specified time. This element can be used only for spatial properties.

tangentOnPath

  • tangentOnPath(percentage?: number, time?: number): Vector2D
  • Get the calculated x,y coordinates of the outgoing tangent handle for an arbitrary point along a path.

    Parameters

    • Optional percentage: number

      How far along the path to get the point, between 0 and 1.

    • Optional time: number

      The time at which to sample the path

    Returns Vector2D

temporalWiggle

  • temporalWiggle(freq: number, amp: number, octaves?: number, amp_mult?: number, time?: number): PathValue
  • Samples the property value at a time which is wiggled

    Parameters

    • freq: number

      The rate at which the value changes in wiggles per second

    • amp: number

      How much the value should change, in units of the original property value (e.g. 1 by 100% of the original value)

    • octaves: number = 1

      How much detail the wiggle has, which is driven by the number of "octaves" of noise to multiply together. Higher values will have more detail

    • amp_mult: number = 0.5

      The amount the given amplitude is multiplied by for each octave, which controls the falloff of the upper harmonics ("octaves").

    • time: number = 0

      The time at which the value is sampled for use within the wiggle

    Returns PathValue

valueAtTime

  • Returns the value for the property at the specified time

    Parameters

    • time: number

      THe composition time in seconds to get the value at

    Returns PathValue

velocityAtTime

  • Parameters

    • time: number

      The composition time in seconds to get the velocity at

    Returns PathValue

    The temporal velocity value at the specified time. For spatial properties, such as Position, it returns the tangent vector value. The result is the same dimension as the property.

wiggle

  • wiggle(freq: number, amp: number, octaves?: number, amp_mult?: number, time?: number): PathValue
  • Modifies the property value randomly over time.

    Parameters

    • freq: number

      The rate at which the value changes in wiggles per second

    • amp: number

      How much the value should change, in units of the original property value (e.g. 1 by 100% of the original value)

    • octaves: number = 1

      How much detail the wiggle has, which is driven by the number of "octaves" of noise to multiply together. Higher values will have more detail

    • amp_mult: number = 0.5

      The amount the given amplitude is multiplied by for each octave, which controls the falloff of the upper harmonics ("octaves").

    • time: number = 0

      The time at which the value is sampled for use within the wiggle

    Returns PathValue

Generated using TypeDoc