unreal.PCGComponent

class unreal.PCGComponent(outer: Object | None = None, name: Name | str = 'None')

Bases: ActorComponent

C++ Source:

  • Plugin: PCG

  • Module: PCG

  • File: PCGComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • activated (bool): [Read-Write]

  • asset_user_data (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

  • asset_user_data_editor_only (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.

  • can_ever_affect_navigation (bool): [Read-Write] Whether this component can potentially influence navigation

  • component_tags (Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • current_editing_mode (PCGEditorDirtyMode): [Read-Write] Current editing mode that depends on the serialized editing mode and loading. If the component is set to GenerateAtRuntime, this will behave as Preview.

  • dirty_generated (bool): [Read-Only]

  • editable_when_inherited (bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor class

  • generate_on_drop_when_trigger_on_demand (bool): [Read-Write] When Generation Trigger is OnDemand, we can still force the component to generate on drop.

  • generated (bool): [Read-Only] Flag to indicate whether this component has run in the editor. Note that for partitionable actors, this will always be false.

  • generated_graph_output (PCGDataCollection): [Read-Only]

  • generation_grid_size (uint32): [Read-Only]

  • generation_in_progress (bool): [Read-Only]

  • generation_radii (PCGRuntimeGenerationRadii): [Read-Write]

  • generation_trigger (PCGComponentGenerationTrigger): [Read-Write]

  • graph_instance (PCGGraphInstance): [Read-Only]

  • input_type (PCGComponentInput): [Read-Write]

  • is_component_local (bool): [Read-Only]

  • is_component_partitioned (bool): [Read-Write] Will partition the component in a grid, dispatching the generation to multiple local components. Grid size is determined by the PCGWorldActor unless the graph has Hierarchical Generation enabled, in which case grid sizes are determined by the graph.

  • is_editor_only (bool): [Read-Write] If true, the component will be excluded from non-editor builds

  • last_generated_bounds (Box): [Read-Only]

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivated

  • on_pcg_graph_cancelled_external (OnPCGGraphCancelledExternal): [Read-Write] Event dispatched when a graph cancels generation on this component.

  • on_pcg_graph_cleaned_external (OnPCGGraphCleanedExternal): [Read-Write] Event dispatched when a graph cleans on this component.

  • on_pcg_graph_generated_external (OnPCGGraphGeneratedExternal): [Read-Write] Event dispatched when a graph completes its generation on this component.

  • on_pcg_graph_start_generating_external (OnPCGGraphStartGeneratingExternal): [Read-Write] Event dispatched when a graph begins generation on this component.

  • only_track_itself (bool): [Read-Write] Even if the graph has external dependencies, the component won’t react to them.

  • override_generation_radii (bool): [Read-Write] Manual overrides for the graph generation radii and cleanup radius multiplier.

  • parse_actor_components (bool): [Read-Write]

  • per_pin_generated_output (Map[str, PCGDataCollection]): [Read-Only] If any graph edges cross execution grid sizes, data on the edge is stored / retrieved from this map.

  • post_generate_function_names (Array[Name]): [Read-Write] Can specify a list of functions from the owner of this component to be called when generation is done, in order.

    Need to take (and only take) a PCGDataCollection as parameter and with “CallInEditor” flag enabled.

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Main tick function for the Component

  • regenerate_in_editor (bool): [Read-Write]

  • replicate_using_registered_sub_object_list (bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.

  • replicates (bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

  • scheduling_policy (PCGSchedulingPolicyBase): [Read-Only] This is the instanced UPCGSchedulingPolicy object which holds scheduling parameters and calculates priorities.

  • scheduling_policy_class (type(Class)): [Read-Write] A Scheduling Policy dictates the order in which instances of this component will be scheduled.

  • seed (int32): [Read-Write]

  • serialized_editing_mode (PCGEditorDirtyMode): [Read-Only]

property activated: bool

[Read-Write]

Type:

(bool)

add_to_managed_resources(resource) None

Registers some managed resource to the current component

Parameters:

resource (PCGManagedResource) –

cleanup(remove_components, save=False) None

Networked cleanup call

Parameters:
  • remove_components (bool) –

  • save (bool) –

cleanup_local(remove_components, save=False) None

Cleans up the generation from a local (vs. remote) standpoint. Will not be replicated. Will be delayed.

Parameters:
  • remove_components (bool) –

  • save (bool) –

Move all generated resources under a new actor, following a template (AActor if not provided), clearing all link to this PCG component. Returns the new actor.

Parameters:

template_actor (type(Class)) –

Return type:

Actor

property dirty_generated: bool

[Read-Only]

Type:

(bool)

generate(force) None

Networked generation call that also activates the component as needed

Parameters:

force (bool) –

generate_local(force) None

Starts generation from a local (vs. remote) standpoint. Will not be replicated. Will be delayed.

Parameters:

force (bool) –

property generate_on_drop_when_trigger_on_demand: bool

[Read-Only] When Generation Trigger is OnDemand, we can still force the component to generate on drop.

Type:

(bool)

property generated: bool

[Read-Only] Flag to indicate whether this component has run in the editor. Note that for partitionable actors, this will always be false.

Type:

(bool)

property generation_radii: PCGRuntimeGenerationRadii

[Read-Write]

Type:

(PCGRuntimeGenerationRadii)

property generation_trigger: PCGComponentGenerationTrigger

[Read-Only]

Type:

(PCGComponentGenerationTrigger)

get_editing_mode() PCGEditorDirtyMode

Returns the current editing mode

Return type:

PCGEditorDirtyMode

get_generated_graph_output() PCGDataCollection

Retrieves generated data

Return type:

PCGDataCollection

get_serialized_editing_mode() PCGEditorDirtyMode

Get Serialized Editing Mode

Return type:

PCGEditorDirtyMode

property graph_instance: PCGGraphInstance

[Read-Only]

Type:

(PCGGraphInstance)

property input_type: PCGComponentInput

[Read-Write]

Type:

(PCGComponentInput)

property is_component_partitioned: bool

[Read-Write] Will partition the component in a grid, dispatching the generation to multiple local components. Grid size is determined by the PCGWorldActor unless the graph has Hierarchical Generation enabled, in which case grid sizes are determined by the graph.

Type:

(bool)

notify_properties_changed_from_blueprint() None

Notify properties changed, used in runtime cases, will dirty & trigger a regeneration if needed

property on_pcg_graph_cancelled_external: OnPCGGraphCancelledExternal

[Read-Write] Event dispatched when a graph cancels generation on this component.

Type:

(OnPCGGraphCancelledExternal)

property on_pcg_graph_cleaned_external: OnPCGGraphCleanedExternal

[Read-Write] Event dispatched when a graph cleans on this component.

Type:

(OnPCGGraphCleanedExternal)

property on_pcg_graph_generated_external: OnPCGGraphGeneratedExternal

[Read-Write] Event dispatched when a graph completes its generation on this component.

Type:

(OnPCGGraphGeneratedExternal)

property on_pcg_graph_start_generating_external: OnPCGGraphStartGeneratingExternal

[Read-Write] Event dispatched when a graph begins generation on this component.

Type:

(OnPCGGraphStartGeneratingExternal)

property only_track_itself: bool

[Read-Write] Even if the graph has external dependencies, the component won’t react to them.

Type:

(bool)

property override_generation_radii: bool

[Read-Write] Manual overrides for the graph generation radii and cleanup radius multiplier.

Type:

(bool)

property parse_actor_components: bool

[Read-Write]

Type:

(bool)

property post_generate_function_names: None

[Read-Write] Can specify a list of functions from the owner of this component to be called when generation is done, in order. Need to take (and only take) a PCGDataCollection as parameter and with “CallInEditor” flag enabled.

Type:

(Array[Name])

property regenerate_in_editor: bool

[Read-Write]

Type:

(bool)

property scheduling_policy: PCGSchedulingPolicyBase

[Read-Only] This is the instanced UPCGSchedulingPolicy object which holds scheduling parameters and calculates priorities.

Type:

(PCGSchedulingPolicyBase)

property scheduling_policy_class: Class

[Read-Only] A Scheduling Policy dictates the order in which instances of this component will be scheduled.

Type:

(type(Class))

property seed: int

[Read-Write]

Type:

(int32)

set_editing_mode(editing_mode, serialized_editing_mode) None

Set Editing Mode

Parameters:
set_graph(graph) None

Set Graph

Parameters:

graph (PCGGraphInterface) –