URigVM

The RigVM is the main object for evaluating [FRigVMByteCode](API\Runtime\RigVM\RigVMCore\FRigVMByteCode) instructions.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

RigVM

Header

/Engine/Source/Runtime/RigVM/Public/RigVMCore/RigVM.h

Include

#include "RigVMCore/RigVM.h"

Syntax

class URigVM : public UObject

Remarks

The RigVM is the main object for evaluating FRigVMByteCode instructions. It combines the byte code, a list of required function pointers for execute instructions and required memory in one class.

Variables

Constructors

Name Description

Public function

URigVM()

Destructors

Name Description

Public function Virtual

~URigVM()

Functions

Name Description

Public function

FRigVMOperan...

 

AddExternalVariable

(
    const FRigVMExternalVariable& InEx...
)

Adds a new external / unowned variable to the VM.

Public function

FRigVMParame...

 

AddParameter

(
    ERigVMParameterType InType,
    const FName& InParameterName,
    const FName& InWorkMemoryPropertyN...
)

Public function

int32

 

AddRigVMFunction

(
    UScriptStruct* InRigVMStruct,
    const FName& InMethodName
)

Add a function for execute instructions to this VM.

Public function

void

 

ClearExternalVariables()

Returns the external variables of the VM.

Public function

void

 

ClearMemory()

Removes all memory from this VM.

Public function Const

bool

 

ContainsEntry

(
    const FName& InEntryName
)

Returns true if this VM's bytecode contains a given entry.

Public function

void

 

CopyFrom

(
    URigVM* InVM,
    bool bDeferCopy,
    bool bReferenceLiteralMemory,
    bool bReferenceByteCode,
    bool bCopyExternalVariables,
    bool bCopyDynamicRegisters
)

Resets the container and clones the input VM

Public function

FString

 

DumpByteCodeAsText

(
    const TArray< int32 >& InInstructi...,
    bool bIncludeLineNumbers
)

Returns the instructions as text, OperandFormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SControlRigStackView::PopulateStackView

Public function

TArray< FStr...

 

DumpByteCodeAsTextArray

(
    const TArray< int32 >& InInstructi...,
    bool bIncludeLineNumbers,
    TFunction< FString&R...
)

Returns the instructions as text, OperandFormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SControlRigStackView::PopulateStackView

Public function

void

 

Empty()

Resets the container and removes all memory

Public function

bool

 

Execute

(
    TArrayView< URigVMMemoryStorage...,
    TArrayView< void* > Additional...,
    const FName& InEntryName
)

Executes the VM.

Public function

bool

 

Execute

(
    const FName& InEntryName
)

Executes the VM.

Public function

FExecutionHa...

 

ExecutionHalted()

Public function

FExecutionRe...

 

ExecutionReachedExit()

Public function

FRigVMByteCo...

 

GetByteCode()

Public function Const

const FRigVM...

 

GetByteCode()

Public function Const

const FRigVM...

 

GetContext()

Public function

URigVMMemory...

 

GetDebugMemory

(
    bool bCreateIfNeeded
)

The default debug watch memory.

Public function Const

TArray< FNam...

 

GetEntryNames()

Returns a list of all valid entry names for this VM's bytecode.

Public function

FRigVMExtern...

 

GetExternalVariableByName

(
    const FName& InExternalVariableNam...
)

Returns an external variable given it's name.

Public function Const

const TArray...

 

GetExternalVariables()

Returns the external variables of the VM.

Public function Const

TSharedPtr< ...

 

GetHaltedAtBreakpoint()

Public function Const

uint64

 

GetInstructionCycles

(
    int32 InIndex
)

Returns accumulated cycles spent in an instruction during the last run This requires bEnabledProfiling to be turned on in the runtime settings.

Public function Const

double

 

GetInstructionMicroSeconds

(
    int32 InIndex
)

Returns accumulated duration of the instruction in microseconds during the last run.

Public function

const FRigVM...

 

GetInstructions()

Returns the instructions of the VM.

Public function Const

int32

 

GetInstructionVisitedCount

(
    int32 InIndex
)

Returns the number of times an instruction has been hit.

Public function Const

const TArray...

 

GetInstructionVisitOrder()

Returns the order of all instructions during the last run.

Public function

URigVMMemory...

 

GetLiteralMemory

(
    bool bCreateIfNeeded
)

The default const literal memory.

Public function

TArray< URig...

 

GetLocalMemoryArray()

Returns all memory storages as an array

Public function

URigVMMemory...

 

GetMemoryByType

(
    ERigVMMemoryType InMemoryType,
    bool bCreateIfNeeded
)

Returns a memory storage by type.

Public function Const

uint32

 

GetNumExecutions()

Public function

FString

 

GetOperandLabel

(
    const FRigVMOperand& InOperand,
    TFunction< FString&R...
)

FormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SControlRigStackView::PopulateStackView.

Public function

int32

 

GetParameterArraySize

(
    const FRigVMParameter& InParameter
)

Retrieve the array size of the parameter.

Public function

int32

 

GetParameterArraySize

(
    int32 InParameterIndex
)

Retrieve the array size of the parameter.

Public function

int32

 

GetParameterArraySize

(
    const FName& InParameterName
)

Retrieve the array size of the parameter.

Public function

FRigVMParame...

 

GetParameterByName

(
    const FName& InParameterName
)

Returns a parameter given it's name.

Public function Const

const TArray...

 

GetParameters()

Returns the parameters of the VM.

Public function

T

 

GetParameterValue

(
    const FRigVMParameter& InParameter,
    int32 InArrayIndex,
    T DefaultValue
)

Retrieve the value of a parameter.

Public function

T

 

GetParameterValue

(
    int32 InParameterIndex,
    int32 InArrayIndex,
    T DefaultValue
)

Retrieve the value of a parameter given its index.

Public function

T

 

GetParameterValue

(
    const FName& InParameterName,
    int32 InArrayIndex,
    T DefaultValue
)

Retrieve the value of a parameter given its name.

Public function

bool

 

GetParameterValueBool

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

double

 

GetParameterValueDouble

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

float

 

GetParameterValueFloat

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

int32

 

GetParameterValueInt

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

FName

 

GetParameterValueName

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

FQuat

 

GetParameterValueQuat

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

FString

 

GetParameterValueString

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

FTransform

 

GetParameterValueTransform

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

FVector

 

GetParameterValueVector

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function

FVector2D

 

GetParameterValueVector2D

(
    const FName& InParameterName,
    int32 InArrayIndex
)

Public function Const

FString

 

GetRigVMFunctionName

(
    int32 InFunctionIndex
)

Returns the name of a function given its index.

Public function Const

FRigVMStatis...

 

GetStatistics()

Returns the statistics information

Public function

URigVMMemory...

 

GetWorkMemory

(
    bool bCreateIfNeeded
)

The default mutable work memory.

Public function

bool

 

Initialize

(
    TArrayView< URigVMMemoryStorage...,
    TArrayView< void* > Additional...
)

Initializes all execute ops and their memory.

Public function

void

 

InvalidateCachedMemory()

Public function

void

 

Load

(
    FArchive& Ar
)

Public function

void

 

Reset()

Resets the container and maintains all memory

Public function

bool

 

ResumeExecution

(
    TArrayView< URigVMMemoryStorage...,
    TArrayView< void* > Additional...,
    const FName& InEntryName
)

Public function

bool

 

ResumeExecution()

Public function

void

 

Save

(
    FArchive& Ar
)

Public function

void

 

SetBreakpointAction

(
    const ERigVMBreakpointAction& Acti...
)

Public function

void

 

SetDebugInfo

(
    FRigVMDebugInfo* InDebugInfo
)

Public function

const void

 

SetFirstEntryEventInEventQueue

(
    const FName& InFirstEventName
)

Public function

void

 

SetParameterValue

(
    const FRigVMParameter& InParameter,
    const T& InNewValue,
    int32 InArrayIndex
)

Set the value of a parameter.

Public function

void

 

SetParameterValue

(
    int32 ParameterIndex,
    const T& InNewValue,
    int32 InArrayIndex
)

Set the value of a parameter given its index.

Public function

void

 

SetParameterValue

(
    const FName& InParameterName,
    const T& InNewValue,
    int32 InArrayIndex
)

Set the value of a parameter given its name.

Public function

void

 

SetParameterValueBool

(
    const FName& InParameterName,
    bool InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueDouble

(
    const FName& InParameterName,
    double InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueFloat

(
    const FName& InParameterName,
    float InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueInt

(
    const FName& InParameterName,
    int32 InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueName

(
    const FName& InParameterName,
    const FName& InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueQuat

(
    const FName& InParameterName,
    const FQuat& InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueString

(
    const FName& InParameterName,
    const FString& InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueTransform

(
    const FName& InParameterName,
    const FTransform& InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueVector

(
    const FName& InParameterName,
    const FVector& InValue,
    int32 InArrayIndex
)

Public function

void

 

SetParameterValueVector2D

(
    const FName& InParameterName,
    const FVector2D& InValue,
    int32 InArrayIndex
)

Public function

void

 

SetPropertyValueFromString

(
    const FRigVMOperand& InOperand,
    const FString& InDefaultValue
)

Public function

void

 

SetRuntimeSettings

(
    FRigVMRuntimeSettings InRuntimeSett...
)

Sets the max array size allowed by this VM

Public function Const

bool

 

WasInstructionVisitedDuringLastRun

(
    int32 InIndex
)

Returns true if the given instruction has been visited during the last run.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Classes

Name

Description

Public class

FExecutionHaltedEvent

Public class

FExecutionReachedExitEvent

Bindable event for external objects to be notified when the VM reaches an Exit Operation