Skip to content

Curves

Curves

The five curves of a Curves effect.

Read-only: py-aep does not write curves back to the project, and reads them from one (Property.value or Keyframe.value).

Attributes

channels

channels: dict[str, CurvesChannel]

The curves by channel name, in CURVES_CHANNELS order.

is_identity

is_identity: bool

Whether every curve leaves every level unchanged, as an untouched Curves does.

mode

mode: int

1 when the curves are drawn with points, 0 with the pencil.

uses_points

uses_points: bool

Whether the curves go through their points; if not, they were drawn with the pencil and their maps are what renders.

version

version: int

The data's version, 1.

Functions

evaluate

evaluate(
    channel: str, x: float, clamp: bool = True
) -> float

One channel's curve at x in 0..1, on its own (not through the master): the spline through its points, or its map read linearly when drawn with the pencil. Clamped to 0..1 unless clamp is False, which leaves the spline's overshoot between the points.

Raises:

  • ValueError –

    If channel is not one of CURVES_CHANNELS, or x is not a finite number.

CurvesChannel

One channel's curve: its points and its 8-bit map. Read-only.

Attributes

is_identity

is_identity: bool

Whether the curve leaves every level unchanged.

Drawn with the pencil, the map is the curve and the points are stale, so only the map counts.

map

map: list[int]

256 output levels, one per input level.

name

name: str

The channel: rgb (the master), red, green, blue or alpha.

points

points: list[tuple[int, int]]

The live points, (input, output) in 0..255.

selected

selected: int

The index of the selected point, -1 for none.