TransformBlend

from panda3d.core import TransformBlend
class TransformBlend

Bases:

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
add_transform(transform: VertexTransform, weight: float)

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

assign(copy: TransformBlend) TransformBlend
compare_to(other: TransformBlend) int

Defines an arbitrary ordering for TransformBlend objects.

get_blend(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 update_blend() to ensure that the cache is up-to-date before calling this.

static get_class_type() TypeHandle
get_modified(current_thread: Thread) UpdateSeq

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

get_num_transforms() int

Returns the number of transforms stored in the blend object.

get_transform(n: int) VertexTransform

Returns the nth transform stored in the blend object.

get_transforms() list
get_weight(transform: VertexTransform) float

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

get_weight(n: int) float

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

has_transform(transform: VertexTransform) bool

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

limit_transforms(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 get_blend() changes.

normalize_weights()

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)
remove_transform(transform: VertexTransform)

Removes the indicated transform from the blend.

remove_transform(n: int)

Removes the nth transform stored in the blend object.

set_transform(n: int, transform: VertexTransform)

Replaces the nth transform stored in the blend object.

set_weight(n: int, weight: float)

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

transform_point(point: LPoint3d, current_thread: Thread)

Transforms the indicated point by the blend matrix.

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

transform_point(point: LPoint3f, current_thread: Thread)
transform_point(point: LPoint4d, current_thread: Thread)

Transforms the indicated point by the blend matrix.

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

transform_point(point: LPoint4f, current_thread: Thread)
transform_vector(point: LVector3d, current_thread: Thread)

Transforms the indicated vector by the blend matrix.

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

transform_vector(point: LVector3f, current_thread: Thread)
property transforms Sequence[VertexTransform]

Returns/Replaces the nth transform stored in the blend object.

update_blend(current_thread: Thread)

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

property weights float

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)