Section 2.2.6 rdInstBase- Instancing – Utilities

// [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.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.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.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);