state_machine

package
v0.7.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const VariableNamePrefix string = "var_"

If a variable name would be invalid (starts with a number), then prepend this prefix to correct the issue

Variables

This section is empty.

Functions

func IsInf added in v0.7.13

func IsInf(val uint32) bool

func IsNaN added in v0.7.13

func IsNaN(val uint32) bool

func UnNaNBox added in v0.7.13

func UnNaNBox(val uint32) uint32

Types

type AnimationEvent added in v0.7.1

type AnimationEvent struct {
	Name         stingray.ThinHash `json:"-"`
	ResolvedName string            `json:"animation_event_name"`
	Index        int32             `json:"index"`
}

type CustomBlendFunction added in v0.7.13

type CustomBlendFunction struct {
	DriverType
	Postfix []uint32
}

func ParseBlendFunction added in v0.7.13

func ParseBlendFunction(data []uint32) ([]CustomBlendFunction, error)

func (CustomBlendFunction) MarshalText added in v0.7.13

func (f CustomBlendFunction) MarshalText() ([]byte, error)

func (CustomBlendFunction) ParsePostfix added in v0.7.13

func (f CustomBlendFunction) ParsePostfix() ([]postFixNode, error)

func (CustomBlendFunction) ToDriver added in v0.7.13

func (f CustomBlendFunction) ToDriver(variables []string) (*DriverInformation, error)

type CustomBlendFunctionType added in v0.7.13

type CustomBlendFunctionType uint32
const (
	CustomBlendFunctionType_Add          CustomBlendFunctionType = 0x7f800000
	CustomBlendFunctionType_Sub          CustomBlendFunctionType = 0x7f800001
	CustomBlendFunctionType_Mult         CustomBlendFunctionType = 0x7f800002
	CustomBlendFunctionType_Divide       CustomBlendFunctionType = 0x7f800003
	CustomBlendFunctionType_Negate       CustomBlendFunctionType = 0x7f800004
	CustomBlendFunctionType_UnaryPlus    CustomBlendFunctionType = 0x7f800005
	CustomBlendFunctionType_Sin          CustomBlendFunctionType = 0x7f800006
	CustomBlendFunctionType_Cos          CustomBlendFunctionType = 0x7f800007
	CustomBlendFunctionType_Abs          CustomBlendFunctionType = 0x7f800008
	CustomBlendFunctionType_Match        CustomBlendFunctionType = 0x7f800009
	CustomBlendFunctionType_Match2d      CustomBlendFunctionType = 0x7f80000a
	CustomBlendFunctionType_MatchRange   CustomBlendFunctionType = 0x7f80000b
	CustomBlendFunctionType_MatchRange2d CustomBlendFunctionType = 0x7f80000c
	CustomBlendFunctionType_Rand         CustomBlendFunctionType = 0x7f80000d
	CustomBlendFunctionType_Clamp        CustomBlendFunctionType = 0x7f800012 // No clue what this actually is unfortunately, seems like it might be helldivers custom? Guessing that its clamp but might be wrong
	CustomBlendFunctionType_None         CustomBlendFunctionType = 0x7f80ffff
)

func (CustomBlendFunctionType) MarshalText added in v0.7.13

func (c CustomBlendFunctionType) MarshalText() ([]byte, error)

func (CustomBlendFunctionType) OperandCount added in v0.7.13

func (c CustomBlendFunctionType) OperandCount() int

func (CustomBlendFunctionType) Operator added in v0.7.13

func (c CustomBlendFunctionType) Operator() string

func (CustomBlendFunctionType) String added in v0.7.13

func (c CustomBlendFunctionType) String() string

type CustomBlendToken added in v0.7.13

type CustomBlendToken uint32
const (
	Token_Function CustomBlendToken = 0x7f800000
	Token_Variable CustomBlendToken = 0x7f900000
	Token_Stop     CustomBlendToken = 0x7fa00000
	Token_Mask     CustomBlendToken = 0x7ff00000
)

type CustomBlendVariableType added in v0.7.13

type CustomBlendVariableType uint32
const CustomBlendVariableType_VariableBase CustomBlendVariableType = 0x7f900000

type DriverInformation added in v0.7.13

type DriverInformation struct {
	Expression string       `json:"expression"`
	Variables  []string     `json:"variables"`
	Limits     [][3]float32 `json:"limits"`
	Type       DriverType   `json:"type"`
}

type DriverType added in v0.7.13

type DriverType uint32
const (
	DriverType_Influence DriverType = iota
	DriverType_PlaybackSpeed
)

func (DriverType) MarshalText added in v0.7.13

func (s DriverType) MarshalText() ([]byte, error)

func (DriverType) String added in v0.7.13

func (i DriverType) String() string

type IndexedVector

type IndexedVector struct {
	Index uint32  `json:"index"`
	X     float32 `json:"x"`
	Y     float32 `json:"y"`
	Z     float32 `json:"z"`
}

type IntFloatPair added in v0.7.13

type IntFloatPair struct {
	Index uint32  `json:"index"`
	Value float32 `json:"value"`
}

type Layer added in v0.7.13

type Layer struct {
	Magic        uint32  `json:"magic"`
	DefaultState uint32  `json:"default_state"`
	States       []State `json:"states"`
}
type Link struct {
	Index        uint32            `json:"index"`
	BlendTime    float32           `json:"blend_time"`
	Type         LinkType          `json:"type"`
	Beat         stingray.ThinHash `json:"-"`
	ResolvedBeat string            `json:"beat"`
}

type LinkType added in v0.7.13

type LinkType uint32
const (
	LinkType_Immediate LinkType = iota
	LinkType_WaitEnd
	LinkType_SyncBeatClosestImmediate
	LinkType_WaitUntilBeat
	LinkType_SyncPercentageImmediate
	LinkType_SyncInversePercentageImmediate
)

func (LinkType) MarshalText added in v0.7.13

func (s LinkType) MarshalText() ([]byte, error)

func (LinkType) String added in v0.7.13

func (i LinkType) String() string

type ResolvedAnimationVariable added in v0.7.13

type ResolvedAnimationVariable struct {
	Name  string  `json:"name"`
	Value float32 `json:"default"`
}

type State added in v0.7.1

type State struct {
	Name                      stingray.Hash              `json:"-"`
	ResolvedName              string                     `json:"name"`
	Type                      StateType                  `json:"type"`
	AnimationHashes           []stingray.Hash            `json:"-"`
	ResolvedAnimationHashes   []string                   `json:"animations,omitempty"`
	AnimationWeights          []float32                  `json:"animation_weights,omitempty"`
	Unk01                     uint32                     `json:"unk01"`
	Loop                      bool                       `json:"loop"`
	Additive                  bool                       `json:"additive"`
	StateTransitions          map[stingray.ThinHash]Link `json:"-"`
	ResolvedStateTransitions  map[string]Link            `json:"state_transitions,omitempty"`
	CustomBlendFuncDefinition []CustomBlendFunction      `json:"custom_blend_function,omitempty"`
	VectorList                []Vectors                  `json:"vectors,omitempty"`
	EmitEndEvent              stingray.ThinHash          `json:"-"`
	ResolvedEmitEndEvent      string                     `json:"emit_end_event,omitempty"`
	EndTransitionTime         float32                    `json:"end_transition_time,omitzero"`
	BlendSetMaskIndex         int32                      `json:"blend_set_mask_index"`
	BlendVariableIndex        uint32                     `json:"blend_variable_index"`
	Unk04                     [2]uint32                  `json:"unk04"`
	Unk05                     uint32                     `json:"unk05"`
	Unk06                     uint32                     `json:"unk06"`
	Unk07                     int32                      `json:"unk07"`
	RagdollName               stingray.ThinHash          `json:"-"`
	ResolvedRagdollName       string                     `json:"ragdoll_name,omitempty"`
	UnkInts                   []uint32                   `json:"unkInts,omitempty"`
	UnkIntFloatMap            []IntFloatPair             `json:"unkIntFloatPairs,omitempty"`
}

type StateMachine

type StateMachine struct {
	Unk00                        uint32                      `json:"unk00"`
	Layers                       []Layer                     `json:"layers,omitempty"`
	AnimationEventHashes         []stingray.ThinHash         `json:"-"`
	ResolvedAnimationEventHashes []string                    `json:"animation_events,omitempty"`
	AnimationVariableNames       []stingray.ThinHash         `json:"-"`
	AnimationVariableValues      []float32                   `json:"-"`
	ResolvedAnimationVariables   []ResolvedAnimationVariable `json:"animation_variables,omitempty"`
	BlendMaskList                [][]float32                 `json:"blend_masks,omitempty"`
	UnkData00                    []uint8                     `json:"unkData00,omitempty"`
	UnkData01                    []uint8                     `json:"unkData01,omitempty"`
	UnkData02                    []uint8                     `json:"unkData02,omitempty"`
}

func LoadStateMachine

func LoadStateMachine(r io.ReadSeeker) (*StateMachine, error)

type StateType added in v0.7.13

type StateType uint32

See https://help.autodesk.com/view/Stingray/ENU/?guid=__stingray_help_animation_animation_controllers_anim_ctrlr_states_html

const (
	StateType_Clip StateType = iota
	StateType_Empty
	StateType_Blend
	StateType_Time
	StateType_Unknown
	StateType_Ragdoll
)

func (StateType) MarshalText added in v0.7.13

func (s StateType) MarshalText() ([]byte, error)

func (StateType) String added in v0.7.13

func (i StateType) String() string

type Vectors

type Vectors struct {
	Unk00 uint32          `json:"-"`
	Count uint32          `json:"-"`
	Items []IndexedVector `json:"items,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL