panda3d.core.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

__init__() → None
__init__(copy: TransformBlend) → None
__init__(transform0: VertexTransform, weight0: float) → None
__init__(transform0: VertexTransform, weight0: float, transform1: VertexTransform, weight1: float) → None
__init__(transform0: VertexTransform, weight0: float, transform1: VertexTransform, weight1: float, transform2: VertexTransform, weight2: float) → None
__init__(transform0: VertexTransform, weight0: float, transform1: VertexTransform, weight1: float, transform2: VertexTransform, weight2: float, transform3: VertexTransform, weight3: float) → None
assign(copy: TransformBlend) → TransformBlend
Return type

TransformBlend

compareTo(other: TransformBlend) → int

Defines an arbitrary ordering for TransformBlend objects.

addTransform(transform: VertexTransform, weight: float) → None

Adds a new transform to the blend. If the transform already existed, increases its weight factor.

removeTransform(transform: VertexTransform) → None

Removes the indicated transform from the blend.

removeTransform(n: size_t) → None

Removes the nth transform stored in the blend object.

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.

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.

hasTransform(transform: VertexTransform) → bool

Returns true if the blend has the indicated transform, false otherwise.

getWeight(transform: VertexTransform) → float

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

getWeight(n: size_t) → float

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

getNumTransforms() → size_t

Returns the number of transforms stored in the blend object.

Return type

size_t

getTransform(n: size_t) → VertexTransform

Returns the nth transform stored in the blend object.

Return type

VertexTransform

setTransform(n: size_t, transform: VertexTransform) → None

Replaces the nth transform stored in the blend object.

setWeight(n: size_t, weight: float) → None

Replaces the weight associated with 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().

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.

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
getModified(current_thread: Thread) → UpdateSeq

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

Return type

UpdateSeq

output(out: ostream) → None
write(out: ostream, indent_level: int) → None
static getClassType() → TypeHandle
Return type

TypeHandle

getTransforms() → list
property transforms
Getter

Returns the nth transform stored in the blend object.

Setter

Replaces the nth transform stored in the blend object.

Return type

Sequence[VertexTransform]

property weights

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.

Return type

Mapping[float]

property modified

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

Return type

UpdateSeq