Section 2. rdInstBaseActor and rdInstSubSystem

Section 2.1. rdInstBase – Setup

To configure rdInst for how you want, you can simply select the “rdInst Settings” actor in the outliner, the details panel shows the settings you can change.

From here you can enable the Auto-Instancing, Proxies, and set rdInst to use ISMCs or HISMCs.


Section 2.2. rdInstBase- Instancing

The following routines are the base instancing routines used by everything else. Calling them directly here can shave off a little bit of CPU time (probably not enough to notice unless processing large amounts).


Section 2.2.1 rdInstBase- Instancing – Adding

// [rdInst v1.00] Adds an Instance of the passed in StaticMesh to the level using the passed in Transform
int32 rdAddInstance(const AActor* instOwner,UStaticMesh* mesh,const FTransform& transform);

// [rdInst v1.50] Adds an Instance of the passed in StaticMesh to the level using the passed in Transform
int32 rdAddInstanceX(const AActor* instOwner,const FName sid,const FTransform& transform);

// [rdInst v1.50] Adds Instances of the StaticMesh from the passed Sid to the level using the passed in Transforms, instances are reused from previously removed ones if wanted.
void rdAddInstancesX(const FName sid,const TArray<FTransform>& transforms);

// [rdInst v1.00] Adds an Instance of the StaticMesh from the passed ISMC to the level using the passed in Transform, instances are reused from previously removed ones.
int32 rdAddInstanceFast(UInstancedStaticMeshComponent* instGen,const FTransform& transform);

// [rdInst v1.20] Adds Instances of the StaticMesh from the passed ISMC to the level using the passed in Transform Array, instances are reused from previously removed ones.
int32 rdAddInstancesFast(UInstancedStaticMeshComponent* instGen,const TArray<FTransform>& transforms);

// [rdInst v1.35] Adds Instances of the StaticMesh from the passed ISMC to the level using the passed in Transform Array, instances are reused from previously removed ones.
void rdAddInstancesFastWithIndexes(UInstancedStaticMeshComponent* instGen,const TArray<FTransform>& transforms,TArray<int32>& indexList);

// [rdInst v1.50] Adds Instances of the StaticMesh from the passed ISMC to the level using the passed in Transform Array, instances are reused from previously removed ones if wanted.
void rdAddInstanceArrayFastWithIndexes(UInstancedStaticMeshComponent* instGen,FrdBakedSpawnObjects& bso);

// [rdInst v1.50] Adds Instances of the StaticMesh from the passed ISMC to the level using the passed in Relative Transform Array, instances are reused from previously removed ones if wanted.
void rdAddInstanceArrayFastWithIndexesRel(const FTransform& t,UInstancedStaticMeshComponent* instGen,FrdBakedSpawnObjects& bso);

// [rdInst v1.35] Adds an Instance of the StaticMesh from the passed ISMC to the level using the passed in Transform using the raw Component calls
int32 rdAddInstanceRaw(UInstancedStaticMeshComponent* instGen,const FTransform& transform);

// [rdInst v1.35] Adds Instances of the StaticMesh from the passed ISMC to the level using the passed in Transform Array using the raw Component calls
int32 rdAddInstancesRaw(UInstancedStaticMeshComponent* instGen,const TArray<FTransform>& transforms);

// [rdInst v1.50] Adds Instances of the StaticMesh from the passed ISMC to the level using the passed in Transform Array using the raw Component calls
int32 rdAddInstancesRawWithIndexes(UInstancedStaticMeshComponent* instGen,UPARAM(ref) const TArray<FTransform>& transforms,TArray<int32>& indexList);

// [rdInst v1.00] Adds an Instance of the StaticMesh from the passed HISMC to the level using the passed in Transform, instances are reused from previously removed ones.
int32 rdAddOwnedInstance(const AActor* instOwner,UInstancedStaticMeshComponent* instGen,const FTransform& transform);

// [rdInst v1.35] Adds the array of Instances of the StaticMesh from the passed ISMC to the level using the passed in Transforms, instances are reused from previously removed ones.
int32 rdAddOwnedInstances(const AActor* instOwner,UInstancedStaticMeshComponent* instGen,const TArray<FTransform>& transforms);


Section 2.2.2 rdInstBase- Instancing – Removing

// [rdInst v1.00] Removes the ISM for the UStaticMesh and Index
void rdRemoveInstance(UStaticMesh* mesh,int32 index);

// [rdInst v1.50] Removes the ISM for the UStaticMesh and Index
void rdRemoveInstanceX(const FName sid,int32 index);

// [rdInst v1.00] Removes the Instance of the StaticMesh from the passed HISMC from the level
void rdRemoveInstanceFast(UInstancedStaticMeshComponent* instGen,int32 index);

// [rdInst v1.20] Removes the Instances of the StaticMesh from the passed HISMC from the level
void rdRemoveInstancesFast(UInstancedStaticMeshComponent* instGen,const TArray<int32>& indexes);

// [rdInst v1.35] Removes the Instance of the StaticMesh from the passed HISMC from the level
void rdRemoveInstanceRaw(UInstancedStaticMeshComponent* instGen,int32 index);

// [rdInst v1.50] Removes the Instances of the StaticMesh from the passed HISMC from the level
void rdRemoveInstancesX(const FName sid,UPARAM(ref) const TArray<int32>& indexes);

// [rdInst v1.35] Removes the Instances of the StaticMesh from the passed HISMC from the level
void rdRemoveInstancesRaw(UInstancedStaticMeshComponent* instGen,const TArray<int32>& indexes);

// [rdInst v1.35] Removes the Instance of the StaticMesh from the passed HISMC from the level
void rdRemoveOwnedInstance(const AActor* instOwner,UInstancedStaticMeshComponent* instGen,int32 index);

// [rdInst v1.35] Removes all ISMs that belong to the passed in Actor
void rdRemInstancesForOwner(const AActor* instOwner);

// [rdInst v1.00] Removes all HISMCs in this BaseActor
void rdRemAllInstances();

// [rdInst v1.00] Removes all HISMCs in this BaseActor
void rdRemAllHISMCs();


Section 2.2.3 rdInstBase- Instancing – Transforming

// [rdInst v1.00] Changes the Transform of the Instance
void rdChangeInstanceTransformsForOwner(const AActor* instOwner,const FTransform& transform,bool worldSpace,bool markDirty,bool teleport);

// [rdInst v1.00] Gets the Transform of the Specified Instance of the UStaticMesh
bool rdGetInstanceTransform(UStaticMesh* mesh,int32 index,FTransform& transform);

// [rdInst v1.50] Gets the Transform of the Specified Instance of the UStaticMesh
bool rdGetInstanceTransformX(const FName sid,int32 index,FTransform& transform);

// [rdInst v1.50] Gets the Location of the Specified Instance of the UStaticMesh from the ISMC
bool rdGetInstanceLocation(UStaticMesh* mesh,int32 index,FVector& slocation);

// [rdInst v1.50] Gets the Location of the Specified Instance of the UStaticMesh from the ISMC
bool rdGetInstanceLocationX(const FName sid,int32 index,FVector& slocation);

// [rdInst v1.36] Gets the Transform of the Specified Instance of the UStaticMesh from the ISMC
bool rdGetInstanceTransformFast(UInstancedStaticMeshComponent* ismc,int32 index,FTransform& stransform);

// [rdInst v1.50] Gets the Location of the Specified Instance of the UStaticMesh from the ISMC
bool rdGetInstanceLocationFast(UInstancedStaticMeshComponent* ismc,int32 index,FVector& slocation);

// [rdInst v1.00] Update the Transform for the specified Instance Index
void rdUpdateTransformFast(UInstancedStaticMeshComponent* ismc,int32 index,const FTransform& transform);

// [rdInst v1.00] Update the Transform for the specified Instance Index
void rdUpdateTransform(UStaticMesh* mesh,int32 index,const FTransform& transform);

// [rdInst v1.50] Update the Transform for the specified Instance Index
void rdUpdateTransformX(const FName sid,int32 index,const FTransform& transform);

// [rdInst v1.00] Update the Transforms for the specified Instance Indexes
void rdUpdateTransformsFast(UInstancedStaticMeshComponent* ismc,int32 startIndex,const TArray<FTransform>& transforms,int32 arrayoffset=0);

// [rdInst v1.00] Update the Transforms for the specified Instance Indexes
void rdUpdateTransforms(UStaticMesh* mesh,int32 startIndex,const TArray<FTransform>& transforms);

// [rdInst v1.50] Update the Transforms for the specified Instance Indices
void rdUpdateTransformsX(const FName sid,int32 startIndex,UPARAM(ref) const TArray<FTransform>& transforms);

// [rdInst v1.35] Increment the Transforms for the specified Instance Indexes
void rdIncrementTransforms(UStaticMesh* mesh,const TArray<int32>& indexes,const FTransform& transform);

// [rdInst v1.50] Increment the Transforms for the specified Instance Indices
void rdIncrementTransformsX(const FName sid,UPARAM(ref) const TArray<int32>& indexes,const FTransform& transform);

// [rdInst v1.35] Increment the Transforms for the specified Instance Indexes
void rdIncrementTransformsFast(UInstancedStaticMeshComponent* ismc,const TArray<int32>& indexes,const FTransform& transform);

// [rdInst v1.50] Increment the All the Transforms for the specified ISMC
void rdIncrementAllTransformsFast(UInstancedStaticMeshComponent* ismc,const FTransform& transform);

// [rdInst v1.24] Gets a reference to the Per-Instance Transforms for the mesh
TArray<FMatrix>& rdGetTransformsPtr(UStaticMesh* mesh,int32& numTransforms);

// [rdInst v1.50] Gets a reference to the Per-Instance Transforms for the mesh
TArray<FMatrix>& rdGetTransformsPtrX(const FName sid,int32& numTransforms);

// [rdInst v1.24] Gets a reference to the Per-Instance Transforms for the mesh
TArray<FMatrix>& rdGetTransformsPtrFast(UInstancedStaticMeshComponent* ismc,int32& numTransforms);

// From C++ you also have the following functions:

void rdUpdateTransformTuplesX(const FName sid,TArray<TTuple<int32,FTransform>>& transforms);
void rdBatchUpdateInstancesTransforms(UInstancedStaticMeshComponent* ismc,const TArray<int32>& indices,const TArray<FTransform>& transforms,bool bWorldSpace=false,bool bMarkRenderStateDirty=false,bool bTeleport=true);
void rdQueueUpdateInstanceTransform(UInstancedStaticMeshComponent* ismc,int32 index,const FTransform& transform);
void rdQueueSpawnInstance(UInstancedStaticMeshComponent* ismc,const FTransform& transform);
void rdQueueSetInstanceVisibility(UInstancedStaticMeshComponent* ismc,int32 index,bool bVis);
void rdQueueSetInstanceVisibilityX(const FName sid,int32 index,bool bVis);


Section 2.2.4 rdInstBase- Instancing – Visibility

// [rdInst v1.35] Shows or Hides the Instance
bool rdSetInstanceVisibility(UStaticMesh* mesh,int32 index,bool vis);

// [rdInst v1.50] Shows or Hides the Instance
bool rdSetInstanceVisibilityX(const FName sid,int32 index,bool vis);

// [rdInst v1.35] Shows or Hides the Instance (with ISMC reference)
bool rdSetInstanceVisibilityFast(UInstancedStaticMeshComponent* ismc,int32 index,bool vis);

// [rdInst v1.35] Shows or Hides the Array of Instances
void rdSetInstancesVisibility(UStaticMesh* mesh,const TArray<int32>& indexes,bool vis);

// [rdInst v1.50] Shows or Hides the Array of Instances
void rdSetInstancesVisibilityX(const FName sid,UPARAM(ref) const TArray<int32>& indexes,bool vis);

// [rdInst v1.35] Shows or Hides the Array of Instances (with ISMC reference)
void rdSetInstancesVisibilityFast(UInstancedStaticMeshComponent* ismc,const TArray<int32>& indexes,bool vis);


Section 2.2.5 rdInstBase- Instancing – Per-Instance Custom Data

// [rdInst v1.24] Sets the Number of CustomData per Instance
void rdSetNumInstCustomData(UStaticMesh* mesh,int32 numData);

// [rdInst v1.50] Sets the Number of CustomData per Instance
void rdSetNumInstCustomDataX(const FName sid,int32 numData);

// [rdInst v1.40] Sets the Number of CustomData per Instance
void rdSetNumInstCustomDataFast(UInstancedStaticMeshComponent* ismc,int32 numData);

// [rdInst v1.24] Gets a READONLY reference to the Per-Instance CustomData for the mesh
UPARAM(DisplayName="CustomFloats") TArray<float>& rdGetCustomDataPtr(UStaticMesh* mesh,int32& numData);

// [rdInst v1.50] Gets a READONLY reference to the Per-Instance CustomData for the mesh
UPARAM(DisplayName="CustomFloats") TArray<float>& rdGetCustomDataPtrX(const FName sid,int32& numData);

// [rdInst v1.40] Gets a READONLY reference to the Per-Instance CustomData for the ISMC
UPARAM(DisplayName="CustomFloats") TArray<float>& rdGetCustomDataPtrFast(UInstancedStaticMeshComponent* ismc,int32& numData);

// [rdInst v1.50] Gets an RGB Linear Color (3 floats) to the Per-Instance CustomData for the mesh
FLinearColor rdGetCustomCol3Data(UStaticMesh* mesh,int32 instanceIndex,int32 dataIndex);

// [rdInst v1.50] Gets an RGB Linear Color (3 floats) to the Per-Instance CustomData for the mesh
FLinearColor rdGetCustomCol3DataX(const FName sid,int32 instanceIndex,int32 dataIndex);

// [rdInst v1.50] Gets an RGB Linear Color (3 floats) to the Per-Instance CustomData for the mesh
FLinearColor rdGetCustomCol3DataFast(UInstancedStaticMeshComponent* ismc,int32 instanceIndex,int32 dataIndex);

// [rdInst v1.50] Gets an RGBA Linear Color (4 floats) to the Per-Instance CustomData for the mesh
FLinearColor rdGetCustomCol4Data(UStaticMesh* mesh,int32 instanceIndex,int32 dataIndex);

// [rdInst v1.50] Gets an RGBA Linear Color (4 floats) to the Per-Instance CustomData for the mesh
FLinearColor rdGetCustomCol4DataX(const FName sid,int32 instanceIndex,int32 dataIndex);

// [rdInst v1.50] Gets an RGBA Linear Color (4 floats) to the Per-Instance CustomData for the mesh
FLinearColor rdGetCustomCol4DataFast(UInstancedStaticMeshComponent* ismc,int32 instanceIndex,int32 dataIndex);

// [rdInst v1.24] Sets a value to the Per-Instance CustomData for the mesh
void rdSetCustomData(UStaticMesh* mesh,int32 instanceIndex,int32 dataIndex,float value,bool batch=false);

// [rdInst v1.50] Sets a value to the Per-Instance CustomData for the mesh
void rdSetCustomDataX(const FName sid,int32 instanceIndex,int32 dataIndex,float value,bool batch=false);

// [rdInst v1.40] Sets a value to the Per-Instance CustomData for the ISMC
void rdSetCustomDataFast(UInstancedStaticMeshComponent* ismc,int32 instanceIndex,int32 dataIndex,float value,bool batch=false);

// [rdInst v1.50] Sets an RGB Linear Color (3 floats) to the Per-Instance CustomData for the mesh
void rdSetCustomCol3Data(UStaticMesh* mesh,int32 instanceIndex,int32 dataIndex,const FLinearColor& col,bool batch=false);

// [rdInst v1.50] Sets an RGB Linear Color (3 floats) to the Per-Instance CustomData for the mesh
void rdSetCustomCol3DataX(const FName sid,int32 instanceIndex,int32 dataIndex,const FLinearColor& col,bool batch=false);

// [rdInst v1.50] Sets an RGB Linear Color (3 floats) to the Per-Instance CustomData for the mesh
void rdSetCustomCol3DataFast(UInstancedStaticMeshComponent* ismc,int32 instanceIndex,int32 dataIndex,const FLinearColor& col,bool batch=false);

// [rdInst v1.50] Sets an RGBA Linear Color (4 floats) to the Per-Instance CustomData for the mesh
void rdSetCustomCol4Data(UStaticMesh* mesh,int32 instanceIndex,int32 dataIndex,const FLinearColor& col,bool batch=false);

// [rdInst v1.50] Sets an RGBA Linear Color (4 floats) to the Per-Instance CustomData for the mesh
void rdSetCustomCol4DataX(const FName sid,int32 instanceIndex,int32 dataIndex,const FLinearColor& col,bool batch=false);

// [rdInst v1.50] Sets an RGBA Linear Color (4 floats) to the Per-Instance CustomData for the mesh
void rdSetCustomCol4DataFast(UInstancedStaticMeshComponent* ismc,int32 instanceIndex,int32 dataIndex,const FLinearColor& col,bool batch=false);

// [rdInst v1.40] Sets all the values to the Per-Instance CustomData array for the mesh
void rdSetAllCustomData(UStaticMesh* mesh,UPARAM(ref) TArray<float>& data,bool update=true);

// [rdInst v1.50] Sets all the values to the Per-Instance CustomData array for the mesh
void rdSetAllCustomDataX(const FName sid,UPARAM(ref) TArray<float>& data,bool update=true);

// [rdInst v1.40] Sets all the values to the Per-Instance CustomData array for the ISMC
void rdSetAllCustomDataFast(UInstancedStaticMeshComponent* ismc,UPARAM(ref) TArray<float>& data,bool update=true);

// [rdInst v1.24] Updates the Per-Instance CustomData for the mesh
void rdUpdateCustomData(UStaticMesh* mesh);

// [rdInst v1.50] Updates the Per-Instance CustomData for the mesh
void rdUpdateCustomDataX(const FName sid);

// [rdInst v1.40] Updates the Per-Instance CustomData for the ISMC
void rdUpdateCustomDataFast(UInstancedStaticMeshComponent* ismc);

// [rdInst v1.41] Fill CustomData with values created with the parameters you pass in
void rdFillCustomData(UStaticMesh* mesh,int32 offset=0,int32 stride=1,float baseValue=0.0f,float randomVariance=0.0f,int32 granularity=1,float inc=0.0f,float incRandomVariance=0.0f);

// [rdInst v1.50] Fill CustomData with values created with the parameters you pass in
void rdFillCustomDataX(const FName sid,int32 offset=0,int32 stride=1,float baseValue=0.0f,float randomVariance=0.0f,int32 granularity=1,float inc=0.0f,float incRandomVariance=0.0f);

// [rdInst v1.41] Fill CustomData with values created with the parameters you pass in
void rdFillCustomDataFast(UInstancedStaticMeshComponent* ismc,int32 offset=0,int32 stride=1,float baseValue=0.0f,float randomVariance=0.0f,int32 granularity=1,float inc=0.0f,float incRandomVariance=0.0f);

// [rdInst v1.42] Set CustomData value within the specified area and ISMCs
int32 rdFillCustomDataInArea(const TArray<UInstancedStaticMeshComponent*> ismcs,const FVector& loc,float radius,const FVector& box,int32 index,float value);

// [rdInst v1.42] Set CustomData values within the specified area and ISMCs
int32 rdFillCustomDataInAreaMulti(const TArray<UInstancedStaticMeshComponent*> ismcs,const FVector& loc,float radius,const FVector& box,int32 index,TArray<float> values);

Section 2.2.6 rdInstBase- Instancing – Utilities

// [rdInst v1.50] Returns True if the mesh is Nanite
bool rdIsMeshNanite(const UStaticMesh* mesh);

// [rdInst v1.24] Finds and returns the UInstancedStaticMeshComponent assigned to the StaticMesh
UInstancedStaticMeshComponent* rdGetInstanceGen(UStaticMesh* mesh,bool create=true);

// [rdInst v1.00] Finds and returns the UHierarchicalInstancedStaticMeshComponent assigned to the StaticMesh
UHierarchicalInstancedStaticMeshComponent* rdGetHInstanceGen(UStaticMesh* mesh,bool create=true);

// [rdInst v1.50] Finds and returns the UInstancedStaticMeshComponent assigned to the StaticMesh
UInstancedStaticMeshComponent* rdGetInstanceGenX(const FName sid,bool create=true);

// [rdInst v1.50] Finds and returns the UHierarchicalInstancedStaticMeshComponent assigned to the StaticMesh
UHierarchicalInstancedStaticMeshComponent* rdGetHInstanceGenX(const FName sid,bool create=true);

// [rdInst v1.50] Finds and returns the UInstancedStaticMeshComponent assigned to the StaticMesh
UInstancedStaticMeshComponent* rdGetPreferredInstanceGenX(const FName sid,bool create=true);

// [rdInst v1.00] Returns the rdActor that owns the Instance or a nullptr if the passed in component is not an HISMC or index not valid
ArdActor* rdGetrdActorFromInstanceIndex(UPrimitiveComponent* comp,int32 index);

// [rdInst v1.35] Returns the rdActor that owns the Instance or a nullptr if the passed in component is not an HISMC or index not valid
void rdGetrdActorFromInstanceIndexForPrefab(UPrimitiveComponent* comp,int32 index,AActor*& actor);

// [rdInst v1.00] Returns the last index created of the passed in StaticMesh. If none exist, -1 is returned (note: C++ only)
int32 rdGetLastInstanceIndex(const AActor* instOwner,UStaticMesh* mesh);

// [rdInst v1.00] Goes through and Counts all Instances of all StaticMeshes in this BaseActor
void rdCalcInstanceCounts();

// [rdInst v1.00] Recreates all the ISMs and HISMCs in this BaseActor
void rdRecreateInstances();

// [rdInst v1.00] Sets the Instance Settings (eg shadows) contained in the StaticMesh in the HISMC (note: C++ only)
void SetHISMCdata(UStaticMesh* mesh,UInstancedStaticMeshComponent* hismc);

// [rdInst v1.50] Sets the Instance Settings (eg shadows) contained in the StaticMesh in the HISMC
void SetHISMCdataX(const FName sid,UInstancedStaticMeshComponent* hismc);

// [rdInst v1.36] Finds the ISMC for the StaticMesh in the external volume e.g. PCG volume (note: C++ only)
UInstancedStaticMeshComponent* FindISMCforMeshInVolume(AActor* volume,const UStaticMesh* mesh);

// [rdInst v1.50] Finds the ISMC for the StaticMesh in the external volume e.g. PCG volume
UInstancedStaticMeshComponent* FindISMCforMeshInVolumeX(AActor* volume,const FName sid);

// [rdInst v1.24] Finds the Attached ISMC for the StaticMesh (referenced by Name) (note: C++ only)
UInstancedStaticMeshComponent* FindISMCforMesh(const FName& name);

// [rdInst v1.00] Finds the Attached HISMC for the StaticMesh (referenced by Name) (note: C++ only)
UHierarchicalInstancedStaticMeshComponent* FindHISMCforMesh(const FName& name);

// [rdInst v1.50] Returns an Array of all ISMCs used
TArray<UInstancedStaticMeshComponent*> GetUsedISMCs();

// [rdInst v1.41] Converts Actors in the level to ISMs and Hides the Actors
void rdConvertAutoISMs();

// [rdInst v1.41] Reverts Actors in the level from ISMs and Shows the Actors
void rdRevertFromAutoISMs();

// [rdInst v1.42] Returns an Array of all ISMCs used
TArray<UInstancedStaticMeshComponent*> GetUsedISMCs();

// [rdInst v1.43] Fills the array with rdActors that currently have selected instances
int32 GetActorsWithSelectedISMS(TArray<ArdActor*>& actors,bool& beingEdited,bool filterOutSelected=false);

// [rdInst v1.50] Returns the total number of instances in all meshes stored in the recycle cache
int32 rdGetTotalNumberOfInstancesInRecycleCache();

// [rdInst v1.50] Returns the number of instances stored in the recycle cache for the specified mesh
int32 rdGetNumberOfInstancesInRecycleCache(UStaticMesh* mesh);

// [rdInst v1.50] Returns the number of instances stored in the recycle cache for the specified mesh
int32 rdGetNumberOfInstancesInRecycleCacheX(const FName sid);

// [rdInst v1.40] Does a SphereTrace, returning found actors and instances
void rdSphereTrace(const FVector location,float radius,TArray<AActor*>& actors,TArray<FrdInstanceItems>& instances,TArray<AActor*>& ignoreActors);

// [rdInst v1.40] Does a BoxTrace, returning found actors and instances
void rdBoxTrace(const FVector location,FVector halfSize,FRotator rot,TArray<AActor*>& actors,TArray<FrdInstanceItems>& instances,TArray<AActor*>& ignoreActors);

// [rdInst v1.50] Returns instance indexes at the specified location in the ISMC, -1 means nothing found
bool rdGetInstancesAtLocation(UInstancedStaticMeshComponent* ismc,const FVector location,TArray<int32>& indexes,float tolerance=0.01f);

// [rdInst v1.50] Returns the first instance index at the specified location in the ISMC, -1 means nothing found
int32 rdGetFirstInstanceAtLocation(UInstancedStaticMeshComponent* ismc,const FVector location,float tolerance=0.01f);


Section 2.2.7 rdInstBase- Sid Utilities

// [rdInst v1.50] Packs a Filename with some common tokens (eg /Game/ = %1)
static FString rdPackMaterialName(const FString& nm);

// [rdInst v1.50] UnPacks the Packed filename
static FString rdUnpackMaterialName(const FString& nm);

// [rdInst v1.43] Returns the Instance Handle ID for the specified StaticMesh
FString BuildMeshString(const UStaticMeshComponent* smc);

// [rdInst v1.43] Returns the Instance Handle ID (full detail) for the specified StaticMesh Component
FString BuildCompleteMeshString(const UStaticMeshComponent* smc);

// [rdInst v1.50] Returns the Instance Handle ID for the specified StaticMesh
FName rdGetSMsid(const TSoftObjectPtr<UStaticMesh> mesh,ErdSpawnType type=ErdSpawnType::UseDefaultSpawn,const FName groupName=NAME_None);

// [rdInst v1.50] Returns the Instance Handle ID for the specified StaticMesh, Material list and optional scale for negative checks
FName rdGetSMXsid(ErdSpawnType type,const TSoftObjectPtr<UStaticMesh> mesh,TArray<TSoftObjectPtr<UMaterialInterface>> mats,bool bReverseCulling=false,ErdCollision collision=ErdCollision::UseDefault,float startCull=-1.0f,float endCull=-1.0f,int32 id=0,const FName groupName=NAME_None);

// [rdInst v1.50] Returns the Instance Handle ID for the specified StaticMesh, Material list and optional scale for negative checks
FName rdGetInstSid(const FrdInstanceSetup& instanceSetup);

// [rdInst v1.50] Returns the Instance Handle ID for the specified StaticMesh Component, using it's materials and negative scale flags
FName rdGetSMCsid(const UStaticMeshComponent* smc,ErdSpawnType type=ErdSpawnType::UseDefaultSpawn,float overrideStartCull=-1.0f,float overrideEndCull=-1.0f,int32 overrideID=0,const FName overrideGroupName=NAME_None);

// [rdInst v1.50] Returns the StaticMesh referenced by the sid
UStaticMesh* rdGetMeshFromSid(const FName sid);

// [rdInst v1.50] Returns a SoftObjectPtr to the StaticMesh referenced by the sid
TSoftObjectPtr<UStaticMesh> rdGetSoftMeshFromSid(const FName sid);

// [rdInst v1.50] Returns the StaticMesh referenced by the sid
TArray<TSoftObjectPtr<UMaterialInterface>> rdGetMaterialsFromSid(const FName sid);

// [rdInst v1.50] Returns the Name of the StaticMesh referenced by the sid
FString rdGetMeshNameFromSid(const FName sid);

// [rdInst v1.50] Returns the type of StaticMesh Spawn (0=Instance, 1=StaticMesh Component, 2=Componentless StaticMesh)
ErdSpawnType rdGetSpawnTypeFromSid(const FName sid);

// [rdInst v1.50] Returns the Details of the StaticMesh referenced by the sid
void rdGetSidDetails(const FName sid,int32& ver,TEnumAsByte<ErdSpawnType>& type,TSoftObjectPtr<UStaticMesh>& mesh,TArray<TSoftObjectPtr<UMaterialInterface>>& materials,bool& bReverseCulling,TEnumAsByte<ErdCollision>& collision,float& startCull,float& endCull,int32& id,FName& groupName);

// [rdInst v1.50] Returns the sid for the Actor
FName rdGetActorSid(UClass* aclass,const FString& aStr,const FName groupName=NAME_None);

// [rdInst v1.50] These are the main Actor types for sid serializing, if anyone wants any other types implemented, they can be added here, or contact me
FName rdGetActorSid(ADecalActor* actor);
FName rdGetActorSid(ASpotLight* actor);
FName rdGetActorSid(ARectLight* actor);
FName rdGetActorSid(APointLight* actor);
FName rdGetActorSid(ALocalFogVolume* actor);
FName rdGetActorSid(APostProcessVolume* actor);
FName rdGetActorSid(ANiagaraActor* actor);
FName rdGetActorSid(ATextRenderActor* actor);
FName rdGetActorSid(AActor* actor);

// [rdInst v1.50] Applies the String based Properties to the Actor
void rdApplyStringProps(AActor* actor,const FString& strProps,int32 ver);

// [rdInst v1.50] Returns the Actor Class for the sid
TSoftClassPtr<UObject> rdGetActorClassFromSid(const FName sid);

// [rdInst v1.50] Returns the Actor Class for the sid
void rdGetSidActorDetails(const FName sid,int32& ver,TEnumAsByte<ErdSpawnType>& type,UClass*& uclass,FString& propStr,FName& groupName);

// [rdInst v1.50] Spawns an Actor specified in the sid
AActor* rdSpawnActorFromSid(const FName sid,const FTransform& transform,bool fromPool=false);

// [rdInst v1.50] Spawns Actors specified in the sid
int32 rdSpawnActorsFromSid(const FName sid,const TArray<FTransform>& transforms,TArray<AActor*>& outActors);

// [rdInst v1.50] Spawns Actors from Proxies from their sids
void rdSpawnActorsAndProxiesFromSid(const FName sid,TArray<FAddProxyQueueItem>& addQueue);

// [rdInst v1.50] Returns the sid for the DataLayer
FName rdGetDataLayerSid(TSoftObjectPtr<UDataLayerAsset>& dl,const FName groupName);

// [rdInst v1.50] Returns the DataLayer SoftPointer for the sid
TSoftClassPtr<UDataLayerAsset> rdGetDataLayerFromSid(const FName sid);

// [rdInst v1.50] Returns the DataLayer Details for the sid
void rdGetSidDataLayerDetails(const FName sid,int32& ver,TEnumAsByte<ErdSpawnType>& type,TSoftClassPtr<UDataLayerAsset>& dl,FName& groupName);


Section 2.3. rdInstBase- Spawning

// [rdInst v1.00] Helper Function that Spawns an actor
AActor* rdSpawnActor(TSubclassOf<class AActor> actorClass,const FTransform& transform,AActor* actTemplate=nullptr,bool temp=false,bool attach=true,const FName label=TEXT(""),AActor* parent=nullptr);

// [rdInst v1.35] Helper Function that Spawns a Niagara system
UNiagaraComponent* rdSpawnVFX(UNiagaraSystem* fx,const FTransform& transform,AActor* parent=nullptr);

// [rdInst v1.35] Helper Function that Removes a Niagara Component
void rdRemoveVFX(UNiagaraComponent* fxc);

Section 2.4. rdInstBase- Pooling

// [rdInst v1.20] Allocates "numToPool" number of the actorClass for rapid reuse
void rdPoolActor(UClass* actorClass,int32 numToPool=50,bool premake=true,bool doTick=false,bool startHidden=false,bool reuse=true,bool simplePool=false,int32 growBy=0);

// [rdInst v1.20] ReAllocates "numToPool" number of the actorClass
bool rdSetActorPoolSize(UClass* actorClass,int32 numToPool,bool premake,bool doTick=false,bool startHidden=false,bool reuse=true,bool simplePool=false,int32 growBy=0);

// [rdInst v1.20] Removes the Pool of Actors for the actorClass
void rdRemoveActorPool(UClass* actorClass);

// [rdInst v1.50] 
void rdResetPooledActor(rdPoolData& dat,rdPoolItem& item);

// [rdInst v1.20] Gets the next free actorClass in the Actor Pool, returns nullptr if none are free
AActor* rdGetActorFromPool(TSubclassOf<class AActor> actorClass,const FTransform& tran);

// [rdInst v1.20] Returns an Actor that was got from the pool to the Actor Pool
void rdReturnActorToPool(AActor* actor);

// [rdInst v1.22] Sets the rdActor to use to handle Pooled and Depooled events
void rdSetPoolListener(ArdActor* actor);

// [rdInst v1.20] Returns True if the specified Actor is in an Actor Pool
bool rdIsActorInPool(ArdActor* actor);

// [rdInst v1.50] Returns the amount of Pooled Actors for this Class
int32 rdGetActorPoolSize(TSubclassOf<class AActor> actorClass);

// [rdInst v1.50] Grows the amount of Pooled Actors for this Class by the specified amount
int32 rdGrowActorPool(TSubclassOf<class AActor> actorClass,int32 growAmount);


Section 2.5. rdInstBase- Distributed Transactions

// [rdInst v1.20] Adds the array of Instances of the StaticMesh distributed to "transactionsPerTick" each tick. Returns immediately	// Adds the array of Instances of the StaticMesh distributed to "transactionsPerTick" each tick. Returns immediately
bool rdAddDistributedInstances(UStaticMesh* mesh,const TArray<FTransform>& transforms,int32 transactionsPerTick,TArray<int32>& fillList,const FrdProxySetup& proxy);

// [rdInst v1.50] Adds the array of Instances of the StaticMesh distributed to "transactionsPerTick" each tick. Returns immediately
void rdAddDistributedInstancesX(const FName sid,UPARAM(ref) const TArray<FTransform>& transforms,int32 transactionsPerTick,TArray<int32>& fillList,const FrdProxySetup proxy=FrdProxySetup());

// [rdInst v1.20] Adds the array of Instances of the StaticMesh distributed to "transactionsPerTick" each tick. Returns immediately
bool rdAddDistributedInstancesFast(UInstancedStaticMeshComponent* ismc,const TArray<FTransform>& transforms,int32 transactionsPerTick,TArray<int32>& fillList,const FrdProxySetup& proxy);

// [rdInst v1.35] Spawns the array of Actors distributed to "transactionsPerTick" each tick. Returns immediately
bool rdSpawnDistributedActors(UClass* actorClass,AActor* actorTemplate,const TArray<FTransform>& transforms,int32 transactionsPerTick,bool pooled,TArray<AActor*>& fillList,const FrdProxySetup& proxy);

// [rdInst v1.35] Spawns the array of Niagara Systems distributed to "transactionsPerTick" each tick. Returns immediately
bool rdSpawnDistributedVFX(UNiagaraSystem* fx,const TArray<FTransform>& transforms,int32 transactionsPerTick,TArray<UNiagaraComponent*>& fillList);

Section 2.6. rdInstBase- Proxies

rdProxies are Objects that swap in when the player reaches a specific proximity.


Section 2.6.1. rdInstBase- Proxy Setup

The easiest way to set up the Proxies is via the rdInstSettings actor (select from the outliner). You can setup all defaults from there.

Or you can call the rdSetupProxies function directly if you want to turn it on or off at runtime.

// [rdInst v1.35] Sets the process interval (in ticks), distance to swap normal proxies, and distance to swap long-distance proxies
void rdSetupProxies(int32 processInterval,double swapDistance=1000.0f,double longDistanceSwapDistance=20000.0f,int32 idleTicks=10,int32 idleDestructionTicks=40);

// [rdInst v1.35] Sets the rdActor as the manager of proxy state saving (DEPRECIATED)
void rdSetProxyStateManager(ArdActor* sProxyStateManager);

// [rdInst v1.35] Adds the SpawnActor to the processing list (C++ only)
void rdRegisterSpawnActor(ArdSpawnActor* spawnActor);

// [rdInst v1.35] Removes the SpawnActor from the processing list (C++ only)
void rdUnregisterSpawnActor(ArdSpawnActor* spawnActor);

// [rdInst v1.50] Gets any ProxySetup settings contained in the meshes UserAssetData or any Actor Tags
void rdGetProxySettings(AActor* meshActor,UStaticMesh* mesh,FrdProxySetup& proxy);

The functions to add Proxies all use the rdProxySetup struct to pass their values.

USTRUCT(BlueprintType,meta=(HasNativeBreak="/Script/rdInst.rdActor.BreakProxySetup",HasNativeMake="/Script/rdInst.rdActor.MakeProxySetup"))
struct FrdProxySetup {

	UPROPERTY(Category="rdProxySetup|Proxy",EditAnywhere)
	TEnumAsByte<rdProxyType> proxyType=RDPROXYTYPE_NONE;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	FVector			centerOffset=FVector(0,0,0);

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	TSoftClassPtr<AActor> proxyActor=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|DataLayer",EditAnywhere)
	TSoftObjectPtr<UDataLayerAsset> proxyDataLayer=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere)
	TSoftObjectPtr<UStaticMesh> proxyStaticMesh=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere,meta=(IgnoreForMemberInitializationTest))
	TArray<TSoftObjectPtr<UMaterialInterface>> proxyMeshMaterials;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere)
	TEnumAsByte<ErdCollision> proxyMeshCollision=ErdCollision::UseDefault;

	UPROPERTY(Category="rdProxySetup|Destruction",EditAnywhere)
	TSoftObjectPtr<UStaticMesh> destroyedMesh=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere,meta=(IgnoreForMemberInitializationTest))
	TArray<TSoftObjectPtr<UMaterialInterface>> destroyedMeshMaterials;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere)
	TEnumAsByte<ErdCollision> destroyedMeshCollision=ErdCollision::UseDefault;

	UPROPERTY(Category="rdProxySetup|Destruction",EditAnywhere)
	TSoftClassPtr<AActor> destroyedPrefab=nullptr;

	UPROPERTY(Category="rdProxySetup|Destruction",EditAnywhere)
	FTransform	destroyedOffset=FTransform::Identity;

	// This property is now depreciated, use scanDistance instead
	UPROPERTY(Category="rdProxySetup|System",EditAnywhere,meta=(DepreciatedFunction))
	float longDistance=10000.0f;

	// The distance to scan (either Short or Long Distance). -1 means use the Default in rdInstSettings
	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	float scanDistance=-1.0f;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	float proxyPhysicsTimeout=30.0f;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bUseWithDestruction:1=0;

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	uint8 bPooled:1=0;

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	uint8 bSimplePool:1=0;

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	int32 pooledAmount=0;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bDontRemove:1=0;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bDontHide:1=0;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bEntireMeshProxy:1=1;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	UrdStateDataAsset* savedState=nullptr;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	bool bCallSwapEvent=false;

	UPROPERTY(Category="rdProxySetup|Pickup",EditAnywhere)
	FrdPickup pickup;

	FString ToString();
	bool FromString(const FString& str);
};

Four Make utility functions are included to reduce clutter in the BP graph:

// [rdInst v1.43] Make a rdProxySetup structure for an Actor Proxy
FrdProxySetup rdMakeActorProxySetup(UClass* proxyActor,bool bDontHide=false,bool bDontRemove=false,float proxyPhysicsTimeout=30.0f,bool bPooled=false,bool bSimplePool=false,int32 pooledAmount=20,UrdStateDataAsset* savedState=nullptr,bool bCallSwapEvent=false);

// [rdInst v1.43] Make a rdProxySetup structure for a DataLayer Proxy
FrdProxySetup rdMakeDataLayerProxySetup(TSoftObjectPtr<UDataLayerAsset> proxyDataLayer,bool bDontHide=false,bool bDontRemove=false,UrdStateDataAsset* savedState=nullptr,bool bCallSwapEvent=false);

// [rdInst v1.43] Make a rdProxySetup structure for a StaticMesh Proxy
FrdProxySetup rdMakeStaticMeshProxySetup(UStaticMesh* proxyMesh,TArray<TSoftObjectPtr<UMaterialInterface>> materials,bool reverseCulling=false,TEnumAsByte<ErdCollision> collision=ErdCollision::UseDefault,bool bDontHide=false,bool bDontRemove=false,UrdStateDataAsset* savedState=nullptr,bool bCallSwapEvent=false);

// [rdInst v1.43] Add Destruction settings to a rdProxySetup structure 
FrdProxySetup rdAddDestructionToProxySetup(const FrdProxySetup& inProxySetup,UStaticMesh* destroyedMesh=nullptr,UClass* destroyedPrefab=nullptr,const FTransform& destroyedOffset=FTransform());


Section 2.6.2. rdInstBase- Short Distance Proxies

// [rdInst v1.35] Adds the instance to the Proxy list, to be switched to the specified actor when in the sphere trace around the character
FrdProxyItem& rdAddInstanceProxy(UStaticMesh* mesh,int32 index,const FrdProxySetup& proxy);

// [rdInst v1.50] Adds the instance to the Proxy list, to be switched to the specified actor when in the sphere trace around the character
void rdAddInstanceProxyX(const FName sid,int32 index,const FrdProxySetup& proxy);

// [rdInst v1.50] Adds the Actor to the Proxy list, to be switched to the specified actor when in the sphere trace around the character
void rdAddActorProxy(AActor* actor,const FrdProxySetup& proxy);

// [rdInst v1.35] Adds the Blueprint Prefab to the Proxy list, to be switched to the specified actor when in the sphere trace around the character (DEPRECIATED, use rdAddActorProxy)
FrdProxyItem& rdAddPrefabProxy(ArdActor* prefab,const FrdProxySetup& proxy);

// [rdInst v1.35] Removes the Proxy Instance
void rdRemoveProxyByInstance(UStaticMesh* mesh,int32 index);

// [rdInst v1.50] Removes the Proxy Instance
void rdRemoveProxyByInstanceX(const FName sid,int32 index);

// [rdInst v1.35] Removes the Proxy from the passed in proxy actor
void rdRemoveProxyByProxy(AActor* proxy);

// [rdInst v1.50] Removes the Proxy from the passed in DataLayer
void rdRemoveProxyByDataLayer(TSoftObjectPtr<UDataLayerAsset> dla);

// [rdInst v1.50] Removes the Proxy from the passed in proxy ISM
void rdRemoveProxyByProxyISM(UStaticMesh* mesh,int32 index);

// [rdInst v1.50] Removes the Proxy from the passed in proxy ISM
void rdRemoveProxyByProxyISMX(const FName sid,int32 index);

// [rdInst v1.50] Removes the Proxy from the passed in level Actor
void rdRemoveProxyByActor(AActor* actor);

// [rdInst v1.35] Removes the Proxy Prefab (DEPRECIATED, use rdRemoveProxyByActor)
void rdRemoveProxyByPrefab(ArdActor* prefab);

// [rdInst v1.35] Removes all Instance and Prefab Proxies
void rdRemoveAllProxies();


Section 2.6.3. rdInstBase- Long-Distance Proxies

// [rdInst v1.35] Adds the Instance to the LongDistance Proxy list, to be switched to the specified actor when in proximity to the player
FrdProxyItem& rdAddLongDistanceInstanceProxy(UStaticMesh* mesh,int32 index,const FrdProxySetup& proxy);

// [rdInst v1.50] Adds the Instance to the LongDistance Proxy list, to be switched to the specified actor when in proximity to the player
void rdAddLongDistanceInstanceProxyX(const FName sid,int32 index,double distance,const FrdProxySetup& proxy);

// [rdInst v1.50] Adds the Actor to the LongDistance Proxy list, to be switched to the specified actor when in proximity to the player
void rdAddLongDistanceActorProxy(AActor* actor,double distance,const FrdProxySetup& proxy);

// [rdInst v1.35] Adds the Prefab to the LongDistance Proxy list, to be switched to the specified actor when in proximity to the player (DEPRECIATED, use rdAddLongDistanceActorProxy)
FrdProxyItem& rdAddLongDistancePrefabProxy(ArdActor* prefab,const FrdProxySetup& proxy);

// [rdInst v1.35] Removes the LongDistance Proxy Instance
void rdRemoveLongDistanceProxyByProxy(AActor* proxy);


Section 2.6.4. rdInstBase- Destruction Proxies

// [rdInst v1.35] Adds the instance to the Destruction Proxy list, to be switched to the specified actor when an impulse is near
FrdProxyItem& rdAddDestructionInstanceProxy(UStaticMesh* mesh,int32 index,const FrdProxySetup& proxy);

// [rdInst v1.50] Adds the instance to the Destruction Proxy list, to be switched to the specified actor when an impulse is near
void rdAddDestructionInstanceProxyX(const FName sid,int32 index,const FrdProxySetup& proxy);

// [rdInst v1.50] Adds the Actor to the Destruction Proxy list, to be switched to the specified actor when an impulse is near
void rdAddDestructionActorProxy(AActor* actor,const FrdProxySetup& proxy);

// [rdInst v1.35] Adds the Blueprint Prefab to the Destruction Proxy list, to be switched to the specified actor when an impulse is near (DEPRECIATED, use rdAddDestructionActorProxy)
FrdProxyItem& rdAddDestructionPrefabProxy(ArdActor* prefab,const FrdProxySetup& proxy);

// [rdInst v1.41] Marks the Proxy to be set to the Destroyed Instance/Prefab when swapped out
void rdMarkProxyAsDestroyed(AActor* proxy,const FTransform& offset=FTransform());

// [rdInst v1.36] Sets the Proxies state to Destroyed
void rdSetProxyToDestroyed(AActor* proxy,const FTransform& offset=FTransform());

// [rdInst v1.35] Removes the Proxy Instance
void rdRemoveProxyByInstance(UStaticMesh* mesh,int32 index);

// [rdInst v1.35] Removes the Proxy from the passed in proxy actor
void rdRemoveProxyByProxy(AActor* proxy);

// [rdInst v1.35] Removes the Proxy Prefab
void rdRemoveProxyByPrefab(ArdActor* prefab);

// [rdInst v1.35] Removes all Instance and Prefab Proxies
void rdRemoveAllProxies();

Section 2.6.5. rdInstBase- Pickup Proxies

// [rdInst v1.50] Adds all instances of the mesh to the Proxy list as a proxy Pickup
void rdAddPickupProxy(UStaticMesh* mesh,int32 index,FrdPickup pickup);

// [rdInst v1.50] Adds all instances of the mesh to the Proxy list as a proxy Pickup
void rdAddPickupProxyX(const FName sid,int32 id,FrdPickup pickup);

// [rdInst v1.50] Removes the Pickup Proxy scanning for the instances (leaves the instances there)
void rdRemovePickupProxies(int32 id);

// [rdInst v1.50] Spawns a Pickup Instance
int32 rdSpawnPickup(int32 id,const FTransform& transform);

// [rdInst v1.50] Picks up a Pickup Instance (removes from the level) and broadcasts its PickUp event
void rdPickupPickup(int32 id,int32 instance);

// [rdInst v1.50] Picks Up the Currently Highlighted Pickup and broadcasts its PickUp event
void rdPickupCurrent();

// [rdInst v1.50] Removes the Pickup Instance
void rdRemovePickup(int32 id,int32 instance);


Section 2.6.6. rdInstBase- Proxy Routines, Data and Structures

// [rdInst v1.35] Swaps the Mesh Instance over to its ProxyActor
AActor* rdSwapInstanceToProxyActor(UStaticMesh* mesh,int32 index,const FTransform& transform,bool forImpact=false,bool forLongDistance=false);

// [rdInst v1.50] Swaps the Mesh Instance over to its ProxyActor
void rdSwapInstanceToProxyActorX(const FName sid,int32 index,const FTransform& transform,bool forImpact=false,bool forLongDistance=false);

// [rdInst v1.50] Swaps the Mesh Instance over to its ProxyActor, also passing a HitResult (when swapping from impacts)
void rdSwapInstanceToProxyActorWithHitX(const FName sid,int32 index,const FTransform& transform,FHitResult& hitResult);

// [rdInst v1.35] Swaps the Mesh Instances List over to their ProxyActors
void rdSwapInstancesToProxyActors(TArray<FrdInstanceItems>& instances,const TArray<FTransform>& transforms,TArray<AActor*>& outActors,bool forImpact=false,bool forLongDistance=false);

// [rdInst v1.50] Swaps the Actor over to its ProxyActor
void rdSwapActorToProxyActor(AActor* actor,int32 index,bool forImpact=false,bool forLongDistance=false);

// [rdInst v1.35] Swaps the Prefab over to its ProxyActor (DEPRECIATED, use rdSwapActorToProxyActor)
AActor* rdSwapPrefabToProxyActor(ArdActor* prefab,bool forImpact=false,bool forLongDistance=false);

// [rdInst v1.35] Swaps the ProxyActor back to its Instanced Mesh
void rdSwapProxyActorToInstance(AActor* actor);

// [rdInst v1.35] Swaps the ProxyActors back to their Mesh Instances
void rdSwapProxyActorsToInstances(TArray<FrdInstanceItems>& instances);

// [rdInst v1.50] Swaps the ProxyActor back to its Actor
void rdSwapProxyActorToActor(AActor* actor);

// [rdInst v1.35] Swaps the ProxyActor back to its Prefab (DEPRECIATED, use rdSwapProxyActorToActor)
void rdSwapProxyActorToPrefab(AActor* actor);

// [rdInst v1.35] Swaps any Actors/Instances to ProxyActors around the impact point
void rdProcessImpactProxies(FVector loc);
// [rdInst v1.35] Spawn the assets from the rdSpawner struct
int32 rdSpawn(const ArdSpawnActor* spawner);

// [rdInst v1.35] C++ only wrapper
int32 rdSpawnData(const FrdSpawnData* spawnData,bool bake=false);

// [rdInst v1.50]  C++ only wrappers
void rdSpawnNewlyStreamed(const ArdSpawnActor* spawner);
void SpawnInstances(ArdSpawnActor* ssa,UInstancedStaticMeshComponent* instGen,FrdBakedSpawnObjects& bd,const FrdSpawnData* spawnData);
void SpawnActors(ArdSpawnActor* sa,FrdBakedSpawnObjects& bd,const FrdSpawnData* spawnData);
void SpawnComponentMeshes(ArdSpawnActor* sa,FrdBakedSpawnObjects& bd,const FrdSpawnData* spawnData);
void SpawnNiagaraMeshes(ArdSpawnActor* sa,FrdBakedSpawnObjects& bd,const FrdSpawnData* spawnData);
UNiagaraSystem* ReplaceNiagaraMesh(UNiagaraSystem* existingSys,UStaticMesh* mesh);
void SpawnRdMeshlets(ArdSpawnActor* sa,FrdBakedSpawnObjects& bd,const FrdSpawnData* spawnData);
void SpawnCompless(ArdSpawnActor* sa,FrdBakedSpawnObjects& bd,const FrdSpawnData* spawnData);
void rdSpawnData(ArdSpawnActor* ssa,const FrdSpawnData* spawnData,bool bake=false,bool justNewlyStreamed=false);

// [rdInst v1.35] Moves the specified Instances (whole mesh proxies only) in the specified way
void rdMassMove(const UStaticMesh* mesh,TEnumAsByte<rdMassMovementType> moveType,float maxDistance=0.0f);

// [rdInst v1.35] Returns a reference to the InstancedMeshToProxy Map
TMap<UStaticMesh*,FrdProxyItem>& rdGetInstancedMeshToProxyMap();

// [rdInst v1.35] Returns a reference to the InstancesToProxy Map
TMap<UStaticMesh*,FrdProxyInstanceItems>& rdGetInstancesToProxyMap();

// [rdInst v1.50] Returns a reference to the ActorsToProxy Map
TMap<AActor*,FrdProxyItem>& rdGetActorsToProxyMap() { return actorsToProxyMap; }

// [rdInst v1.35] Returns a reference to the PrefabsToProxy Map (DEPRECIATED, use rdGetActorsToProxyMap)
TMap<ArdActor*,FrdProxyItem>& rdGetPrefabsToProxyMap();

// [rdInst v1.35] Returns a reference to the LongDistanceInstancesToProxy Map
TMap<UStaticMesh*,FrdProxyInstanceItems>& rdGetLongDistanceInstancesToProxyMap();

// [rdInst v1.50] Returns a reference to the LongDistanceActorsToProxy Map
TMap<AActor*,FrdProxyItem>& rdGetLongDistanceActorsToProxyMap() { return longDistanceActorsToProxyMap; }

// [rdInst v1.35] Returns a reference to the LongDistancePrefabsToProxy Map (DEPRECIATED, use rdGetLongDistanceActorsToProxyMap)
TMap<ArdActor*,FrdProxyItem>& rdGetLongDistancePrefabsToProxyMap();

// [rdInst v1.35] Returns a reference to the ProxyActor Map
TMap<AActor*,FrdProxyActorItem>&  rdGetProxyActorMap();

// [rdInst v1.35] Does a SphereTrace, returning found actors and instances
void rdSphereTrace(const FVector location,float radius,TArray<AActor*>& actors,TArray<FrdInstanceItems>& instances,TArray<AActor*>& ignoreActors);

// [rdInst v1.35] Does a BoxTrace, returning found actors and instances
void rdBoxTrace(const FVector location,FVector halfSize,FRotator rot,TArray<AActor*>& actors,TArray<FrdInstanceItems>& instances,TArray<AActor*>& ignoreActors);

// [rdInst v1.50]  C++ only wrappers
void rdAutoSetupProxies(UStaticMesh* mesh=nullptr);
void rdAutoSetupProxiesX(const FName sid=FName());

FrdProxyItem* rdGetProxyItemFromInstance(const FName sid,int32 index);
FrdProxyItem* rdGetProxyItemFromActor(const AActor* prefab);
FrdProxyItem* rdGetProxyItem(FrdProxyActorItem* proxyActorItem);
void AddProxyForInstance(const FName sid,const FrdProxySetup& proxy,const int32 instIndex);
void AddProxiesForInstances(const FName sid,const FrdProxySetup& proxy,const TArray<int32>& instIndexList);
void AddProxyForActor(AActor* actor,const FrdProxySetup& proxy);

// Structures

// [rdInst v1.35-1.50] FrdProxySetup
USTRUCT(BlueprintType,meta=(HasNativeBreak="/Script/rdInst.rdActor.BreakProxySetup",HasNativeMake="/Script/rdInst.rdActor.MakeProxySetup"))
struct RDINST_PLUGIN_API FrdProxySetup {
	GENERATED_BODY()
public:
	FrdProxySetup() {}

	FrdProxySetup(const FrdProxySetup& o) : proxyType(o.proxyType),centerOffset(o.centerOffset),proxyActor(o.proxyActor),proxyDataLayer(o.proxyDataLayer),proxyStaticMesh(o.proxyStaticMesh),proxyMeshMaterials(o.proxyMeshMaterials),proxyMeshCollision(o.proxyMeshCollision),
						destroyedMesh(o.destroyedMesh),destroyedMeshMaterials(o.destroyedMeshMaterials),destroyedMeshCollision(o.destroyedMeshCollision),destroyedPrefab(o.destroyedPrefab),destroyedOffset(o.destroyedOffset),
						longDistance(o.longDistance),scanDistance(o.scanDistance),proxyPhysicsTimeout(o.proxyPhysicsTimeout),
						bUseWithDestruction(o.bUseWithDestruction),bPooled(o.bPooled),bSimplePool(o.bSimplePool),pooledAmount(o.pooledAmount),bDontRemove(o.bDontRemove),
						bDontHide(o.bDontHide),bEntireMeshProxy(o.bEntireMeshProxy),savedState(o.savedState),bCallSwapEvent(o.bCallSwapEvent),
						pickup(o.pickup) {}

	FrdProxySetup(TEnumAsByte<rdProxyType> pt,TSoftClassPtr<AActor> pa,TSoftObjectPtr<UDataLayerAsset> pdl,TSoftObjectPtr<UStaticMesh> psm,TArray<TSoftObjectPtr<UMaterialInterface>> smm,TEnumAsByte<ErdCollision> smCol,TSoftObjectPtr<UStaticMesh> dm,TArray<TSoftObjectPtr<UMaterialInterface>> dmm,TEnumAsByte<ErdCollision> dmCol,TSoftClassPtr<AActor> dp,const FTransform& dof,float sd,float pto,bool ud,bool p,bool sp,int32 pam,bool dr,bool dh,bool em,UrdStateDataAsset* ss,bool cse,FrdPickup pu) :
						proxyType(pt),centerOffset(0,0,0),proxyActor(pa),proxyDataLayer(pdl),proxyStaticMesh(psm),proxyMeshMaterials(smm),proxyMeshCollision(smCol),destroyedMesh(dm),destroyedMeshMaterials(dmm),destroyedMeshCollision(dmCol),destroyedPrefab(dp),destroyedOffset(dof),longDistance(sd),scanDistance(sd),proxyPhysicsTimeout(pto),
						bUseWithDestruction(ud),bPooled(p),bSimplePool(sp),pooledAmount(pam),bDontRemove(dr),bDontHide(dh),bEntireMeshProxy(em),savedState(ss),bCallSwapEvent(cse),
						pickup(pu) {}

	UPROPERTY(Category="rdProxySetup|Proxy",EditAnywhere)
	TEnumAsByte<rdProxyType> proxyType=RDPROXYTYPE_NONE;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	FVector			centerOffset=FVector(0,0,0);

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	TSoftClassPtr<AActor> proxyActor=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|DataLayer",EditAnywhere)
	TSoftObjectPtr<UDataLayerAsset> proxyDataLayer=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere)
	TSoftObjectPtr<UStaticMesh> proxyStaticMesh=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere,meta=(IgnoreForMemberInitializationTest))
	TArray<TSoftObjectPtr<UMaterialInterface>> proxyMeshMaterials;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere)
	TEnumAsByte<ErdCollision> proxyMeshCollision=ErdCollision::UseDefault;

	UPROPERTY(Category="rdProxySetup|Destruction",EditAnywhere)
	TSoftObjectPtr<UStaticMesh> destroyedMesh=nullptr;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere,meta=(IgnoreForMemberInitializationTest))
	TArray<TSoftObjectPtr<UMaterialInterface>> destroyedMeshMaterials;

	UPROPERTY(Category="rdProxySetup|Proxy|StaticMesh",EditAnywhere)
	TEnumAsByte<ErdCollision> destroyedMeshCollision=ErdCollision::UseDefault;

	UPROPERTY(Category="rdProxySetup|Destruction",EditAnywhere)
	TSoftClassPtr<AActor> destroyedPrefab=nullptr;

	UPROPERTY(Category="rdProxySetup|Destruction",EditAnywhere)
	FTransform	destroyedOffset=FTransform::Identity;

	// This property is now depreciated, use scanDistance instead
	UPROPERTY(Category="rdProxySetup|System",EditAnywhere,meta=(DepreciatedFunction))
	float longDistance=10000.0f;

	// The distance to scan (either Short or Long Distance). -1 means use the Default in rdInstSettings
	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	float scanDistance=-1.0f;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	float proxyPhysicsTimeout=30.0f;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bUseWithDestruction:1=0;

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	uint8 bPooled:1=0;

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	uint8 bSimplePool:1=0;

	UPROPERTY(Category="rdProxySetup|Proxy|Actor",EditAnywhere)
	int32 pooledAmount=0;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bDontRemove:1=0;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bDontHide:1=0;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	uint8 bEntireMeshProxy:1=1;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	UrdStateDataAsset* savedState=nullptr;

	UPROPERTY(Category="rdProxySetup|System",EditAnywhere)
	bool bCallSwapEvent=false;

	UPROPERTY(Category="rdProxySetup|Pickup",EditAnywhere)
	FrdPickup pickup;

	FString ToString();
	bool FromString(const FString& str);
};

// [rdInst v1.35-1.43] FrdProxyItem
USTRUCT(BlueprintType,meta=(HasNativeBreak="/Script/rdInst.rdActor.BreakProxyItem",HasNativeMake="/Script/rdInst.rdActor.MakeProxyItem"))
struct RDINST_PLUGIN_API FrdProxyItem {
	GENERATED_BODY()
	FrdProxyItem() : bHasProxy(false),bUseWithDestruction(false),bPooled(true),bSimplePool(false),bDontRemove(false),bDontHide(false),bDestroyed(false),bCallSwapEvent(false) {}
	FrdProxyItem(const FrdProxyItem& o) : centerOffset(o.centerOffset),bHasProxy(o.bHasProxy),sid(o.sid),ismc(o.ismc),destroyedSid(o.destroyedSid),destroyedPrefab(o.destroyedPrefab),destroyedOffset(o.destroyedOffset),
					instanceIndex(o.instanceIndex),prefab(o.prefab),actorClass(o.actorClass),
					proxyDataLayer(o.proxyDataLayer),proxyStaticMeshSid(o.proxyStaticMeshSid),distance(o.distance),transform(o.transform),
					proxyActor(o.proxyActor),proxyPhysicsTimeout(o.proxyPhysicsTimeout),proxyInstanceIndex(o.proxyInstanceIndex),proxyInstanceComponent(o.proxyInstanceComponent),
					proxyType(o.proxyType),bUseWithDestruction(o.bUseWithDestruction),bPooled(o.bPooled),bSimplePool(o.bSimplePool),bDontRemove(o.bDontRemove),
					bDontHide(o.bDontHide),savedState(o.savedState),instanceVolume(o.instanceVolume),bDestroyed(o.bDestroyed),bCallSwapEvent(o.bCallSwapEvent),
					pickup(o.pickup),swappedInstances(o.swappedInstances) {}
	FrdProxyItem(const FName& s,UInstancedStaticMeshComponent* isc,const FName dmSid,UClass* dp,const FTransform& dof,int32 ii,AActor* pf,UClass* ac,float d,const FTransform& t,AActor* ia,float pto,int32 pii,UInstancedStaticMeshComponent* pic,TSoftObjectPtr<UDataLayerAsset> pdl,const FName& psd,TEnumAsByte<rdProxyType> pt,bool ud,bool p,bool sp,bool dr,bool dh,AActor* iv,bool dy,UPARAM(ref)UrdStateDataAsset* ss,bool cse,FrdPickup pu) : 
					bHasProxy(false),sid(s),ismc(isc),destroyedSid(dmSid),destroyedPrefab(dp),destroyedOffset(dof),instanceIndex(ii),prefab(pf),actorClass(ac),
					proxyDataLayer(pdl),proxyStaticMeshSid(psd),distance(d),transform(t),proxyActor(ia),proxyPhysicsTimeout(pto),proxyInstanceIndex(pii),proxyInstanceComponent(pic),
					proxyType(pt),bUseWithDestruction(ud),bPooled(p),bSimplePool(sp),bDontRemove(dr),bDontHide(dh),savedState(ss),instanceVolume(iv),bDestroyed(dy),
					bCallSwapEvent(cse),pickup(pu) {}
	FrdProxyItem(const FrdProxySetup& o,const FName sourceSid,const FName proxySid,const FName destroyedProxySid) : 
					centerOffset(o.centerOffset),bHasProxy(false),sid(sourceSid),destroyedSid(destroyedProxySid),destroyedPrefab(o.destroyedPrefab.LoadSynchronous()),destroyedOffset(o.destroyedOffset),
					actorClass(o.proxyActor.LoadSynchronous()),
					proxyDataLayer(o.proxyDataLayer),proxyStaticMeshSid(proxySid),distance(o.longDistance),
					proxyPhysicsTimeout(o.proxyPhysicsTimeout),
					proxyType(o.proxyType),bUseWithDestruction(o.bUseWithDestruction),bPooled(o.bPooled),bSimplePool(o.bSimplePool),bDontRemove(o.bDontRemove),
					bDontHide(o.bDontHide),savedState(o.savedState),bDestroyed(false),bCallSwapEvent(o.bCallSwapEvent),
					pickup(o.pickup) {}
public:

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	FVector			centerOffset=FVector(0,0,0);

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	uint8			bHasProxy:1;

	UPROPERTY(Category="rdProxy|Source",EditAnywhere)
	FName sid;

	UPROPERTY(Category="rdProxy|Source",EditAnywhere)
	UInstancedStaticMeshComponent* ismc=nullptr;

	UPROPERTY(Category="rdProxy|Destruction",EditAnywhere)
	FName destroyedSid;

	UPROPERTY(Category="rdProxy|Destruction",EditAnywhere)
	UClass* destroyedPrefab=nullptr;

	UPROPERTY(Category="rdProxy|Destruction",EditAnywhere)
	FTransform	destroyedOffset;

	UPROPERTY(Category="rdProxy|Source",EditAnywhere)
	int32 instanceIndex=-1;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	AActor* prefab=nullptr;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	UClass*	actorClass=nullptr;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	TSoftObjectPtr<UDataLayerAsset> proxyDataLayer;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	FName proxyStaticMeshSid;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	double distance=-1.0f;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	FTransform	transform;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	AActor* proxyActor=nullptr;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	float proxyPhysicsTimeout=30.0f;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	int32 proxyInstanceIndex=-1;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	UInstancedStaticMeshComponent*	proxyInstanceComponent=nullptr;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	TEnumAsByte<rdProxyType> proxyType=RDPROXYTYPE_SHORTDISTANCE;

	UPROPERTY(Category=rdProxies,EditAnywhere)
	uint8 bUseWithDestruction:1;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	uint8 bPooled:1;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	uint8 bSimplePool:1;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	uint8 bDontRemove:1;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	uint8 bDontHide:1;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	UrdStateDataAsset* savedState=nullptr;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	AActor* instanceVolume=nullptr;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	uint8 bDestroyed:1;

	UPROPERTY(Category="rdProxy|System",EditAnywhere)
	uint8 bCallSwapEvent:1;

	UPROPERTY(Category="rdProxy|Proxy",EditAnywhere)
	FrdPickup pickup;

	TArray<int32> swappedInstances;
};

// [rdInst v1.35] FrdProxyInstanceItems
USTRUCT(BlueprintType)
struct FrdProxyInstanceItems {
	GENERATED_BODY()
public:
	UPROPERTY(Category=rdProxies,EditAnywhere)
	TMap<int32,FrdProxyItem> proxyInstanceIndexList;
};

// [rdInst v1.35-1.43] FrdProxyActorItem
USTRUCT(BlueprintType,meta=(HasNativeBreak="/Script/rdInst.rdActor.BreakProxyActorItem",HasNativeMake="/Script/rdInst.rdActor.MakeProxyActorItem"))
struct FrdProxyActorItem {
	GENERATED_BODY()
public:
	FrdProxyActorItem() : proxyActor(nullptr),proxyInstanceIndex(-1),proxySource(0),instanceIndex(-1),idleCountdown(10),forDestruction(false),forLongDistance(false),bDontRemove(false),bDontHide(false),spawnMillis(0) {}
	FrdProxyActorItem(const FrdProxyActorItem& o) : proxyActor(o.proxyActor),proxyInstanceIndex(o.proxyInstanceIndex),proxyInstanceComponent(o.proxyInstanceComponent),proxyItem(o.proxyItem),proxySource(o.proxySource),instanceIndex(o.instanceIndex),idleCountdown(o.idleCountdown),forDestruction(o.forDestruction),forLongDistance(o.forLongDistance),bDontRemove(o.bDontRemove),bDontHide(o.bDontHide),spawnMillis(o.spawnMillis) {}
	FrdProxyActorItem(AActor* pa,int32 pii,UInstancedStaticMeshComponent* pic,const FrdProxyItem& pi,int32 ps,int32 ii,const FTransform& t,int32 ic,bool fd,bool fld,bool dr,bool dh) : proxyActor(pa),proxyInstanceIndex(pii),proxyInstanceComponent(pic),proxyItem(pi),proxySource(0),instanceIndex(-1),idleCountdown(10),forDestruction(fd),forLongDistance(fld),bDontRemove(dr),bDontHide(dh),spawnMillis(0) {}

	UPROPERTY(Category=rdProxies,EditAnywhere)
	AActor*			proxyActor=nullptr;

	UPROPERTY(Category=rdProxies,EditAnywhere)
	int32			proxyInstanceIndex=-1;

	UPROPERTY(Category=rdProxies,EditAnywhere)
	UInstancedStaticMeshComponent*	proxyInstanceComponent=nullptr;

	FrdProxyItem	proxyItem;
	int32			proxySource=0;

	UPROPERTY(Category=rdProxies,EditAnywhere)
	int32			instanceIndex=-1;
	UPROPERTY(Category=rdProxies,EditAnywhere)
	FTransform		instanceTransform;

	UPROPERTY(Category=rdProxies,EditAnywhere)
	int32			idleCountdown=10;
	UPROPERTY(Category=rdProxies,EditAnywhere)
	uint8			forDestruction:1;
	UPROPERTY(Category=rdProxies,EditAnywhere)
	uint8			forLongDistance:1;
	UPROPERTY(Category=rdProxies,EditAnywhere)
	uint8			bDontRemove:1;
	UPROPERTY(Category=rdProxies,EditAnywhere)
	uint8			bDontHide:1;

	uint64			spawnMillis=0;
};

// [rdInst v1.35-1.43] FrdInstanceItems
USTRUCT(BlueprintType,meta=(HasNativeBreak="/Script/rdInst.rdActor.BreakInstanceItems",HasNativeMake="/Script/rdInst.rdActor.MakeInstanceItems"))
struct FrdInstanceItems {
	GENERATED_BODY()
public:

	FrdInstanceItems() : mesh(nullptr) {}
	FrdInstanceItems(const FrdInstanceItems& o) : mesh(o.mesh),volume(o.volume),instances(o.instances),transforms(o.transforms) {}
	FrdInstanceItems(UStaticMesh* m,const TArray<int32>& i,const TArray<FTransform>& t) : mesh(m),instances(i),transforms(t) {}

	UPROPERTY(Category=rdInstances,EditAnywhere)
	UStaticMesh* mesh=nullptr;

	UPROPERTY(Category=rdInstances,EditAnywhere)
	AActor* volume=nullptr;

	UPROPERTY(Category=rdInstances,EditAnywhere)
	TArray<int32> instances;

	UPROPERTY(Category=rdInstances,EditAnywhere)
	TArray<FTransform> transforms;
};

Section 2.7. rdInstBase- Conversions

// [rdInst v1.24] Converts the Instance to a ChildActorComponent
UChildActorComponent* rdConvertInstanceToChildActor(ArdActor* actor,UStaticMesh* mesh,int32 index);

// [rdInst v1.50] Converts the Instance to a ChildActorComponent
UChildActorComponent* rdConvertInstanceToChildActorX(ArdActor* actor,const FName sid,int32 index);

// [rdInst v1.24] Converts the Instance to a new StaticMesh Actor in the level, setting its mesh to the instance mesh (spawn)
AActor* rdConvertInstanceToLevelActor(UStaticMesh* mesh,int32 index);

// [rdInst v1.50] Converts the Instance to a new StaticMesh Actor in the level, setting its mesh to the instance mesh (spawn)
AActor* rdConvertInstanceToLevelActorX(const FName sid,int32 index);

// [rdInst v1.24] Converts the Instance to a new Actor - actorClass, in the level (spawn)
AActor* rdConvertInstanceToActor(UStaticMesh* mesh,UClass* actorClass,int32 index);

// [rdInst v1.50] Converts the Instance to a new Actor - actorClass, in the level (spawn)
AActor* rdConvertInstanceToActorX(const FName sid,UClass* actorClass,int32 index);

// [rdInst v1.24] Converts the Instance to a new Actor in the level from the ActorPool
AActor* rdConvertInstanceToActorFromPool(UStaticMesh* mesh,UClass* actorClass,int32 index);

// [rdInst v1.50] Converts the Instance to a new Actor in the level from the ActorPool
AActor* rdConvertInstanceToActorFromPoolX(const FName sid,UClass* actorClass,int32 index);

// [rdInst v1.24] Converts all Instances in the volume to new Actors in the level from the ActorPool
int32 rdConvertInstancesToActorsFromPool(UStaticMesh* mesh,UClass* actorClass,rdTraceMode mode,int32 radius,const FVector start,const FVector finish,TArray<AActor*>& actors);

// [rdInst v1.50] Converts all Instances in the volume to new Actors in the level from the ActorPool
int32 rdConvertInstancesToActorsFromPoolX(const FName sid,UClass* actorClass,rdTraceMode mode,int32 radius,const FVector start,const FVector finish,TArray<AActor*>& actors);

// [rdInst v1.50] Harvests all instances it can from the actors (C++ only wrapper)
void rdHarvestInstancesFromActorList(TArray<AActor*> actorList,bool justInstances,TArray<AActor*>& addedList,TMap<FName,FrdInstItemX>& scrapeMap);


Section 2.8. rdInstBase- Procedural

// [rdInst v1.24] Procedurally places the meshes over the volume
int32 rdProceduralGenerate(const ArdSpawnActor* spawner);

// [rdInst v1.35] C++ only wrapper
int32 rdProceduralGenerateBake(const ArdSpawnActor* spawner,FrdSpawnData* bakeToSpawnData);

// [rdInst v1.24] C++ only utility function
float getLandscapeZ(float x,float y,float radius,FHitResult& hit,bool fixSlopes=false);

Section 2.9. rdInstBase- Splines

// [rdInst v1.35] Splits the Spline into X subsplines
TArray<AActor*> rdSplitSplineInto(AActor* actor,USplineComponent* spline,int32 num,bool callBPfunctions=false);

// [rdInst v1.35] Get the Spline Points Position
void rdGetSplinePointPosition(int32 point,FVector& loc,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local);

// [rdInst v1.35] Set the Spline Points Position
TArray<AActor*> rdSetSplinePointPosition(int32 point,const FVector& loc,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local,bool updateSpline=true);

// [rdInst v1.35] Get the Spline Points Rotation
void rdGetSplinePointRotation(int32 point,FRotator& rot,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local);

// [rdInst v1.35] Set the Spline Points Rotation
TArray<AActor*> rdSetSplinePointRotation(int32 point,const FRotator& rot,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local,bool updateSpline=true);

// [rdInst v1.35] Get the Spline Points Scale
void rdGetSplinePointScale(int32 point,FVector& scale,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr);

// [rdInst v1.35] Set the Spline Points Scale
TArray<AActor*> rdSetSplinePointScale(int32 point,const FVector& scale,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,bool updateSpline=true);

// [rdInst v1.35] Get the Spline Points Tangent
void rdGetSplinePointTangent(int32 point,FVector& leaveTangent,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local);

// [rdInst v1.35] Set the Spline Points Tangent
TArray<AActor*> rdSetSplinePointTangent(int32 point,const FVector& leaveTangent,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local,bool updateSpline=true);

// [rdInst v1.35] Gets the SubSpline from the point
AActor* rdGetSubSplineAtPoint(int32 point,const TArray<AActor*>& subsplines,int32& subPoint);

// [rdInst v1.35] Finds the closest point on a SubSpline from the location
AActor* rdFindClosestSplinePoint(const FVector& loc,const TArray<AActor*>& subsplines,int32& localPoint,int32& overallPoint,float& distance,bool& found);

// [rdInst v1.35] Copy the Spline data from one to another
void rdCopySpline(USplineComponent* spline1,USplineComponent* spline2,int32 start,int32 end);
	
// [rdInst v1.35] Trim the Spline Points
void rdTrimSpline(USplineComponent* spline,int32 start,int32 len);

// [rdInst v1.35] Joins the Splines into one
void rdJoinSplines(AActor* actor,bool callBPfunctions=false);

// [rdInst v1.35] Joins the SubSplines attached to the actor into the actors spline
void rdMergeActorsSubSplines(AActor* actor,bool callBPfunctions=false);

// [rdInst v1.35] Populate the Spline with SplineMeshComponents from a single mesh
int32 rdPopulateSplineFast(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,UStaticMesh* mesh,const FTransform offset=FTransform(),float gap=0.0f,UMaterialInterface* mat=nullptr,const FVector scale=FVector(1,1,1),const TEnumAsByte<ESplineMeshAxis::Type> axis=ESplineMeshAxis::X,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Populate the Spline with SplineMeshComponents from an array of rdSplinePopulateData structs
int32 rdPopulateSpline(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,const TArray<FrdSplinePopulateData>& data,TArray<FrdSplineInstanceData>& instData,bool random=false,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Remove SplineMeshComponents attached to this spline
void rdRemoveSplineSMCs(AActor* actor,USplineComponent* spline);

#ifdef includeProceduralMeshStuff
// [rdInst v1.35] Populate the Spline with ProceduralMeshComponents from a single mesh
int32 rdPopulateSplinePMCFast(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,UStaticMesh* mesh,UMaterialInterface* mat=nullptr,const FVector scale=FVector(1,1,1),const TEnumAsByte<ESplineMeshAxis::Type> axis=ESplineMeshAxis::X,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Populate the Spline with ProceduralMeshComponents from an array of rdSplinePopulateData structs
int32 rdPopulateSplinePMC(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,const TArray<FrdSplinePopulateData>& data,TArray<FrdSplineInstanceData>& instData,bool random=false,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Remove ProceduralMeshComponents attached to this spline
void rdRemoveSplinePMCs(AActor* actor,USplineComponent* spline);
#endif

// [rdInst v1.35] Comparision of two Spline Sections
static bool equalEqual(const FrdSplineInstanceData& A,const FrdSplineInstanceData& B) { return A==B; }

// [rdInst v1.35] Comparision of two Spline Sections
static bool notEqual(const FrdSplineInstanceData& A,const FrdSplineInstanceData& B) { return A!=B; }

// [rdInst v1.35] Internal, but Public methods
FSplinePoint		FillSplinePoint(USplineComponent* spline,int32 point,float startKey=0.0f);
float				BuildBPSplineSection(const AActor* actor,float startOffset,int32& index);
AActor*				DuplicateActor(const AActor* actor);
int32				GetSubSplineIndex(const AActor* actor);
USplineComponent*	GetSpline(const AActor* actor);
void				CopySplinePoint(USplineComponent* s1,int32 i1,USplineComponent* s2,int32 i2,FVector& loc,FRotator& rot,FVector& scale);

Section 2.10. rdInstBase- Landscape

// Note: These are not yet implemented in rdInst 1.36

// [rdInst v1.40] Returns the height of the landscape using the heightmap
float rdGetLandscapeZ(float x,float y);

// [rdInst v1.40] Paints the Landscape Paint Layer at the specified position, size and strength
void rdPaintLandscape(ULandscapeLayerInfoObject* paintLayer,TEnumAsByte<rdLandscapeShape> shape,float x,float y,float width,float height,float angle=0.0f,float strength=1.0f,float falloff=0.3f,USplineComponent* spline=nullptr,const FString& layer=TEXT(""));

// [rdInst v1.40] Flattens the landscape at the location/size by strength with falloff
void rdFlattenLandscapeArea(TEnumAsByte<rdLandscapeShape> shape,float x,float y,float width,float height,float angle=0.0f,float strength=1.0f,float falloff=0.3f,USplineComponent* spline=nullptr,const FString& layer=TEXT(""));

// [rdInst v1.40] Stamps the texture onto the landscape at the location/size by strength with falloff
void rdStampLandscapeArea(UTexture2D* stamp,float x,float y,float width,float height,float strength=1.0f,const FString& layer=TEXT(""));

// [rdInst v1.40] Creates a Texture of the specified shape and size/rotation
UTexture2D* rdCreateTextureForShape(TEnumAsByte<rdLandscapeShape> shape,float x,float y,float width,float height,float angle=0.0f,float strength=1.0f,float falloff=0.3f,USplineComponent* spline=nullptr);

Section 2.11. rdInstBase – Utilities

// Converts the Instances, SMs and ChildActorComponents with SMs contained by this actor to Instances
void rdHarvestSMs(AActor* actor,bool hide,int32& numConverted,int32& numStandard,TMap<FName,int32>& sidMap);

// Removes the Instances harvested from this actor
void rdRemoveHarvestedInstances(AActor* actor);

// Set to True to Enable runtime ConvertToISMs for Actors and blueprints
void rdSetupAutoInst(bool autoInst=true,bool autoFromTags=false,bool autoMeshActors=true,bool autoBPs=true);

FName rdGetAutoInstSidIncludingCullVolumes(UStaticMeshComponent* smc);
void rdGetStaticMeshCounts(AActor* actor,TMap<FName,int32>& sidMap);

// Converts Actors in the level to ISMs and Hides the Actors
void rdConvertAutoISMs();

// Reverts Actors in the level from ISMs and Shows the Actors
void rdRevertFromAutoISMs();

// [rdInst v1.35] Helper Function that Sets the Label (Editor only) of the Actor
void rdSetActorLabel(AActor* actor,const FName label);

// [rdInst v1.22] Returns the number of assets compiling or waiting for compile
int32 rdGetNumAssetsCompiling();

// [rdInst v1.22] waits for all assets to finish compiling
void rdWaitForCompiling();

// [rdInst v1.22] Submits all materials for compile
void rdSubmitMaterialsForCompile();

// [rdInst v1.35] Is Editor
bool rdIsEditor();

// [rdInst v1.36] Is Playing
bool rdIsPlaying();

// [rdInst v1.43] Fills the Location and Rotation vectors with the editors current camera position
void rdGetEditorCameraPos(FVector& loc,FRotator& rot);

// [rdInst v1.43] Returns the currently controlled Pawn. If this returns null, it means a multiplayer pawn is waiting to spawn
APawn* rdGetControlledPawn();

// [rdInst v1.43] Draws a line from start to end in col for duration
void rdDrawLine(const FVector& start,const FVector& end,const FColor& col,float duration=10000.0f);

// [rdInst v1.35] Get Landscape Bounds
FBox rdGetLandscapeBounds(ALandscapeProxy* landscape);

// [rdInst v1.22] Get Current average Scalabity (0-4)
rdScalabilityScale rdGetCurrentScalability();

// [rdInst v1.22] Get Current Scalabity for specified area (0-4)
rdScalabilityScale rdGetCurrentScalabilityFor(rdScalabilityType stype);

// [rdInst v1.22] Get Current Resolution Scale (0-100)
float rdResolutionScale();

// [rdInst v1.22] Get Scalability Benchmark Results for CPU and GPU
bool rdGetScalabilityBenchmarks(float& bmCpu,float& bmGpu);

// Create a temporary BakedDataAsset
UrdBakedDataAsset* rdCreateTempBakedDataAsset();

// Load (or optionally create if not found or null) the BakedDataAsset from disk
UrdBakedDataAsset* rdLoadBakedDataAsset(TSoftObjectPtr<UrdBakedDataAsset>& data,bool create=false);

// [rdInst v1.35] Adds SpawnStuffData with the baked transforms of the volume to the proxy scan list, useful for turning off collision and using a proxy collision when close
int32 rdBakeVolumeTransformsForProxies(AActor* volume,const TArray<UStaticMesh*>& meshes,const TArray<FrdProxySetup>& proxies,TArray<FrdSpawnStuffData>& bakedObjectList,int32 rows=1,int32 cols=1,bool storeTransforms=false);

// [rdInst v1.35] Removes the SpawnStuffData associated with this volume from the proxy scan list
void rdRemoveVolumeTransformsForProxies(AActor* volume);

// [rdInst v1.50] Creates a SpawnActor from the passed in volume
ArdSpawnActor* rdCreateSpawnActorFromVolume(AActor* volume,double distance,int32 distFrames,bool spatial,TEnumAsByte<rdSpawnMode> spawnMode=rdSpawnMode::RDSPAWNMODE_ALL);

// [rdInst v1.50] (C++ wrappers)
void rdAddSpawnSidTransform(const FName sid,const FTransform& stransform,FrdSpawnData& sd,TArray<FrdBakedSpawnObjects>& bd,UrdBakedDataAsset* bda,const FTransform& transform,FrdProxySetup* proxy=nullptr,int32 gridW=16,int32 gridH=16);
void rdAddSpawnSidTransforms(const FName sid,TArray<FTransform>& transforms,FrdSpawnData& sd,TArray<FrdBakedSpawnObjects>& bd,UrdBakedDataAsset* bda,const FTransform& transform,FrdProxySetup* proxy=nullptr,int32 gridW=16,int32 gridH=16);

// [rdInst v1.50] 
FrdBakedSpawnObjects* AddNewPlacementData(FrdSpawnData& sd,UrdBakedDataAsset* bda,const FName sid,FrdProxySetup* proxy=nullptr,int32 gridW=16,int32 gridH=16);

// [rdInst v1.50] Updates the NavMesh with the rdInst Instances
void rdUpdateNav();

// [rdInst v1.35-1.50] Creates a SpawnActor from the passed in objects
ArdSpawnActor* rdCreateSpawnActorFromObjectList(UrdSetObjectsList* instances,FTransform& transform,const FString& filename=TEXT(""),double distance=0.0f,int32 distFrames=0,bool spatial=true,TEnumAsByte<rdSpawnMode> spawnMode=rdSpawnMode::RDSPAWNMODE_ALL,bool harvestInstances=false,int32 spawnActorGridX=16,int32 spawnActorGridY=16);

// [rdInst v1.50] Fills the Location and Rotation vectors with the editors current camera position
void rdGetEditorCameraPos(FVector& loc,FRotator& rot);

// [rdInst v1.50] Returns the currently controlled Pawn. If this returns null, it means a multiplayer pawn is waiting to spawn
APawn* rdGetControlledPawn();

// [rdInst v1.50] Draws a line from start to end in col for duration
void rdDrawLine(const FVector& start,const FVector& end,const FColor& col,float duration=10000.0f);

// [rdInst v1.50] Shifts the Origin of the rdInst Base Actor. Useful to remove jitter from large distances away. Call when transitioning to a new part of your world.
void rdMoveBaseActor(const FVector& location,const FRotator& rot);

// [rdInst v1.50] Shifts the Origin of the rdInst Base Actor and updates existing instances to be where they were. Useful to remove jitter from large distances away. Call when transitioning to a new part of your world.
void rdReseatBaseActor(const FVector& location,const FRotator& rot);

// [rdInst v1.50] Returns true is the mesh is Nanite
bool rdMeshIsNaniteX(const FName sid);

// [rdInst v1.50] Returns true is the mesh is Nanite
bool rdMeshIsNanite(const UStaticMesh* mesh);

// [rdInst v1.50] Builds an internal list of lights in the level wanting to swap to VSM shadow rendering in proximity. Call this if you add/remove lights in the level at runtime
void rdBuildMegaLightList();



Section 2.12. rdInstBase – Data and Structures

// [rdInst v1.24] Bool to use HISMs rather than ISMs - defaults to True, but will change once UE4.27 is obsolete
bool bUseHISMs=true;

// [rdInst v1.50] Bool to use ISMs rather than HISMs when the mesh is Nanite (UE5.0 up)
bool bUseISMsForNanite=true;

// [rdInst v1.35] Bool to recycle Instances rather than remove them
bool bRecycleInstances=true;

// [rdInst v1.50] Bool to use WorldSpace transforms for Instancing
bool bWorldSpaceInstancing=false;

// [rdInst v1.50] When True, MegaLights using Hardware RT swap to using VSM for high quality and WPO motion
bool bSwapMegaLightsToVSMinProximity=false;

// [rdInst v1.50] Set to True to only parse Lights with the "MegaLightSwap" tag
bool bOnlySwapMegaLightsWithTag=true;

// [rdInst v1.50] The maximum distance at which everything outside gets culled
float swapMegaLightDistance=1000.0f;

// [rdInst v1.00] Contains the return from Counting the ISMs
int32 numInstances=0;

// [rdInst v1.24] Add PhysicalMaterials to this Ignore List (for the procedural population)
TArray<UPhysicalMaterial*> ignorePMaps;

// [rdInst v1.00] Map of StaticMesh Keys with Arrays of Instances as the Values
TMap<const UStaticMesh*,FrdInstList> instList;

// [rdInst v1.50] The maximum distance at which everything outside gets culled
float maxCullDistance=400000.0f;

// [rdInst v1.35] How often the scan for swapping proxies should happen (tick count) -1 turns it off
int32 proxyProcessInterval=-1;

// [rdInst v1.35] Distance to swap proxy actors (this is a float in 4.27)
double proxySwapDistance=1000.0f;

// [rdInst v1.35] Distance to swap long-distance proxy actors (this is a float in 4.27)
double proxyLongDistanceSwapDistance=20000.0f;

// [rdInst v1.50] Distance to swap proxy actors
double proxyImpactScanDistance=600.0f;

// [rdInst v1.35] List of Actors to ignore when doing the proxy scans
TArray<AActor*> proxyScanIgnoreActors;

// [rdInst v1.50] Type of override for the runtime population system in rdSpawnActors
TEnumAsByte<rdPopulationOverride> runPopOverride;

// [rdInst v1.35] How long to leave the Interactive Actor in place after leaving the radius (in ticks)
int32 proxyIdleTicks=10;

// [rdInst v1.35] How long to leave the Destruction Actor in place after it's been swapped (in ticks)
int32 proxyDestructionIdleTicks=200;

// [rdInst v1.35] Map of Meshes to recycled Instances available for re-use
TMap<UStaticMesh*,TArray<int32>> freeInstanceMap;

// [rdInst v1.50] Only swap back to ISM once physics velocity is below this threshhold or the proxyPhysicsTimout is reached
float proxyCutOffPhysicsVelocity=0.01f;

// [rdInst v1.50] When true, only baked proxies are scanned for swapping
bool bProxyOnlyScanBaked=false;

// [rdInst v1.50] Texture with landscape Heightmap/Mask for Cluster Spawns
UTexture* heightMaskMap=nullptr;

// [rdInst v1.50] Fraction of the CPU size to use for the GPU map (only with rdMeshlets)
float heightMaskGPUsize=1.0f;

// [rdInst v1.50] When true, only baked proxies are scanned for swapping
bool bSpawnProxysOnServer=false;

// [rdInst v1.50] When true, rdInst AutoInstancing is activated
bool ConvertToISMAtPlay=false;

// [rdInst v1.50] When true, rdInst sets the cull distance from any CullVolumes present in the level (each treated as infinite bounds)
bool bAutoInstanceSetCullFromVolumes=false;

// [rdInst v1.50] When true, Only Actors with the Tag 'AutoInstance' are instanced
bool ConvertToISM_FromTags=false;

// [rdInst v1.50] When true, StaticMesh Actors are included in the AutoInstancing (more for UE4)
bool ConvertToISM_IncMeshActors=true;

// [rdInst v1.50] When true, Blueprints and PackedLevelActors are included in the AutoInstancing
bool ConvertToISM_IncBPs=true;

// [rdInst v1.50] When true, Foliage is included in the AutoInstancing
bool ConvertToISM_IncFoliage=false;

// [rdInst v1.50] Mesh Count at which to instance with AutoInstancing
int32 ConvertToISM_threshold=3;

// [rdInst v1.50] How to convert StaticMesh Actors with Physics Enabled
TEnumAsByte<rdAutoInstPhysics> ConvertToISM_PhysicConversion=RDAUTOINST_PHYSICS_LEAVE;

// [rdInst v1.50] How to convert StaticMesh Actors with Destruction Enabled
TEnumAsByte<rdAutoInstDestruction> ConvertToISM_DestructionConversion=RDAUTOINST_DESTRUCTION_LEAVE;

// [rdInst v1.50] When true, Processes the Actors Asset Proxy Settings, set using the rdInst ProxySettings window
bool ConvertToISM_ProcessAssetProxySettings=false;

// [rdInst v1.50] Set to true to include the objects Randomization Settings, defaulting from the Asset and overridable from the Actor
bool ConvertToISM_bIncludeRandomization=false;

// [rdInst v1.50] Random Seed for the Randomization
int32 ConvertToISM_randomSeed=0;

// [rdInst v1.50] Theme for the Randomization
FString ConvertToISM_theme;

// [rdInst v1.50] Add PhysicalMaterials to this Ignore List (for the procedural population)
TArray<UPhysicalMaterial*> ignorePMaps;


// [rdInst v1.50] Delegates

// [rdInst v1.50] Event fired when Instance/Prefab swaps to Proxy
FrdInstProxySwapInDelegate OnProxySwapInDelegate;

// [rdInst v1.50] Event fired when Instance/Prefab swaps in from Proxy
FrdInstProxySwapOutDelegate OnProxySwapOutDelegate;

// [rdInst v1.50] Event fired when Proxies want the server to handle spawning the Proxy Actor
FrdInstProxySpawnOnServerDelegate OnSpawnOnServerDelegate;

// [rdInst v1.50] Event fired when an Interactive Pickup Proxy comes into focus - use to display text on the HUD
FrdInstPickupFocusedDelegate OnPickupFocusedDelegate;

// [rdInst v1.50] Event fired when an Interactive Pickup Proxy goes out of focus - use to remove test from the HUD
FrdInstPickupUnfocusedDelegate OnPickupUnfocusedDelegate;

// [rdInst v1.50] Event fired when an Overlap Pickup Proxy has been picked up
FrdInstPickedUpDelegate OnPickedUpDelegate;

// [rdInst v1.50] Event fired when item in the pool is used
FrdActorPoolUsedDelegate OnPoolUsedDelegate;

// [rdInst v1.50] Event fired when item from the pool is returned to the pool
FrdActorPoolReturnedDelegate OnPoolReturnedDelegate;

// [rdInst v1.50] Event fired when a DestructionProxy has swapped and is ready for an Impulse or Field etc
FrdInstDamageDelegate OnDamageDelegate;

// [rdInst v1.50] Event fired Before Spawn or Procedural Actors render their objects
FrdPreSpawnDelegate OnPreSpawnDelegate;

// [rdInst v1.50] Event fired After Spawn or Procedural Actors render their objects
FrdPostSpawnDelegate OnPostSpawnDelegate;


// [rdInst v1.20] Structure used to store spawn data for Distributed Transactions
struct rdDistributedObjectData {
	bool				pooled=false;
	FrdProxySetup			proxy;
	AActor*				actorTemplate=nullptr;
	TArray<TArray<FTransform>>	tList;
	TArray<int32>*			iList;
	TArray<AActor*>*		aList;
	TArray<UNiagaraComponent*>*	fxList;
};

// [rdInst v1.35] Structure with items for spawning
struct FrdSetObjectItem {
	GENERATED_BODY()
public:
	UStaticMesh*		mesh;
	UClass*			actorClass;
	AActor*			actorTemplate;
	UNiagaraSystem*		vfx;
	bool			pool;
	int32			numToPool;
	TArray<FTransform>	transforms;
};

// [rdInst v1.35] List of the previous items
class UrdSetObjectsList : public UObject {
	GENERATED_BODY()
public:
	TArray<FrdSetObjectItem> objects;
};