Navigation
API > API/Plugins > API/Plugins/PCG
| Name | UPCGComponent |
| Type | class |
| Header File | /Engine/Plugins/PCG/Source/PCG/Public/PCGComponent.h |
| Include Path | #include "PCGComponent.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, ClassGroup=(Procedural),
Meta=(BlueprintSpawnableComponent, prioritizeCategories="PCG"))
class UPCGComponent :
public UActorComponent ,
public IPCGGraphExecutionSource
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → UPCGComponent
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPCGComponent
(
const FObjectInitializer& InObjectInitializer |
PCGComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bActivated | bool | PCGComponent.h |
|
|
| bDirtyGenerated | bool | PCGComponent.h |
|
|
| bForceGenerateOnBPAddedToWorld | bool | Property that will automatically be set on BP templates, to allow for "Generate on add to world" in editor. | PCGComponent.h | |
| bGenerated | bool | Flag to indicate whether this component has run in the editor. | PCGComponent.h |
|
| bGenerateOnDropWhenTriggerOnDemand | bool | When Generation Trigger is OnDemand, we can still force the component to generate on drop. | PCGComponent.h |
|
| bIgnoreLandscapeTracking | bool | Marks the component to be not refreshed automatically when the landscape changes, even if it is used. | PCGComponent.h |
|
| bIsComponentPartitioned | bool | Will partition the component in a grid, dispatching the generation to multiple local components. | PCGComponent.h |
|
| bOnlyTrackItself | bool | Even if the graph has external dependencies, the component won't react to them. | PCGComponent.h |
|
| bOverrideGenerationRadii | bool | Manual overrides for the graph generation radii and cleanup radius multiplier. | PCGComponent.h |
|
| bParseActorComponents | bool | PCGComponent.h |
|
|
| bRegenerateInEditor | bool | PCGComponent.h |
|
|
| bRuntimeGenerated | bool | PCGComponent.h |
|
|
| ExtraCapture | PCGUtils::FExtraCapture | PCGComponent.h | ||
| GenerationRadii | FPCGRuntimeGenerationRadii | PCGComponent.h |
|
|
| GenerationTrigger | EPCGComponentGenerationTrigger | PCGComponent.h |
|
|
| InputType | EPCGComponentInput | PCGComponent.h |
|
|
| OnPCGGraphCancelledDelegate | FOnPCGGraphCancelled | PCGComponent.h | ||
| OnPCGGraphCancelledExternal | FOnPCGGraphCancelledExternal | Event dispatched when a graph cancels generation on this component. | PCGComponent.h |
|
| OnPCGGraphCleanedDelegate | FOnPCGGraphCleaned | PCGComponent.h | ||
| OnPCGGraphCleanedExternal | FOnPCGGraphCleanedExternal | Event dispatched when a graph cleans on this component. | PCGComponent.h |
|
| OnPCGGraphGeneratedDelegate | FOnPCGGraphGenerated | PCGComponent.h | ||
| OnPCGGraphGeneratedExternal | FOnPCGGraphGeneratedExternal | Event dispatched when a graph completes its generation on this component. | PCGComponent.h |
|
| OnPCGGraphStartGeneratingDelegate | FOnPCGGraphStartGenerating | PCGComponent.h | ||
| OnPCGGraphStartGeneratingExternal | FOnPCGGraphStartGeneratingExternal | Event dispatched when a graph begins generation on this component. | PCGComponent.h |
|
| PostGenerateFunctionNames | TArray< FName > | Can specify a list of functions from the owner of this component to be called when generation is done, in order. | PCGComponent.h |
|
| SchedulingPolicy | TObjectPtr< UPCGSchedulingPolicyBase > | This is the instanced UPCGSchedulingPolicy object which holds scheduling parameters and calculates priorities. | PCGComponent.h |
|
| SchedulingPolicyClass | TSubclassOf< UPCGSchedulingPolicyBase > | A Scheduling Policy dictates the order in which instances of this component will be scheduled. | PCGComponent.h |
|
| Seed | int | PCGComponent.h |
|
|
| Timer | PCGUtils::FCallTime | PCGComponent.h | ||
| ToolDataContainer | FPCGInteractiveToolDataContainer | This stores working data of a tool; runtime property as the PCG Component will rely on the tool's working data to generate properly. | PCGComponent.h |
|
| TrackingPriority | double | Tracking priority used to solve tracking dependencies between PCG Components. | PCGComponent.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bDisableIsComponentPartitionedOnLoad | bool | Track if component should disable 'bIsComponentPartitioned'. | PCGComponent.h | |
| bGenerationInProgress | bool | PCGComponent.h |
|
|
| bIsComponentLocal | bool | PCGComponent.h |
|
|
| bProceduralInstancesInUse | bool | Whether procedural ISM components were used/generated in the last execution. | PCGComponent.h | |
| bUnregisteredThroughLoading | bool | Track if component was unregistered while in a loading scope. | PCGComponent.h | |
| bWasGeneratedThisSession | bool | PCGComponent.h | ||
| CachedActorData | TObjectPtr< UPCGData > | PCGComponent.h |
|
|
| CachedInputData | TObjectPtr< UPCGData > | PCGComponent.h |
|
|
| CachedLandscapeData | TObjectPtr< UPCGData > | PCGComponent.h |
|
|
| CachedLandscapeHeightData | TObjectPtr< UPCGData > | PCGComponent.h |
|
|
| CachedPCGData | TObjectPtr< UPCGData > | PCGComponent.h |
|
|
| CurrentCleanupTask | FPCGTaskId | PCGComponent.h | ||
| CurrentExecutionDynamicTracking | FPCGSelectionKeyToSettingsMap | Temporary storage for dynamic tracking that will be filled during component execution. | PCGComponent.h | |
| CurrentExecutionDynamicTrackingLock | FTransactionallySafeCriticalSection | PCGComponent.h | ||
| CurrentExecutionDynamicTrackingSettings | TSet< const UPCGSettings * > | Temporary storage for dynamic tracking that will keep all settings that could have dynamic tracking, in order to detect changes. | PCGComponent.h | |
| CurrentGenerationTask | FPCGTaskId | PCGComponent.h | ||
| CurrentRefreshTask | FPCGTaskId | PCGComponent.h | ||
| DynamicallyTrackedKeysToSettings | FPCGSelectionKeyToSettingsMap | Need to keep a reference to all tracked settings to still react to changes after a map load (since the component won't have been executed). | PCGComponent.h | |
| ExecutionInspection | FPCGGraphExecutionInspection | PCGComponent.h | ||
| ExecutionState | FPCGComponentExecutionState | PCGComponent.h | ||
| GeneratedGraphOutput | FPCGDataCollection | PCGComponent.h |
|
|
| GeneratedResources | TArray< TObjectPtr< UPCGManagedResource > > | NOTE: This should not be made visible or editable because it will change the way the BP actors are duplicated/setup and might trigger an ensure in the resources. | PCGComponent.h | |
| GeneratedResourcesInaccessible | bool | When doing a cleanup, locking resource modification. Used as sentinel. | PCGComponent.h | |
| GeneratedResourcesLock | FTransactionallySafeCriticalSection | PCGComponent.h | ||
| IgnoredChangeOriginsLock | FTransactionallySafeRWLock | PCGComponent.h | ||
| IgnoredChangeOriginsToCounters | TMap< TObjectKey< UObject >, int32 > | The tracking system will not trigger a generation on this component for these change origins. | PCGComponent.h | |
| LastGeneratedBounds | FBox | PCGComponent.h |
|
|
| LastGeneratedBoundsPriorToUndo | FBox | PCGComponent.h | ||
| LoadedPreviewGeneratedGraphOutput | FPCGDataCollection | PCGComponent.h |
|
|
| LoadedPreviewResources | TArray< TObjectPtr< UPCGManagedResource > > | PCGComponent.h |
|
|
| PerPinGeneratedOutput | TMap< FString, FPCGDataCollection > | If any graph edges cross execution grid sizes, data on the edge is stored / retrieved from this map. | PCGComponent.h |
|
| PerPinGeneratedOutputLock | FTransactionallySafeRWLock | PCGComponent.h | ||
| RuntimeGridDescriptorHash | uint32 | PCGComponent.h | ||
| StaticallyTrackedKeysToSettings | FPCGSelectionKeyToSettingsMap | PCGComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddActorsToManagedResources
(
const TArray< AActor* >& InActors |
Creates a managed actors resource and adds it to the current component. | PCGComponent.h |
|
void AddComponentsToManagedResources
(
const TArray< UActorComponent* >& InComponents |
Creates a managed component resource and adds it to the current component. | PCGComponent.h |
|
void AddToManagedResources
(
UPCGManagedResource* InResource |
Registers some managed resource to the current component | PCGComponent.h |
|
bool AreManagedResourcesAccessible() |
PCGComponent.h | ||
bool AreProceduralInstancesInUse() |
Whether this component created one or more procedural ISM components when last generated. | PCGComponent.h | |
void CancelGeneration() |
Cancels in-progress generation | PCGComponent.h | |
bool CanPartition() |
PCGComponent.h | ||
void ChangeTransientState
(
EPCGEditorDirtyMode NewEditingMode |
Changes the transient state (preview, normal, load on preview) - public only because it needs to be accessed by APCGPartitionActor | PCGComponent.h | |
void Cleanup
(
bool bRemoveComponents |
Networked cleanup call | PCGComponent.h |
|
void Cleanup () |
PCGComponent.h | ||
void CleanupLocal
(
bool bRemoveComponents, |
PCGComponent.h | ||
void CleanupLocal
(
bool bRemoveComponents, |
PCGComponent.h | ||
FPCGTaskId CleanupLocal
(
bool bRemoveComponents, |
PCGComponent.h | ||
void CleanupLocal
(
bool bRemoveComponents |
Cleans up the generation from a local (vs. remote) standpoint. | PCGComponent.h |
|
void CleanupLocalDeleteAllGeneratedObjects
(
const TArray< FPCGTaskId >& Dependencies |
Cleanup the generation while purging Actors and Components tagged as generated by PCG but are no longer managed by this or any other actor | PCGComponent.h | |
void CleanupLocalImmediate
(
bool bRemoveComponents, |
Same as CleanupLocal, but without any delayed tasks. | PCGComponent.h | |
void ClearInspectionData
(
bool bClearPerNodeExecutionData |
PCGComponent.h | ||
AActor * ClearPCGLink
(
UClass* TemplateActor |
Move all generated resources under a new actor, following a template (AActor if not provided), clearing all link to this PCG component. | PCGComponent.h |
|
void ClearPerPinGeneratedOutput() |
Clear any data stored for any pins. | PCGComponent.h | |
void DirtyGenerated
(
EPCGComponentDirtyFlag DataToDirtyFlag, |
Dirty generated data depending on the flag. | PCGComponent.h | |
void DisableInspection() |
PCGComponent.h | ||
bool DoesGridDependOnWorldStreaming
(
uint32 InGridSize |
PCGComponent.h | ||
void EnableInspection() |
PCGComponent.h | ||
void ForEachConstManagedResource
(
TFunctionRef< void(const UPCGManagedResource*)> InFunction |
PCGComponent.h | ||
void ForEachManagedResource
(
TFunctionRef< void(UPCGManagedResource*)> InFunction |
PCGComponent.h | ||
void Generate () |
PCGComponent.h | ||
void Generate
(
bool bForce |
Networked generation call that also activates the component as needed | PCGComponent.h |
|
void GenerateLocal
(
EPCGComponentGenerationTrigger RequestedGenerationTrigger, |
Requests the component to generate only on the specified grid level (all grid levels if EPCGHiGenGrid::Uninitialized). | PCGComponent.h | |
void GenerateLocal
(
bool bForce |
Starts generation from a local (vs. remote) standpoint. Will not be replicated. Will be delayed. | PCGComponent.h |
|
FPCGTaskId GenerateLocalGetTaskId
(
bool bForce |
PCGComponent.h | ||
FPCGTaskId GenerateLocalGetTaskId
(
EPCGComponentGenerationTrigger RequestedGenerationTrigger, |
PCGComponent.h | ||
FPCGTaskId GenerateLocalGetTaskId
(
EPCGComponentGenerationTrigger RequestedGenerationTrigger, |
PCGComponent.h | ||
UPCGData * GetActorPCGData() |
PCGComponent.h | ||
double GetCleanupRadiusFromGrid
(
EPCGHiGenGrid Grid |
Compute the runtime cleanup radius for the given grid size. | PCGComponent.h | |
const UPCGComponent * GetConstOriginalComponent() |
PCGComponent.h | ||
EPCGEditorDirtyMode GetEditingMode() |
Returns the current editing mode | PCGComponent.h |
|
PRAGMA_DISABLE_DEPRECATION_WARNINGSTMap< TObjectKey< const UPCGNode >, TSet< NodeExecutedNotificationData > > GetExecutedNodeStacks() |
PCGComponent.h | ||
const FPCGDataCollection & GetGeneratedGraphOutput() |
Retrieves generated data | PCGComponent.h |
|
EPCGHiGenGrid GetGenerationGrid() |
PCGComponent.h | ||
uint32 GetGenerationGridSize() |
PCGComponent.h | ||
const FPCGRuntimeGenerationRadii & GetGenerationRadii() |
Get the generation radii that are currently active for this component. | PCGComponent.h | |
double GetGenerationRadiusFromGrid
(
EPCGHiGenGrid Grid |
Get the runtime generation radius for the given grid size. | PCGComponent.h | |
FPCGTaskId GetGenerationTaskId() |
Returns task ids to do internal chaining | PCGComponent.h | |
UPCGGraph * GetGraph() |
PCGComponent.h | ||
UPCGGraphInstance * GetGraphInstance() |
PCGComponent.h | ||
FBox GetGridBounds () |
PCGComponent.h | ||
FPCGGridDescriptor GetGridDescriptor
(
uint32 GridSize |
Returns a GridDescriptor based on this component for the specified grid size | PCGComponent.h | |
UPCGData * GetInputPCGData() |
PCGComponent.h | ||
const FPCGDataCollection * GetInspectionData
(
const FPCGStack& InStack |
PCGComponent.h | ||
UPCGData * GetLandscapeHeightPCGData() |
PCGComponent.h | ||
UPCGData * GetLandscapePCGData() |
PCGComponent.h | ||
FBox GetLastGeneratedBounds() |
PCGComponent.h | ||
FBox GetLocalSpaceBounds() |
PCGComponent.h | ||
| Retrieve the inactive pin bitmask for the given node and stack in the last execution. | PCGComponent.h | ||
UPCGData * GetOriginalActorPCGData() |
PCGComponent.h | ||
UPCGComponent * GetOriginalComponent() |
If this is a local component returns the original component, otherwise returns self. | PCGComponent.h | |
FBox GetOriginalGridBounds() |
PCGComponent.h | ||
FBox GetOriginalLocalSpaceBounds() |
PCGComponent.h | ||
UPCGData * GetPCGData() |
PCGComponent.h | ||
UPCGSchedulingPolicyBase * GetRuntimeGenSchedulingPolicy() |
PCGComponent.h | ||
EPCGEditorDirtyMode GetSerializedEditingMode() |
PCGComponent.h |
|
|
bool GetStackContext
(
FPCGStackContext& OutStackContext |
Get execution stack information. | PCGComponent.h | |
UPCGSubsystem * GetSubsystem() |
PCGComponent.h | ||
| Did the given node produce one or more data items in the given stack during the last execution. | PCGComponent.h | ||
void IgnoreChangeOriginDuringGenerationWithScope
(
const UObject* InChangeOriginToIgnore, |
PCGComponent.h | ||
void IgnoreChangeOriginsDuringGenerationWithScope
(
const TArrayView< const UObject* > InChangeOriginsToIgnore, |
Allow for the function to be defined outside of editor, so it's lighter at the calling site and will just call the InFunc. | PCGComponent.h | |
bool IsAnyObjectManagedByResource
(
const TArrayView< const UObject* > InObjects |
Will scan the managed resources to check if any resource manage one of the objects. | PCGComponent.h | |
bool IsCleaningUp() |
PCGComponent.h | ||
bool IsGenerating() |
Return if we are currently generating the graph for this component | PCGComponent.h | |
bool IsGenerationInProgress() |
PCGComponent.h | ||
bool IsIgnoringAnyChangeOrigins
(
const TArrayView< const UObject* > InChangeOrigins, |
PCGComponent.h | ||
bool IsIgnoringChangeOrigin
(
const UObject* InChangeOrigin |
PCGComponent.h | ||
bool IsInPreviewMode() |
Returns whether the component (or resources) should be marked as dirty following interaction/refresh based on the current editing mode | PCGComponent.h | |
bool IsInspecting() |
PCGComponent.h | ||
bool IsLocalComponent() |
PCGComponent.h | ||
bool IsManagedByRuntimeGenSystem () |
Returns true if the component is managed by the runtime generation system. | PCGComponent.h | |
bool IsObjectTracked
(
const UObject* InObject, |
PCGComponent.h | ||
bool IsPartitioned() |
PCGComponent.h | ||
bool IsRefreshInProgress() |
Returns current refresh task ID. | PCGComponent.h | |
void MarkAsLocalComponent() |
Responsibility of the PCG Partition Actor to mark is local | PCGComponent.h | |
| Whether the given node was culled by a dynamic branch in the given stack. | PCGComponent.h | ||
void NotifyNodeExecuted
(
const UPCGNode* InNode, |
PCGComponent.h | ||
void NotifyProceduralInstancesInUse() |
Called during execution if one or more procedural ISM components are in use. | PCGComponent.h | |
void NotifyPropertiesChangedFromBlueprint() |
Notify properties changed, used in runtime cases, will dirty & trigger a regeneration if needed | PCGComponent.h |
|
void OnRefresh
(
bool bForceRefresh |
PCGComponent.h | ||
void Refresh
(
EPCGChangeType ChangeType, |
Schedules refresh of the component. | PCGComponent.h | |
void RegisterDynamicTracking
(
const FPCGSelectionKeyToSettingsMap& InKeysToSettings |
To be called to notify the component that this list of keys have a dynamic dependency. | PCGComponent.h | |
void RegisterDynamicTracking
(
const UPCGSettings* InSettings, |
To be called by an element to notify the component that this settings have a dynamic dependency. | PCGComponent.h | |
void ResetIgnoredChangeOrigins
(
bool bLogIfAnyPresent |
PCGComponent.h | ||
void ResetLastGeneratedBounds() |
Reset last generated bounds to force PCGPartitionActor creation on next refresh | PCGComponent.h | |
const FPCGDataCollection * RetrieveOutputDataForPin
(
const FString& InResourceKey |
Lookup data using a resource key that identifies the pin. | PCGComponent.h | |
void SetEditingMode
(
EPCGEditorDirtyMode InEditingMode, |
PCGComponent.h |
|
|
void SetGenerationGridSize
(
uint32 InGenerationGridSize |
PCGComponent.h | ||
void SetGraph
(
UPCGGraphInterface* InGraph |
PCGComponent.h |
|
|
void SetGraphLocal
(
UPCGGraphInterface* InGraph |
PCGComponent.h | ||
void SetIsPartitioned
(
bool bIsNowPartitioned |
Utility function (mostly for tests) to properly set the value of bIsComponentPartitioned. | PCGComponent.h | |
void SetPropertiesFromOriginal
(
const UPCGComponent* Original |
Updates internal properties from other component, dirties as required but does not trigger Refresh | PCGComponent.h | |
void SetSchedulingPolicyClass
(
TSubclassOf< UPCGSchedulingPolicyBase > InSchedulingPolicyClass |
Set the runtime generation scheduling policy type. | PCGComponent.h | |
bool ShouldGenerateBPPCGAddedToWorld() |
Know if we need to force a generation, in case of BP added to the world in editor | PCGComponent.h | |
void StartGenerationInProgress() |
PCGComponent.h | ||
void StartIgnoringChangeOriginDuringGeneration
(
const UObject* InChangeOriginToIgnore |
For duration of the current/next generation, any change triggers from this change origin will be discarded. | PCGComponent.h | |
void StartIgnoringChangeOriginsDuringGeneration
(
const TArrayView< const UObject* > InChangeOriginsToIgnore |
PCGComponent.h | ||
void StopGenerationInProgress() |
PCGComponent.h | ||
void StopIgnoringChangeOriginDuringGeneration
(
const UObject* InChangeOriginToIgnore |
PCGComponent.h | ||
void StopIgnoringChangeOriginsDuringGeneration
(
const TArrayView< const UObject* > InChangeOriginsToIgnore |
PCGComponent.h | ||
void StoreInspectionData
(
const FPCGStack* InStack, |
PCGComponent.h | ||
void StoreOutputDataForPin
(
const FString& InResourceKey, |
Store data with a resource key that identifies the pin. | PCGComponent.h | |
bool Use2DGrid() |
Returns true if component should output on a 2D Grid | PCGComponent.h | |
bool WasGeneratedThisSession() |
Functions for managing the node inspection cache | PCGComponent.h | |
| PCGComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginPlay() |
~End UObject interface | PCGComponent.h | |
virtual void EndPlay
(
const EEndPlayReason::Type EndPlayReason |
PCGComponent.h | ||
virtual void OnComponentDestroyed
(
bool bDestroyingHierarchy |
PCGComponent.h | ||
virtual void OnRegister() |
PCGComponent.h | ||
virtual void OnUnregister() |
PCGComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
PCGComponent.h | ||
virtual bool CanEditChange
(
const FProperty* InProperty |
PCGComponent.h | ||
virtual bool IsEditorOnly() |
PCGComponent.h | ||
virtual void PostEditImport() |
PCGComponent.h | ||
virtual void PostInitProperties() |
PCGComponent.h | ||
virtual void PostLoad() |
PCGComponent.h | ||
virtual void PreSave
(
FObjectPreSaveContext ObjectSaveContext |
PCGComponent.h | ||
virtual void Serialize
(
FArchive& Ar |
~End IPCGGraphExecutionSource interface ~Begin UObject interface | PCGComponent.h |
Overridden from IPCGGraphExecutionSource
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual IPCGGraphExecutionState & GetExecutionState () |
~Begin IPCGGraphExecutionSource interface | PCGComponent.h | |
virtual const IPCGGraphExecutionState & GetExecutionState () |
PCGComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FPCGGridDescriptor GetGridDescriptorInternal
(
uint32 GridSize, |
PCGComponent.h | ||
void MarkSubObjectsAsGarbage() |
PCGComponent.h | ||
void RefreshSchedulingPolicy() |
PCGComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TStructOnScope< FActorComponentInstanceData > GetComponentInstanceData() |
PCGComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddReferencedObjects
(
UObject* InThis, |
PCGComponent.h | ||
static UPCGData * CreateActorPCGData
(
AActor* Actor, |
Builds the canonical PCG data from a given actor and its PCG component if any. | PCGComponent.h | |
static FPCGDataCollection CreateActorPCGDataCollection
(
AActor* Actor, |
Builds the PCG data from a given actor and its PCG component, and places it in a data collection with appropriate tags | PCGComponent.h | |
static TArray< TSoftObjectPtr< AActor > > GetManagedActorPaths
(
AActor* InActor |
PCGComponent.h | ||
static void PurgeUnlinkedResources
(
const AActor* InActor |
Purges Actors and Components generated by PCG but are no longer managed by any PCG Component | PCGComponent.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Graph_DEPRECATED | TObjectPtr< UPCGGraph > | PCGComponent.h |