TransformBlend
from panda3d.core import TransformBlend
- class TransformBlend
Bases:
This defines a single entry in a
TransformBlendTable
. It represents a unique combination ofVertexTransform
pointers and blend amounts.Inheritance diagram
- __eq__(other: TransformBlend) bool
- __init__()
- __init__(copy: TransformBlend)
- __init__(transform0: VertexTransform, weight0: float)
- __init__(transform0: VertexTransform, weight0: float, transform1: VertexTransform, weight1: float)
- __init__(transform0: VertexTransform, weight0: float, transform1: VertexTransform, weight1: float, transform2: VertexTransform, weight2: float)
- __init__(transform0: VertexTransform, weight0: float, transform1: VertexTransform, weight1: float, transform2: VertexTransform, weight2: float, transform3: VertexTransform, weight3: float)
- __lt__(other: TransformBlend) bool
- __ne__(other: TransformBlend) bool
- addTransform(transform: VertexTransform, weight: float)
Adds a new transform to the blend. If the transform already existed, increases its weight factor.
- assign(copy: TransformBlend) TransformBlend
- compareTo(other: TransformBlend) int
Defines an arbitrary ordering for
TransformBlend
objects.
- getBlend(result: LMatrix4, current_thread: Thread)
Returns the current value of the blend, based on the current value of all of the nested transform objects and their associated weights.
You should call
updateBlend()
to ensure that the cache is up-to-date before calling this.
- static getClassType() TypeHandle
- getModified(current_thread: Thread) UpdateSeq
Returns a counter which is guaranteed to increment at least as often as the result of
getBlend()
changes.
- getTransform(n: int) VertexTransform
Returns the nth transform stored in the blend object.
- getWeight(transform: VertexTransform) float
Returns the weight associated with the indicated transform, or 0 if there is no entry for the transform.
- getWeight(n: int) float
Returns the weight associated with the nth transform stored in the blend object.
- hasTransform(transform: VertexTransform) bool
Returns true if the blend has the indicated transform, false otherwise.
- limitTransforms(max_transforms: int)
If the total number of transforms in the blend exceeds max_transforms, removes the n least-important transforms as needed to reduce the number of transforms to max_transforms.
- property modified UpdateSeq
Returns a counter which is guaranteed to increment at least as often as the result of
getBlend()
changes.
- normalizeWeights()
Rescales all of the weights on the various transforms so that they sum to 1.0. It is generally a good idea to call this after adding or removing transforms from the blend.
- removeTransform(transform: VertexTransform)
Removes the indicated transform from the blend.
- removeTransform(n: int)
Removes the nth transform stored in the blend object.
- setTransform(n: int, transform: VertexTransform)
Replaces the nth transform stored in the blend object.
- setWeight(n: int, weight: float)
Replaces the weight associated with the nth transform stored in the blend object.
- transformPoint(point: LPoint3d, current_thread: Thread)
Transforms the indicated point by the blend matrix.
You should call
updateBlend()
to ensure that the cache is up-to-date before calling this.
- transformPoint(point: LPoint4d, current_thread: Thread)
Transforms the indicated point by the blend matrix.
You should call
updateBlend()
to ensure that the cache is up-to-date before calling this.
- transformVector(point: LVector3d, current_thread: Thread)
Transforms the indicated vector by the blend matrix.
You should call
updateBlend()
to ensure that the cache is up-to-date before calling this.
- property transforms Sequence[VertexTransform]
Returns/Replaces the nth transform stored in the blend object.
- updateBlend(current_thread: Thread)
Recomputes the internal representation of the blend value, if necessary. You should call this before calling
getBlend()
ortransformPoint()
.