unreal.PaperFlipbook

class unreal.PaperFlipbook(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

Contains an animation sequence of sprite frames

C++ Source:

  • Plugin: Paper2D

  • Module: Paper2D

  • File: PaperFlipbook.h

Editor Properties: (see get_editor_property/set_editor_property)

  • collision_source (FlipbookCollisionMode): [Read-Write] Collision source

  • default_material (MaterialInterface): [Read-Write] The material to use on a flipbook player instance if not overridden

  • frames_per_second (float): [Read-Write] The nominal frame rate to play this flipbook animation back at

  • key_frames (Array[PaperFlipbookKeyFrame]): [Read-Write] The set of key frames for this flipbook animation (each one has a duration and a sprite to display)

property collision_source: FlipbookCollisionMode

[Read-Only] Collision source

Type:

(FlipbookCollisionMode)

property default_material: MaterialInterface

[Read-Only] The material to use on a flipbook player instance if not overridden

Type:

(MaterialInterface)

property frames_per_second: float

[Read-Only] The nominal frame rate to play this flipbook animation back at

Type:

(float)

get_key_frame_index_at_time(time, clamp_to_ends=False) int32

Returns the keyframe index that covers the specified time (in seconds), or INDEX_NONE if none exists. When bClampToEnds is true, it will choose the first or last keyframe if the time is out of range.

Parameters:
Return type:

int32

get_num_frames() int32

Returns the total number of frames

Return type:

int32

get_num_key_frames() int32

Returns the number of key frames

Return type:

int32

get_sprite_at_frame(frame_index) PaperSprite

Returns the sprite at the specified keyframe index, or nullptr if none exists

Parameters:

frame_index (int32) –

Return type:

PaperSprite

get_sprite_at_time(time, clamp_to_ends=False) PaperSprite

Returns the sprite at the specified time (in seconds), or nullptr if none exists. When bClampToEnds is true, it will choose the first or last sprite if the time is out of range.

Parameters:
Return type:

PaperSprite

get_total_duration() float

Returns the total duration in seconds

Return type:

float

is_valid_key_frame_index(index) bool

Is the specified Index within the valid range of key frames?

Parameters:

index (int32) –

Return type:

bool