maxon.GradientInterface¶
Description¶
Methods Signature¶
|
Compares this with another gradient. |
Converts the current gradient to an alpha gradient. |
|
|
Describes all elements of this class for I/O operations. |
Distributes the knots evenly. |
|
Doubles the knots. |
|
|
Flushes all the knots. |
Returns the internal alpha gradient as read-only. |
|
Gets the hash code for the gradient. |
|
|
Gets the knot at #index. |
Gets the number of knots. |
|
|
Inserts a knot |
Inverts the knots. |
|
Checks if this is an alpha gradient. |
|
|
Inserts a knot |
|
Sets the alpha mode. |
|
Sets knot at #index. |
Sorts the knots according to their position. |
|
|
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
-
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