Overview
The Aspose.3D animation system is organised around a hierarchy of objects that bind time-sampled data to scene properties.
- An
AnimationClip is a named playback range (e.g. “Walk”, “Run”) held by a Scene. - An
AnimationNode lives inside a clip and binds animated data to specific properties on scene objects. - A
BindPoint connects an AnimationNode to a named Property on an A3DObject. - An
AnimationChannel holds a single scalar KeyframeSequence within a bind point. - A
KeyframeSequence is an ordered list of KeyFrame time–value samples.
All animation classes are in the aspose.threed.animation sub-package, though they are also accessible directly from aspose.threed.
AnimationClip
A named container for one playback range. A Scene may hold multiple clips. Inherits from SceneObject.
Constructor
| Signature | Description |
|---|
AnimationClip(name=None) | Creates a clip with an optional name |
Properties
| Name | Type | Description |
|---|
name | str | Clip name (e.g. "Walk") |
description | str | Optional description |
start | float | Start time in seconds |
stop | float | End time in seconds |
animations | list[AnimationNode] | Read-only list of animation nodes in this clip |
properties | PropertyCollection | Custom properties |
Methods
| Method | Return Type | Description |
|---|
create_animation_node(node_name) | AnimationNode | Creates and registers a new AnimationNode in this clip |
AnimationNode
Binds an AnimationClip to one or more BindPoint objects targeting scene-object properties. Inherits from A3DObject.
Constructor
| Signature | Description |
|---|
AnimationNode(name=None) | Creates an animation node with optional name |
Properties
| Name | Type | Description |
|---|
name | str | Node name |
bind_points | list[BindPoint] | Read-only list of bind points |
sub_animations | list[AnimationNode] | Read-only list of child animation nodes |
properties | PropertyCollection | Custom properties |
Methods
| Method | Return Type | Description |
|---|
find_bind_point(target, name) | BindPoint | None | Finds a bind point for the property named name on target |
get_bind_point(target, prop_name, create) | BindPoint | None | Gets (or creates) a bind point for a named property |
create_bind_point(obj, prop_name) | BindPoint | None | Creates a new bind point for the property prop_name on obj |
get_keyframe_sequence(target, prop_name, channel_name, create) | KeyframeSequence | None | Returns the keyframe sequence for the named channel; creates it if create=True |
BindPoint
Connects an AnimationNode to a single Property on an A3DObject. Each BindPoint may hold multiple AnimationChannel objects (one per scalar component). Inherits from A3DObject.
Properties
| Name | Type | Description |
|---|
property | Property | The scene-object property this bind point targets |
channels_count | int | Number of animation channels in this bind point |
Methods
| Method | Return Type | Description |
|---|
add_channel(name, value, type=None) | bool | Adds a named channel with a default value |
get_channel(channel_name) | AnimationChannel | None | Retrieves a channel by name |
get_keyframe_sequence(channel_name) | KeyframeSequence | None | Returns the keyframe sequence for the named channel |
create_keyframe_sequence(name) | KeyframeSequence | Creates a new KeyframeSequence for this bind point |
bind_keyframe_sequence(channel_name, sequence) | None | Associates an existing KeyframeSequence with a channel |
reset_channels() | None | Removes all channels |
AnimationChannel
Holds a single scalar KeyframeSequence for one animated component.
Properties
| Name | Type | Description |
|---|
name | str | Channel name (e.g. "X", "Y", "Z") |
default_value | Any | Value used when no keyframe data is present |
keyframe_sequence | KeyframeSequence | None | The sequence of keyframes for this channel |
KeyframeSequence
An ordered list of KeyFrame samples for a single scalar channel. Inherits from A3DObject.
Constructor
| Signature | Description |
|---|
KeyframeSequence(name=None) | Creates an empty keyframe sequence |
Properties
| Name | Type | Description |
|---|
name | str | Sequence name |
key_frames | list[KeyFrame] | Read-only list of keyframes in chronological order |
pre_behavior | Extrapolation | Behaviour before the first keyframe |
post_behavior | Extrapolation | Behaviour after the last keyframe |
bind_point | BindPoint | None | The bind point owning this sequence |
Methods
| Method | Return Type | Description |
|---|
add(time, value, interpolation=Interpolation.LINEAR) | None | Appends a keyframe at time (seconds) with the given value and interpolation mode |
reset() | None | Clears all keyframes and resets pre/post behaviour |
KeyFrame
A single time–value sample in a KeyframeSequence.
Constructor
KeyFrame objects are created internally by KeyframeSequence.add(); do not construct them directly.
Properties
| Name | Type | Description |
|---|
time | float | Time position in seconds |
value | float | Animated value at this time |
interpolation | Interpolation | Interpolation mode applied between this keyframe and the next |
tangent_weight_mode | WeightedMode | Tangent weight mode (Bezier curves) |
step_mode | StepMode | Step behaviour (PREVIOUS_VALUE or NEXT_VALUE) |
next_in_tangent | Vector2 | None | Incoming tangent vector for Bezier interpolation |
out_tangent | Vector2 | None | Outgoing tangent vector for Bezier interpolation |
out_weight | float | Outgoing tangent weight |
next_in_weight | float | Incoming tangent weight |
tension | float | Tension parameter (TCB spline) |
continuity | float | Continuity parameter (TCB spline) |
bias | float | Bias parameter (TCB spline) |
independent_tangent | bool | When True, in and out tangents are independent |
flat | bool | When True, tangents are clamped flat |
time_independent_tangent | bool | When True, tangent direction is independent of time scaling |
Interpolation (Enum)
Controls how values are interpolated between consecutive keyframes.
| Value | Description |
|---|
CONSTANT | Step (hold previous value until next keyframe) |
LINEAR | Linear interpolation between values |
BEZIER | Cubic Bezier using in/out tangents |
B_SPLINE | Uniform B-spline |
CARDINAL_SPLINE | Cardinal spline |
TCB_SPLINE | Tension–Continuity–Bias spline |
ExtrapolationType (Enum)
Controls animation behaviour beyond the first and last keyframe.
| Value | Description |
|---|
CONSTANT | Hold the boundary value |
GRADIENT | Extrapolate at the tangent gradient of the boundary keyframe |
CYCLE | Repeat the keyframe range (loops) |
CYCLE_RELATIVE | Repeat with cumulative offset (relative to end value) |
OSCILLATE | Ping-pong (alternating forward and backward repeat) |
Example
See Also