Navigation
API > API/Plugins > API/Plugins/RigVM
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.
| Name | URigVM |
| Type | class |
| Header File | /Engine/Plugins/Runtime/RigVM/Source/RigVM/Public/RigVMCore/RigVM.h |
| Include Path | #include "RigVMCore/RigVM.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType)
class URigVM : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → URigVM
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
URigVM() |
RigVMCore/RigVM.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~URigVM() |
RigVMCore/RigVM.h |
Structs
| Name | Remarks |
|---|---|
| FEntryExecuteGuard | |
| FInstructionBracketGuard |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ByteCodePtr | FRigVMByteCode * | RigVMCore/RigVM.h | ||
| ByteCodeStorage | FRigVMByteCode | The byte code of the VM. | RigVMCore/RigVM.h | |
| DefaultWorkMemoryStorage | FRigVMMemoryStorageStruct | RigVMCore/RigVM.h | ||
| ExternalPropertyPathDescriptions | TArray< FRigVMPropertyPathDescription > | RigVMCore/RigVM.h | ||
| ExternalPropertyPaths | TArray< FRigVMPropertyPath > | RigVMCore/RigVM.h | ||
| LiteralMemoryStorage | FRigVMMemoryStorageStruct | RigVMCore/RigVM.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsSerializing | bool | RigVMCore/RigVM.h | ||
| CachedNativizedVMHash | TOptional< uint32 > | RigVMCore/RigVM.h | ||
| CachedVMHash | uint32 | RigVMCore/RigVM.h | ||
| EntryNames | TArray< FName > | RigVMCore/RigVM.h | ||
| ExternalVariables | TArray< FRigVMExternalVariableDef > | RigVMCore/RigVM.h | ||
| FactoriesPtr | TArray< const FRigVMDispatchFactory * > * | RigVMCore/RigVM.h | ||
| FactoriesStorage | TArray< const FRigVMDispatchFactory * > | RigVMCore/RigVM.h | ||
| FirstHandleForInstruction | TArray< uint32 > | RigVMCore/RigVM.h | ||
| FunctionNamesPtr | TArray< FName > * | RigVMCore/RigVM.h | ||
| FunctionNamesStorage | TArray< FName > | RigVMCore/RigVM.h | ||
| FunctionsPtr | TArray< const FRigVMFunction * > * | RigVMCore/RigVM.h | ||
| FunctionsStorage | TArray< const FRigVMFunction * > | RigVMCore/RigVM.h | ||
| Instructions | FRigVMInstructionArray | RigVMCore/RigVM.h |
|
|
| LazyBranches | TArray< FRigVMLazyBranch > | RigVMCore/RigVM.h | ||
| MemoryHandleCount | int32 | RigVMCore/RigVM.h | ||
| Parameters | TArray< FRigVMParameter > | RigVMCore/RigVM.h | ||
| ParametersNameMap | TMap< FName, int32 > | RigVMCore/RigVM.h | ||
| PreCachedMemoryHandles | TArray< FRigVMMemoryHandle > | RigVMCore/RigVM.h | ||
| PreCachedMemoryHandlesMemoryType | TArray< ERigVMMemoryType > | RigVMCore/RigVM.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FRigVMOperand AddExternalVariable
(
FRigVMExtendedExecuteContext& Context, |
Adds a new external / unowned variable to the VM. | RigVMCore/RigVM.h | |
FRigVMParameter AddParameter
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h | ||
bool CanExecuteEntry
(
const FRigVMExtendedExecuteContext& Context, |
Returns false if an entry can not be executed | RigVMCore/RigVM.h | |
void ClearExternalVariables
(
FRigVMExtendedExecuteContext& Context |
Clears the external variables of the VM. | RigVMCore/RigVM.h | |
void CopyDataForSerialization
(
URigVM* InVM |
RigVMCore/RigVM.h | ||
void CopyExternalVariableDefs
(
URigVM* InVM |
RigVMCore/RigVM.h | ||
FRigVMMemoryStorageStruct * CreateDebugMemory
(
FRigVMExtendedExecuteContext& Context |
Creates the debug memory for a single instance of this VM | RigVMCore/RigVM.h | |
bool CreateLocalizedRegistryIfRequired
(
bool bForce |
Creates a localized registry for this VM. | RigVMCore/RigVM.h | |
bool CreateLocalizedRegistryIfRequired_NoLock
(
bool bForce |
RigVMCore/RigVM.h | ||
FString DumpByteCodeAsText
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h | ||
| Returns the instructions as text, OperandFormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SRigVMExecutionStackView::PopulateStackView | RigVMCore/RigVM.h | ||
ERigVMExecuteResult ExecuteBranch
(
FRigVMExtendedExecuteContext& Context, |
Executes a single branch on the VM. We assume that the memory is already set correctly at this point. | RigVMCore/RigVM.h | |
| RigVMCore/RigVM.h | |||
uint64 GetCallableCycles
(
const FRigVMExtendedExecuteContext& Context, |
Returns accumulated cycles spent in a callable during the last run This requires bEnabledProfiling to be turned on in the runtime settings. | RigVMCore/RigVM.h | |
double GetCallableMicroSeconds
(
const FRigVMExtendedExecuteContext& Context, |
Returns accumulated duration of the callable in microseconds during the last run Note: this requires bEnabledProfiling to be turned on in the runtime settings. | RigVMCore/RigVM.h | |
int32 GetCallableVisitedCount
(
const FRigVMExtendedExecuteContext& Context, |
Returns the number of times a callable has been hit. | RigVMCore/RigVM.h | |
FRigVMMemoryStorageStruct * GetDebugMemory
(
FRigVMExtendedExecuteContext& Context |
The instance debug watch memory. | RigVMCore/RigVM.h | |
const FRigVMMemoryStorageStruct * GetDebugMemory
(
const FRigVMExtendedExecuteContext& Context |
RigVMCore/RigVM.h | ||
| RigVMCore/RigVM.h | |||
const FRigVMMemoryStorageStruct & GetDefaultLiteralMemory () |
The default non mutable reference literal memory (generated by the compiler and copied to the instances as initial state) | RigVMCore/RigVM.h | |
| RigVMCore/RigVM.h | |||
const FRigVMMemoryStorageStruct & GetDefaultWorkMemory () |
The default non mutable reference work memory (generated by the compiler and copied to the instances as initial state) | RigVMCore/RigVM.h | |
FRigVMExternalVariable GetExternalVariableByName
(
const FRigVMExtendedExecuteContext& Context, |
Returns an external variable given it's name. | RigVMCore/RigVM.h | |
FRigVMExternalVariableDef GetExternalVariableDefByName
(
const FName& InExternalVariableName |
Returns an external variable Def given it's name. | RigVMCore/RigVM.h | |
const TArray< FRigVMExternalVariableDef > & GetExternalVariableDefs() |
Returns the external variables of the VM (without variable memory, as it is stored in Context) | RigVMCore/RigVM.h | |
const TArray< FRigVMExternalVariable > GetExternalVariables
(
const FRigVMExtendedExecuteContext& Context |
Returns the external variables of the VM with variable memory. | RigVMCore/RigVM.h | |
TArray< const FRigVMDispatchFactory * > & GetFactories () |
RigVMCore/RigVM.h | ||
TArray< FName > & GetFunctionNames () |
RigVMCore/RigVM.h | ||
TArray< const FRigVMFunction * > & GetFunctions () |
RigVMCore/RigVM.h | ||
uint64 GetInstructionCycles
(
const FRigVMExtendedExecuteContext& Context, |
Returns accumulated cycles spent in an instruction during the last run This requires bEnabledProfiling to be turned on in the runtime settings. | RigVMCore/RigVM.h | |
double GetInstructionMicroSeconds
(
const FRigVMExtendedExecuteContext& Context, |
Returns accumulated duration of the instruction in microseconds during the last run Note: this requires bEnabledProfiling to be turned on in the runtime settings. | RigVMCore/RigVM.h | |
int32 GetInstructionVisitedCount
(
const FRigVMExtendedExecuteContext& Context, |
Returns the number of times an instruction has been hit. | RigVMCore/RigVM.h | |
const TArray< int32 > GetInstructionVisitOrder
(
const FRigVMExtendedExecuteContext& Context |
Returns the order of all instructions during the last run. | RigVMCore/RigVM.h | |
const FRigVMMemoryStorageStruct * GetLiteralMemory () |
RigVMCore/RigVM.h | ||
| The default const literal memory. | RigVMCore/RigVM.h | ||
FRigVMRegistry_NoLock * GetLocalizedRegistry() |
Returns the localized registry this VM uses or nullptr. | RigVMCore/RigVM.h | |
UClass * GetNativizedClass
(
uint32 InHash |
Returns the VM's matching nativized class if it exists | RigVMCore/RigVM.h | |
FString GetOperandLabel
(
FRigVMExtendedExecuteContext& Context, |
FormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SRigVMExecutionStackView::PopulateStackView. | RigVMCore/RigVM.h | |
int32 GetParameterArraySize
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the array size of the parameter. | RigVMCore/RigVM.h | |
int32 GetParameterArraySize
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the array size of the parameter. | RigVMCore/RigVM.h | |
int32 GetParameterArraySize
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the array size of the parameter. | RigVMCore/RigVM.h | |
FRigVMParameter GetParameterByName
(
const FName& InParameterName |
Returns a parameter given it's name. | RigVMCore/RigVM.h | |
const TArray< FRigVMParameter > & GetParameters() |
Returns the parameters of the VM. | RigVMCore/RigVM.h | |
T GetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the value of a parameter given its name. | RigVMCore/RigVM.h | |
T GetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the value of a parameter given its index. | RigVMCore/RigVM.h | |
T GetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the value of a parameter. | RigVMCore/RigVM.h | |
bool GetParameterValueBool
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
double GetParameterValueDouble
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
float GetParameterValueFloat
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
int32 GetParameterValueInt
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
| RigVMCore/RigVM.h |
|
||
FQuat GetParameterValueQuat
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
| RigVMCore/RigVM.h |
|
||
FTransform GetParameterValueTransform
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
FVector GetParameterValueVector
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
FVector2D GetParameterValueVector2D
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
| RigVMCore/RigVM.h | |||
FRigVMStatistics GetStatistics() |
Returns the statistics information | RigVMCore/RigVM.h |
|
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMExtendedExecuteContext& InContext, |
Returns the traits for this VM's bytecode and Context | RigVMCore/RigVM.h | |
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMExtendedExecuteContext& InContext, |
Returns the traits of a given type for this VM's bytecode and Context, as well as any additional memory handles | RigVMCore/RigVM.h | |
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMExtendedExecuteContext& InContext, |
Returns the traits for this VM's bytecode and Context, as well as any additional memory handles | RigVMCore/RigVM.h | |
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMExtendedExecuteContext& InContext |
Returns the traits of a given type for this VM's bytecode and Context | RigVMCore/RigVM.h | |
TArray< FRigVMTraitScope > GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits of a given type for the provided memory for a single instruction | RigVMCore/RigVM.h | |
TArray< FRigVMTraitScope > GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits for the provided memory for a single instruction | RigVMCore/RigVM.h | |
TArray< const UObject * > GetUserDefinedDependencies
(
const TArray< const FRigVMMemoryStorageStruct* > InMemory |
RigVMCore/RigVM.h | ||
const FRigVMMemoryStorageStruct * GetWorkMemory
(
const FRigVMExtendedExecuteContext& Context |
RigVMCore/RigVM.h | ||
FRigVMMemoryStorageStruct * GetWorkMemory
(
FRigVMExtendedExecuteContext& Context |
The instance mutable work memory the VM will use to execute. | RigVMCore/RigVM.h | |
void InvalidateCachedMemory
(
FRigVMExtendedExecuteContext& Context |
RigVMCore/RigVM.h | ||
bool IsContextValidForExecution
(
FRigVMExtendedExecuteContext& Context |
RigVMCore/RigVM.h | ||
void RefreshArgumentNameCaches() |
RigVMCore/RigVM.h | ||
bool ResumeExecution
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h | ||
void SetExternalVariableDefs
(
const TArray< FRigVMExternalVariable >& InExternalVariables |
Sets the external variables without the instance data. | RigVMCore/RigVM.h | |
void SetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Set the value of a parameter given its index. | RigVMCore/RigVM.h | |
void SetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Set the value of a parameter. | RigVMCore/RigVM.h | |
void SetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Set the value of a parameter given its name. | RigVMCore/RigVM.h | |
void SetParameterValueBool
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
void SetParameterValueDouble
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
void SetParameterValueFloat
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
void SetParameterValueInt
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
| RigVMCore/RigVM.h |
|
||
void SetParameterValueQuat
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
| RigVMCore/RigVM.h |
|
||
void SetParameterValueTransform
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
void SetParameterValueVector
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
void SetParameterValueVector2D
(
const FName& InParameterName, |
RigVMCore/RigVM.h |
|
|
void SetPropertyValueFromString
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h | ||
bool ValidateBytecode() |
RigVMCore/RigVM.h | ||
bool WasInstructionVisitedDuringLastRun
(
const FRigVMExtendedExecuteContext& Context, |
Returns true if the given instruction has been visited during the last run. | RigVMCore/RigVM.h |
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual int32 AddRigVMFunction
(
const FName& InFunctionFName |
RigVMCore/RigVM.h | ||
virtual int32 AddRigVMFunction
(
const FString& InFunctionName |
RigVMCore/RigVM.h | ||
virtual int32 AddRigVMFunction
(
UScriptStruct* InRigVMStruct, |
Add a function for execute instructions to this VM. | RigVMCore/RigVM.h | |
virtual void ClearMemory
(
FRigVMExtendedExecuteContext& Context |
RigVMCore/RigVM.h | ||
virtual uint32 ComputeVMHash
(
const TArray< FRigVMExternalVariableDef >& InExternalVariables |
RigVMCore/RigVM.h | ||
virtual uint32 ComputeVMHash
(
const TArray< FRigVMExternalVariable >& InExternalVariables |
RigVMCore/RigVM.h | ||
virtual uint32 ComputeVMHash () |
Generates a unique hash to compare VMs. | RigVMCore/RigVM.h | |
virtual bool ContainsEntry
(
const FName& InEntryName |
Returns true if this VM's bytecode contains a given entry. | RigVMCore/RigVM.h | |
virtual void Empty
(
FRigVMExtendedExecuteContext& Context |
Resets the container and removes all memory | RigVMCore/RigVM.h | |
virtual bool Execute
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h |
|
|
virtual ERigVMExecuteResult ExecuteVM
(
FRigVMExtendedExecuteContext& Context, |
Executes the VM. You can optionally provide optional additional operands. | RigVMCore/RigVM.h | |
virtual int32 FindEntry
(
const FName& InEntryName |
Returns the index of an entry. | RigVMCore/RigVM.h | |
virtual void GenerateDefaultMemoryType
(
ERigVMMemoryType InMemoryType, |
Used by the compiler and EngineTests to generate the default VM memory storages. | RigVMCore/RigVM.h | |
virtual void GenerateMemoryType
(
FRigVMExtendedExecuteContext& Context, |
Generates the Default memory and copy it to the Context if required by the type of memory. | RigVMCore/RigVM.h | |
virtual const FRigVMByteCode & GetByteCode () |
RigVMCore/RigVM.h | ||
virtual FRigVMMemoryStorageStruct * GetDefaultMemoryByType
(
ERigVMMemoryType InMemoryType |
RigVMCore/RigVM.h | ||
virtual const FRigVMMemoryStorageStruct * GetDefaultMemoryByType
(
ERigVMMemoryType InMemoryType |
Returns a default memory storage by type. | RigVMCore/RigVM.h | |
| Returns a list of all valid entry names for this VM's bytecode. | RigVMCore/RigVM.h | ||
virtual const TArray< const FRigVMDispatchFactory * > & GetFactories () |
RigVMCore/RigVM.h | ||
virtual const TArray< FName > & GetFunctionNames () |
RigVMCore/RigVM.h | ||
virtual const TArray< const FRigVMFunction * > & GetFunctions () |
RigVMCore/RigVM.h | ||
virtual const FRigVMInstructionArray & GetInstructions() |
Returns the instructions of the VM. | RigVMCore/RigVM.h | |
virtual const FRigVMMemoryStorageStruct * GetMemoryByType
(
const FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h | ||
virtual FRigVMMemoryStorageStruct * GetMemoryByType
(
FRigVMExtendedExecuteContext& Context, |
Returns a memory storage by type. | RigVMCore/RigVM.h | |
virtual FString GetRigVMFunctionName
(
int32 InFunctionIndex |
Returns the name of a function given its index. | RigVMCore/RigVM.h | |
virtual uint32 GetVMHash() |
Returns the cached VM hash | RigVMCore/RigVM.h | |
virtual bool Initialize
(
FRigVMExtendedExecuteContext& Context |
Prepares caches and memory for execution. | RigVMCore/RigVM.h | |
virtual bool InitializeInstance
(
FRigVMExtendedExecuteContext& Context, |
Initializes cached memory handles and optionally copies work memory from the CDO to the Context. | RigVMCore/RigVM.h | |
virtual bool IsNativized() |
Returns true if this is a nativized VM | RigVMCore/RigVM.h | |
virtual void Load
(
FArchive& Ar |
RigVMCore/RigVM.h | ||
virtual void Reset
(
FRigVMExtendedExecuteContext& Context |
Resets the container and maintains all memory | RigVMCore/RigVM.h | |
virtual void Save
(
FArchive& Ar |
RigVMCore/RigVM.h | ||
virtual void SetExternalVariablesInstanceData
(
FRigVMExtendedExecuteContext& Context, |
Sets the external variables instance data required for execution. | RigVMCore/RigVM.h | |
virtual void SetVMHash
(
uint32 InVMHash |
Stores the current VM hash. | RigVMCore/RigVM.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostLoad() |
RigVMCore/RigVM.h | ||
virtual void Serialize
(
FArchive& Ar |
RigVMCore/RigVM.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearMemory_Internal() |
RigVMCore/RigVM.h | ||
const URigVMHost * GetHostCDO() |
RigVMCore/RigVM.h | ||
FString GetLocalizedRegistryAsString() |
RigVMCore/RigVM.h | ||
bool IncrementInstructionIndex
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h | ||
void InvalidateCachedMemory_Internal() |
RigVMCore/RigVM.h | ||
void Reset_Internal() |
RigVMCore/RigVM.h | ||
void SetLocalizedRegistryFromString
(
const FString& InData |
RigVMCore/RigVM.h | ||
void SetupInstructionTracking
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h | ||
void StartProfiling
(
FRigVMExtendedExecuteContext& Context |
RigVMCore/RigVM.h | ||
void StopProfiling
(
FRigVMExtendedExecuteContext& Context |
RigVMCore/RigVM.h |
Protected Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool SetInstructionIndex
(
FRigVMExtendedExecuteContext& Context, |
RigVMCore/RigVM.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void DeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses, |
RigVMCore/RigVM.h | ||
static FRigVMMemoryHandle GeneratePatchedHandle
(
const TArray< FRigVMExternalVariableRuntimeData >& ExternalVariablesRuntimeData, |
RigVMCore/RigVM.h | ||
static void GeneratePatchedHandles
(
const TArrayView< FRigVMMemoryHandle >& OutHandles, |
RigVMCore/RigVM.h | ||
static int32 GetContainerIndex
(
ERigVMMemoryType InType |
This function should be kept in sync with FRigVMOperand::GetContainerIndex() | RigVMCore/RigVM.h | |
static bool IsSerializingToDisk
(
const FArchive& Ar |
RigVMCore/RigVM.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DebugMemoryStorageObject_DEPRECATED | TObjectPtr< URigVMMemoryStorage > | Deprecated 5.4,. | RigVMCore/RigVM.h |
|
| DefaultDebugMemoryStorage_DEPRECATED | FRigVMMemoryStorageStruct | RigVMCore/RigVM.h | ||
| LiteralMemoryStorageObject_DEPRECATED | TObjectPtr< URigVMMemoryStorage > | Deprecated 5.4. | RigVMCore/RigVM.h |
|
| NumExecutions_DEPRECATED | uint32 | RigVMCore/RigVM.h |
|
|
| WorkMemoryStorageObject_DEPRECATED | TObjectPtr< URigVMMemoryStorage > | Deprecated 5.4. | RigVMCore/RigVM.h |
|