AInstancedFoliageActor

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Foliage

Header

/Engine/Source/Runtime/Foliage/Public/InstancedFoliageActor.h

Include

#include "InstancedFoliageActor.h"

Syntax

class AInstancedFoliageActor : public AISMPartitionActor

Variables

Name Description

Public variable

FFoliageInstanc...

 

InstanceBaseCache

Cross level references cache for instances base.

Constructors

Name Description

Public function

AInstancedFoliageActor

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

TUniqueObj< ...

 

AddFoliageInfo

(
    UFoliageType* FoliageType
)

Public function

TUniqueObj< ...

 

AddFoliageInfo

(
    UFoliageType* FoliageType,
    TUniqueObj< FFoliageInfo >&& Folia...
)

Public function

UFoliageType...

 

AddFoliageType

(
    const UFoliageType* InType,
    FFoliageInfo** OutInfo
)

Public function Static

void

 

AddInstances

(
    UObject* WorldContextObject,
    UFoliageType* InFoliageType,
    const TArray< FTransform >& InTran...
)

Public function

FFoliageInfo...

 

AddMesh

(
    UStaticMesh* InMesh,
    UFoliageType** OutSettings,
    const UFoliageType_InstancedStaticM...
)

Add a new static mesh.

Public function

FFoliageInfo...

 

AddMesh

(
    UFoliageType* InType
)

Add a new static mesh.

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function

void

 

ApplySelection

(
    bool bApply
)

Propagate the selected instances to the actual foliage implementation.

Public function Const

bool

 

CanEditFoliageInstance

(
    const FFoliageInstanceId& Instance...
)

Public function Const

bool

 

CanMoveFoliageInstance

(
    const FFoliageInstanceId& Instance...,
    const ETypedElementWorldType WorldT...
)

Public function Static

bool

 

CheckCollisionWithWorld

(
    const UWorld* InWorld,
    const UFoliageType* Settings,
    const FFoliageInstance& Inst,
    const FVector& HitNormal,
    const FVector& HitLocation,
    UPrimitiveComponent* HitCompon...
)

Public function

void

 

CleanupDeletedFoliageType()

Public function

bool

 

ContainsInstancesFromProceduralFoliageComponent

(
    const UProceduralFoliageComponent&...
)

Public function

bool

 

DeleteFoliageInstances

(
    TArrayView< const FFoliageInstanceI...
)

Public function

void

 

DeleteInstancesForComponent

(
    UActorComponent* InComponent
)

Deletes the instances attached to a component.

Public function Static

void

 

DeleteInstancesForComponent

(
    UWorld* InWorld,
    UActorComponent* InComponent
)

Deletes the instances attached to a component, traverses all foliage actors in the world.

Public function

void

 

DeleteInstancesForComponent

(
    UActorComponent* InComponent,
    const UFoliageType* InFoliageT...
)

Deletes the instances attached to a component.

Public function

void

 

DeleteInstancesForProceduralFoliageComponent

(
    const UProceduralFoliageComponent&...,
    bool InRebuildTree
)

Deletes the instances spawned by a procedural component.

Public function

void

 

DetectFoliageTypeChangeAndUpdate()

Public function

bool

 

DuplicateFoliageInstances

(
    TArrayView< const FFoliageInstanceI...,
    TArray< FFoliageInstanceId >& OutN...
)

Public function

void

 

EnterEditMode()

Public function

void

 

ExitEditMode()

Public function Const

const UFolia...

 

FindFoliageType

(
    const FFoliageInfo* InFoliageI...
)

Returns FoliageType associated to this FoliageInfo.

Public function

FFoliageInfo...

 

FindFoliageTypeOfClass

Public function

FFoliageInfo...

 

FindInfo

(
    const UFoliageType* InType
)

Finds a mesh entry.

Public function Const

const FFolia...

 

FindInfo

(
    const UFoliageType* InType
)

Finds a mesh entry.

Public function

FFoliageInfo...

 

FindOrAddMesh

(
    UFoliageType* InType
)

Finds a mesh entry or adds it if it doesn't already exist.

Public function Static

bool

 

FoliageTrace

(
    const UWorld* InWorld,
    FHitResult& OutHit,
    const FDesiredFoliageInstance& Des...,
    FName InTraceTag,
    bool InbReturnFaceIndex,
    const FFoliageTraceFilterFunc& Fil...,
    bool bAverageNormal
)

Public function

void

 

ForEachFoliageInfo

(
    TFunctionRef< bool...
)

Public function Static

AInstancedFo...

 

Get

(
    UWorld* InWorld,
    bool bCreateIfNone,
    ULevel* InLevelHint,
    const FVector& InLocationHint
)

Get the instanced foliage actor for the specified params

Public function

void

 

GetAllFoliageTypesForSource

(
    const UObject* InSource,
    TArray< const UFoliageType* > ...
)

Performs a reverse lookup from a source object to all the foliage types that are currently using that object (includes assets and blueprint classes)

Public function

TMap< UFolia...

 

GetAllInstancesFoliageType()

Will return all the foliage type used.

Public function Const

UActorCompon...

 

GetBaseComponentFromBaseId

(
    const FFoliageInstanceBaseId& Base...
)

Public function Static

AInstancedFo...

 

GetDefault

(
    UWorld* InWorld
)

Public function Const

const TMap< ...

 

GetFoliageInfos()

Public function Const

bool

 

GetFoliageInstanceTransform

(
    const FFoliageInstanceId& Instance...,
    FTransform& OutInstanceTransform,
    bool bWorldSpace
)

Public function Const

UFoliageType...

 

GetFoliageTypeForInfo

(
    const FFoliageInfo* FoliageInf...
)

Public function Static

AInstancedFo...

 

GetInstancedFoliageActorForCurrentLevel

(
    const UWorld* InWorld,
    bool bCreateIfNone
)

Get the instanced foliage actor for the current streaming level.

Public function Static

AInstancedFo...

 

GetInstancedFoliageActorForLevel

(
    ULevel* Level,
    bool bCreateIfNone
)

Get the instanced foliage actor for the specified streaming level.

Public function

TMap< UFolia...

 

GetInstancesForComponent

(
    UActorComponent* InComponent
)

Returns a map of Static Meshes and their placed instances attached to a component.

Public function

UFoliageType...

 

GetLocalFoliageTypeForSource

(
    const UObject* InSource,
    FFoliageInfo** OutMeshInfo
)

Performs a reverse lookup from a source object to a local foliage type (i.e. the foliage type owned exclusively by this IFA)

Public function Const

int32

 

GetOverlappingBoxCount

(
    const UFoliageType* FoliageTyp...,
    const FBox& Box
)

Finds the number of instances overlapping with the box.

Public function Const

void

 

GetOverlappingBoxTransforms

(
    const UFoliageType* FoliageTyp...,
    const FBox& Box,
    TArray< FTransform >& OutTransform...
)

Finds all instances in the provided box and get their transforms.

Public function Const

void

 

GetOverlappingMeshCounts

(
    const FSphere& Sphere,
    TMap< UStaticMesh*, int32 >& ...
)

Perf Warnin: potentially slow! Dev-only use recommended.

Public function Const

int32

 

GetOverlappingSphereCount

(
    const UFoliageType* FoliageTyp...,
    const FSphere& Sphere
)

Finds the number of instances overlapping with the sphere.

Public function

TMap< UFolia...

 

GetSelectedInstancesFoliageType()

Will return all the foliage type used by currently selected instances.

Public function Const

FBox

 

GetSelectionBoundingBox()

Get the bounds of all selected instances.

Public function Const

bool

 

GetSelectionLocation

(
    FBox& OutLocation
)

Returns the location for the widget.

Protected function

void

 

HandleFoliageInstancePostMove

(
    const FFoliageInstanceId& Instance...
)

Protected function

void

 

HandleFoliageInstancePreMove

(
    const FFoliageInstanceId& Instance...
)

Public function Static

bool

 

HasFoliageAttached

(
    UActorComponent* InComponent
)

Whether there any foliage instances painted on specified component

Public function Const

bool

 

HasSelectedInstances()

Whether actor has selected instances.

Public function

void

 

MapRebuild()

Called in response to BSP rebuilds to migrate foliage from obsolete to new components.

Public function

void

 

MoveAllInstancesToLevel

(
    ULevel* InTargetLevel
)

Move all instances to a foliage actor in target level.

Public function Static

void

 

MoveInstancesForComponentToCurrentLevel

(
    UActorComponent* InComponent
)

Moves instances based on the specified component to the current streaming level.

Public function Static

void

 

MoveInstancesForComponentToLevel

(
    UActorComponent* InComponent,
    ULevel* TargetLevel
)

Public function

void

 

MoveInstancesForMovedComponent

(
    UActorComponent* InComponent
)

Move instances based on a component that has just been moved.

Public function

void

 

MoveInstancesForMovedOwnedActors

(
    AActor* InActor
)

Move instances that are owned by foliage actor.

Public function

void

 

MoveInstancesToLevel

(
    ULevel* InTargetLevel,
    TSet< int32 >& InInstanceList,
    FFoliageInfo* InCurrentMeshInf...,
    UFoliageType* InFoliageType,
    bool bSelect
)

Move instances to a foliage actor in target level.

Public function

void

 

MoveInstancesToNewComponent

(
    UPrimitiveComponent* InOldComp...,
    UPrimitiveComponent* InNewComp...
)

Change all instances based on one component to a new component (possible in another level).

Public function

void

 

MoveInstancesToNewComponent

(
    UPrimitiveComponent* InOldComp...,
    const FBox& InBoxWithInstancesToMo...,
    UPrimitiveComponent* InNewComp...
)

Change all instances based on one component to a new component (possible in another level).

Public function Static

void

 

MoveInstancesToNewComponent

(
    UWorld* InWorld,
    UPrimitiveComponent* InOldComp...,
    UPrimitiveComponent* InNewComp...
)

Change all instances based on one component to a new component (possible in another level).

Public function Static

void

 

MoveInstancesToNewComponent

(
    UWorld* InWorld,
    UPrimitiveComponent* InOldComp...,
    const FBox& InBoxWithInstancesToMo...,
    UPrimitiveComponent* InNewComp...
)

Change all instances based on one component to a new component (possible in another level).

Public function

void

 

MoveSelectedInstancesToLevel

(
    ULevel* InTargetLevel
)

Move selected instances to a foliage actor in target level.

Public function

void

 

NotifyFoliageInstanceMovementEnded

(
    const FFoliageInstanceId& Instance...
)

Public function

void

 

NotifyFoliageInstanceMovementOngoing

(
    const FFoliageInstanceId& Instance...
)

Public function

void

 

NotifyFoliageInstanceMovementStarted

(
    const FFoliageInstanceId& Instance...
)

Public function

void

 

NotifyFoliageInstanceSelectionChanged

(
    const FFoliageInstanceId& Instance...,
    const bool bIsSelected
)

Public function

void

 

NotifyFoliageTypeChanged

(
    UFoliageType* FoliageType,
    bool bSourceChanged
)

Called to notify InstancedFoliageActor that a UFoliageType has been modified

Public function

void

 

NotifyFoliageTypeWillChange

(
    UFoliageType* FoliageType
)

Public function

FOnFoliageTy...

 

OnFoliageTypeMeshChanged()

Public function Static

void

 

RemoveAllInstances

(
    UObject* WorldContextObject,
    UFoliageType* InFoliageType
)

Public function

void

 

RemoveBaseComponentOnFoliageTypeInstances

(
    UFoliageType* FoliageType
)

Public function

bool

 

RemoveFoliageInfoAndCopyValue

(
    UFoliageType* FoliageType,
    TUniqueObj< FFoliageInfo >& OutFol...
)

Public function

void

 

RemoveFoliageType

(
    UFoliageType** InFoliageTy...,
    int32 Num
)

Remove the FoliageType from the list, and all its instances.

Public function

void

 

RepairDuplicateIFA

(
    AInstancedFoliageActor* InDupl...
)

Fix up a duplicate IFA

Public function

void

 

SelectInstance

(
    UInstancedStaticMeshComponent*...,
    int32 InComponentInstanceIndex,
    bool bToggle
)

Select an individual instance.

Public function

bool

 

SelectInstance

(
    AActor* InActor,
    bool bToggle
)

Select an individual instance.

Public function

bool

 

SetFoliageInstanceTransform

(
    const FFoliageInstanceId& Instance...,
    const FTransform& InstanceTransfor...,
    bool bWorldSpace,
    bool bTeleport
)

Overridden from APartitionActor

Name Description

Public function Virtual Const

uint32

 

GetDefaultGridSize

(
    UWorld* InWorld
)

Public function Virtual Const

bool

 

ShouldIncludeGridSizeInName

(
    UWorld* InWorld
)

Overridden from AActor

Name Description

Public function Virtual

void

 

Destroyed()

Called when this actor is explicitly being destroyed during gameplay or in the editor, not called during level streaming or gameplay ending

Protected function Virtual

float

 

InternalTakeRadialDamage

(
    float Damage,
    FRadialDamageEvent const& RadialDa...,
    AController* EventInstigator,
    AActor* DamageCauser
)

Default InternalTakeRadialDamage behavior finds and scales damage for the closest component which isn't appropriate for foliage.

Public function Virtual Const

bool

 

IsLevelBoundsRelevant()

Indicates whether this actor should participate in level bounds calculations

Public function Virtual

void

 

RerunConstructionScripts()

We don't want to have our components automatically destroyed by the Blueprint code

Public function Virtual

bool

 

ShouldExport()

Called before editor copy, true allow export

Public function Virtual

bool

 

ShouldImport

(
    FString* ActorPropString,
    bool IsMovingLevel
)

Called before editor paste, true allow import

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

PostDuplicate

(
    bool bDuplicateForPIE
)

Called after duplication & serialization and before PostLoad.

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

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

Public function Virtual

void

 

PreEditUndo()

Called before applying a transaction to the object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from ISMInstanceManagerProvider

Name Description

Protected function Virtual

ISMInstanceM...

 

GetSMInstanceManager

(
    const FSMInstanceId& InstanceId
)

Attempt to get the instance manager associated with the given static mesh instance, if any.

Classes

Name

Description

Public class

FOnFoliageTypeMeshChanged

Typedefs

Name

Description

FOnInstanceCoundChanged

FOnSelectionChanged

Delegate type for selection change events.

Constants