Skip to content

hkb_editor.workflows.create_stateinfo

create_stateinfo

create_stateinfo(
    behavior: HavokBehavior,
    statemachine_name: str,
    base_name: str,
    animation: Animation,
    event: Event,
    *,
    playback_mode: hkbClipGenerator_PlaybackMode = PlaybackMode.SINGLE_PLAY,
    animation_end_event_type: CustomManualSelectorGenerator_AnimeEndEventType = AnimeEndEventType.FIRE_IDLE_EVENT,
    offset_type: CustomManualSelectorGenerator_OffsetType = OffsetType.IDLE_CATEGORY,
    enable_tae: bool = True,
    enable_script: bool = True,
    transition_effect: HkbRecord = None,
    copy_transition_effect: bool = True,
    transition_flags: hkbStateMachine_TransitionInfoArray_Flags = TransitionInfoFlags(
        3584
    ),
) -> tuple[HkbRecord, HkbRecord, HkbRecord]

Create a new animation slot: StateInfo, CMSG and ClipGenerator.

The state is registered as a wildcard transition on the named state machine, so it can be triggered from HKS through event.

Parameters:

Name Type Description Default
behavior HavokBehavior

Behavior to modify.

required
statemachine_name str

Name of the hkbStateMachine to attach the state to.

required
base_name str

Used to name the CMSG, ClipGenerator and TransitionInfo.

required
animation Animation

Animation the ClipGenerator plays.

required
event Event

Event that activates the new state.

required
playback_mode hkbClipGenerator_PlaybackMode

ClipGenerator playback mode.

SINGLE_PLAY
animation_end_event_type CustomManualSelectorGenerator_AnimeEndEventType

What the CMSG does when the animation ends.

FIRE_IDLE_EVENT
offset_type CustomManualSelectorGenerator_OffsetType

How the CMSG picks the clip to activate.

IDLE_CATEGORY
enable_tae bool

Whether the CMSG should use the TAE.

True
enable_script bool

Whether the CMSG should call HKS functions (onUpdate and co.).

True
transition_effect HkbRecord

How animations blend when transitioning into the new state.

None
copy_transition_effect bool

Copy the transition effect instead of reusing the instance.

True
transition_flags hkbStateMachine_TransitionInfoArray_Flags

Flags for the new TransitionInfo.

hkbStateMachine_TransitionInfoArray_Flags(3584)

Returns:

Type Description
tuple

The new (state, cmsg, clip).

get_statemachines

get_statemachines(
    behavior: HavokBehavior,
) -> list[HkbRecord]

All hkbStateMachine records in the behavior.

Ko-fi donations