TransformBlend

from panda3d.core import TransformBlend
class TransformBlend

This defines a single entry in a TransformBlendTable. It represents a unique combination of VertexTransform pointers and blend amounts.

Inheritance diagram

Inheritance diagram of TransformBlend

__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)None

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)None

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.

getNumTransforms()int

Returns the number of transforms stored in the blend object.

getTransform(n: int)VertexTransform

Returns the nth transform stored in the blend object.

getTransforms()list
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)None

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 modifiedUpdateSeq

Returns a counter which is guaranteed to increment at least as often as the result of getBlend() changes.

normalizeWeights()None

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.

output(out: ostream)None
removeTransform(transform: VertexTransform)None

Removes the indicated transform from the blend.

removeTransform(n: int)None

Removes the nth transform stored in the blend object.

setTransform(n: int, transform: VertexTransform)None

Replaces the nth transform stored in the blend object.

setWeight(n: int, weight: float)None

Replaces the weight associated with the nth transform stored in the blend object.

transformPoint(point: LPoint3d, current_thread: Thread)None

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: LPoint3f, current_thread: Thread)None
transformPoint(point: LPoint4d, current_thread: Thread)None

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: LPoint4f, current_thread: Thread)None
transformVector(point: LVector3d, current_thread: Thread)None

Transforms the indicated vector by the blend matrix.

You should call updateBlend() to ensure that the cache is up-to-date before calling this.

transformVector(point: LVector3f, current_thread: Thread)None
property transforms → Sequence[VertexTransform]
Getter

Returns the nth transform stored in the blend object.

Setter

Replaces the nth transform stored in the blend object.

updateBlend(current_thread: Thread)None

Recomputes the internal representation of the blend value, if necessary. You should call this before calling getBlend() or transformPoint().

property weightsfloat

Returns the weight associated with the nth transform stored in the blend object.

Returns the weight associated with the indicated transform, or 0 if there is no entry for the transform.

write(out: ostream, indent_level: int)None