maxon.GradientInterface

Description

This is the interface for the Gradient data type.
The data is reference-counted and a copy will automatically be created if a non-const function is called.
Alpha Gradients ONLY set Brightness, Color is always 1.0 while regular Gradients can set Brightness & Color.

Inheritance diagram

Inheritance

Child Class:

Methods Signature

Compare(arg2)

Compares this with another gradient.

ConvertToAlphaGradient()

Converts the current gradient to an alpha gradient.

DescribeIO(stream)

Describes all elements of this class for I/O operations.

DistributeKnots()

Distributes the knots evenly.

DoubleKnots()

Doubles the knots.

Flush()

Flushes all the knots.

GetAlphaGradient()

Returns the internal alpha gradient as read-only.

GetHashCode()

Gets the hash code for the gradient.

GetKnot(index)

Gets the knot at #index.

GetKnotCount()

Gets the number of knots.

InsertKnot(knot[, keepId])

Inserts a knot

InvertKnots()

Inverts the knots.

IsAlphaGradient()

Checks if this is an alpha gradient.

RemoveKnot(index)

Inserts a knot

SetIsAlphaGradient(alphaGradient)

Sets the alpha mode.

SetKnot(index, k)

Sets knot at #index.

SortKnots()

Sorts the knots according to their position.

transformColorDelegate(transformColorDelegate)

Initializes the gradient for rendering.

Methods Definition

GradientInterface.Compare(arg2)

Compares this with another gradient.

Parameters

arg2 (maxon.GradientInterface) – The other gradient to compare with.

Returns

The comparison result.

Return type

maxon.COMPARERESULT

GradientInterface.ConvertToAlphaGradient()

Converts the current gradient to an alpha gradient.

static GradientInterface.DescribeIO(stream)

Describes all elements of this class for I/O operations.

Parameters

stream (maxon.DataSerializeInterface) – The stream that is used to register the class members.

GradientInterface.DistributeKnots()

Distributes the knots evenly.

Returns

True if any knot distributed, otherwise false.

Return type

bool

GradientInterface.DoubleKnots()

Doubles the knots.

Returns

True if any knot doubled, otherwise false.

Return type

bool

GradientInterface.Flush()

Flushes all the knots.

GradientInterface.GetAlphaGradient()

Returns the internal alpha gradient as read-only.

Returns

The alpha gradient.

Return type

Optional[maxon.Gradient]

GradientInterface.GetHashCode()

Gets the hash code for the gradient.

Returns

The checksum.

Return type

int

GradientInterface.GetKnot(index)

Gets the knot at #index.

Parameters

index (int) – The knot index. 0 <= #index < GetKnotCount()

Returns

The knot.

Return type

maxon.GradientKnot

GradientInterface.GetKnotCount()

Gets the number of knots.

Returns

The knot count.

Return type

int

GradientInterface.InsertKnot(knot, keepId=False)

Inserts a knot

Parameters
  • knot (maxon.GradientKnot) – The knot to insert.

  • keepId (bool) – Specifies if the knot ID should be taken from knot or if a new one should be generated.

Returns

The index of the inserted knot, GetKnotCount() - 1

Return type

int

GradientInterface.InvertKnots()

Inverts the knots.

Returns

True if any knot inverted, otherwise false.

Return type

bool

GradientInterface.IsAlphaGradient()

Checks if this is an alpha gradient.

Returns

True, if this is an alpha gradient.

Return type

bool

GradientInterface.RemoveKnot(index)

Inserts a knot

Parameters

index (int) – The knot index. 0 <= #index < GetKnotCount()

GradientInterface.SetIsAlphaGradient(alphaGradient)

Sets the alpha mode.

Parameters

alphaGradient (bool) – The gradient alpha type.

GradientInterface.SetKnot(index, k)

Sets knot at #index.

Parameters
  • index (int) – The knot index. 0 <= #index < GetKnotCount()

  • k (maxon.GradientKnot) – The knot.

GradientInterface.SortKnots()

Sorts the knots according to their position.

GradientInterface.transformColorDelegate(transformColorDelegate)

Initializes the gradient for rendering.

Parameters

transformColorDelegate (Callable[[maxon.Color64], maxon.Color64]) – A delegate to transform the color of a gradient knot.

Returns

The render data.

Return type

maxon.GradientRenderData