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

  • 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.

  • 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

  • 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.

  • 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] In World Partition map, will partition the component in a grid, according to PCGWorldActor settings, dispatching the generation to multiple local components.

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

  • 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

  • parse_actor_components (bool): [Read-Write]

  • 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!

  • seed (int32): [Read-Write]

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 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_trigger: PCGComponentGenerationTrigger

[Read-Only]

Type:

(PCGComponentGenerationTrigger)

get_generated_graph_output() PCGDataCollection

Retrieves generated data

Return type:

PCGDataCollection

property graph_instance: PCGGraphInstance

[Read-Only]

Type:

(PCGGraphInstance)

property input_type: PCGComponentInput

[Read-Write]

Type:

(PCGComponentInput)

property is_component_partitioned: bool

[Read-Write] In World Partition map, will partition the component in a grid, according to PCGWorldActor settings, dispatching the generation to multiple local components.

Type:

(bool)

notify_properties_changed_from_blueprint() None

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

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 seed: int

[Read-Write]

Type:

(int32)

set_graph(graph) None

Set Graph

Parameters:

graph (PCGGraphInterface) –