unreal.PaperFlipbook

class unreal.PaperFlipbook(outer=None, name='None')

Bases: unreal.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

[Read-Only] Collision source

Type

(FlipbookCollisionMode)

property default_material

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

Type

(MaterialInterface)

property frames_per_second

[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
Returns

Return type

int32

get_num_frames()int32

Returns the total number of frames

Returns

Return type

int32

get_num_key_frames()int32

Returns the number of key frames

Returns

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

Returns

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
Returns

Return type

PaperSprite

get_total_duration()float

Returns the total duration in seconds

Returns

Return type

float

is_valid_key_frame_index(index)bool

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

Parameters

index (int32) –

Returns

Return type

bool