unreal.PCGBlueprintElement

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

Bases: Object

PCGBlueprint Element

C++ Source:

  • Plugin: PCG

  • Module: PCG

  • File: PCGExecuteBlueprint.h

Editor Properties: (see get_editor_property/set_editor_property)

  • category (Text): [Read-Write]

  • compute_full_data_crc (bool): [Read-Write] In cases where your node is non-cacheable but is likely to yield the same results on subsequent executions, this controls whether we will do a deep & computationally intensive CRC computation (true), which will allow cache usage in downstream nodes in your graph, or, by default (false), a shallow but quick crc computation which will not be cache-friendly.

  • custom_input_pins (Array[PCGPinProperties]): [Read-Write]

  • custom_output_pins (Array[PCGPinProperties]): [Read-Write]

  • dependency_parsing_depth (int32): [Read-Write]

  • description (Text): [Read-Write]

  • enable_preconfigured_settings (bool): [Read-Write]

  • expose_to_library (bool): [Read-Write]

  • has_default_in_pin (bool): [Read-Write]

  • has_default_out_pin (bool): [Read-Write]

  • input_pin_labels (Set[Name]): [Read-Write] deprecated: Property ‘InputPinLabels’ is deprecated.

  • is_cacheable (bool): [Read-Write] Controls whether results can be cached so we can bypass execution if the inputs & settings are the same in a subsequent execution. If you have implemented the IsCacheableOverride function, then this value is ignored. Note that if your node relies on data that is not directly tracked by PCG or creates any kind of artifact (adds components, creates actors, etc.) then it should not be cacheable.

  • only_expose_preconfigured_settings (bool): [Read-Write]

  • output_pin_labels (Set[Name]): [Read-Write]

  • preconfigured_info (Array[PCGPreConfiguredSettingsInfo]): [Read-Write]

  • requires_game_thread (bool): [Read-Write] Controls whether this node execution can be run from a non-game thread. This is not related to the Loop functions provided/implemented in this class, which should always run on any thread.

apply_preconfigured_settings(preconfigure_info) None

Apply the preconfigured settings specified in the class default. Used to create nodes that are configured with pre-defined settings. Use InPreconfigureInfo index to know which settings it is.

Parameters:

preconfigure_info (PCGPreConfiguredSettingsInfo) –

property category: Text

[Read-Write]

Type:

(Text)

property compute_full_data_crc: bool

[Read-Write] In cases where your node is non-cacheable but is likely to yield the same results on subsequent executions, this controls whether we will do a deep & computationally intensive CRC computation (true), which will allow cache usage in downstream nodes in your graph, or, by default (false), a shallow but quick crc computation which will not be cache-friendly.

Type:

(bool)

custom_input_labels() Set[Name]

Returns the labels of custom input pins only

Return type:

Set[Name]

property custom_input_pins: None

[Read-Write]

Type:

(Array[PCGPinProperties])

custom_output_labels() Set[Name]

Returns the labels of custom output pins only

Return type:

Set[Name]

property custom_output_pins: None

[Read-Write]

Type:

(Array[PCGPinProperties])

property dependency_parsing_depth: int

[Read-Write]

Type:

(int32)

property description: Text

[Read-Write]

Type:

(Text)

property enable_preconfigured_settings: bool

[Read-Write]

Type:

(bool)

execute(input) PCGDataCollection

Main execution function that will contain the logic for this PCG Element. Use GetContext to have access to the context.

Parameters:

input (PCGDataCollection) – Input collection containing all the data passed as input to the node.

Returns:

output (PCGDataCollection): Data collection that will be passed as the output of the node, with pins matching the ones provided during the execution.

Return type:

PCGDataCollection

execute_with_context(context, input) -> (context=PCGContext, output=PCGDataCollection)

Main execution function that will contain the logic for this PCG Element, with the context as parameter.

Parameters:
  • context (PCGContext) – Context of the execution

  • input (PCGDataCollection) – Input collection containing all the data passed as input to the node.

Returns:

context (PCGContext): Context of the execution

output (PCGDataCollection): Data collection that will be passed as the output of the node, with pins matching the ones provided during the execution.

Return type:

tuple

property expose_to_library: bool

[Read-Write]

Type:

(bool)

get_context() PCGContext

Retrieves the execution context - note that this will not be valid outside of the Execute functions

Return type:

PCGContext

get_input_pin_by_label(pin_label) PCGPinProperties or None

Returns true if there is an input pin with the matching label. If found, will copy the pin properties in OutFoundPin

Parameters:

pin_label (Name) –

Returns:

out_found_pin (PCGPinProperties):

Return type:

PCGPinProperties or None

get_input_pins() Array[PCGPinProperties]

Get Input Pins

Return type:

Array[PCGPinProperties]

get_output_pin_by_label(pin_label) PCGPinProperties or None

Returns true if there is an output pin with the matching label. If found, will copy the pin properties in OutFoundPin

Parameters:

pin_label (Name) –

Returns:

out_found_pin (PCGPinProperties):

Return type:

PCGPinProperties or None

get_output_pins() Array[PCGPinProperties]

Get Output Pins

Return type:

Array[PCGPinProperties]

get_random_stream(context) -> (RandomStream, context=PCGContext)

Creates a random stream from the settings & source component

Parameters:

context (PCGContext) –

Returns:

context (PCGContext):

Return type:

PCGContext

get_seed(context) -> (int32, context=PCGContext)

Gets the seed from the associated settings & source component

Parameters:

context (PCGContext) –

Returns:

context (PCGContext):

Return type:

PCGContext

property has_default_in_pin: bool

[Read-Write]

Type:

(bool)

property has_default_out_pin: bool

[Read-Write]

Type:

(bool)

input_labels() None

deprecated: ‘input_labels’ was renamed to ‘custom_input_labels’.

property input_pin_labels: None

[Read-Only] deprecated: Property ‘InputPinLabels’ is deprecated.

Type:

(Set[Name])

property is_cacheable: bool

[Read-Write] Controls whether results can be cached so we can bypass execution if the inputs & settings are the same in a subsequent execution. If you have implemented the IsCacheableOverride function, then this value is ignored. Note that if your node relies on data that is not directly tracked by PCG or creates any kind of artifact (adds components, creates actors, etc.) then it should not be cacheable.

Type:

(bool)

is_cacheable_override() bool

Override for the IsCacheable node property when it depends on the settings in your node. If true, the node will be cached, if not it will always be executed.

Return type:

bool

iteration_loop(context, num_iterations, optional_a=None, optional_b=None, optional_out_data=None) -> (context=PCGContext, out_data=PCGPointData)

Calls the IterationLoopBody a fixed number of times, optional parameters are used to potentially initialized the Out Data, but otherwise are used to remove the need to have variables

Parameters:
Returns:

context (PCGContext):

out_data (PCGPointData):

Return type:

tuple

iteration_loop_body(context, iteration, a, b, out_metadata) PCGPoint or None

Multi-threaded loop that will be called N number of times (defined by Iteration Loop parameter NumIterations). All points will be added in order (iteration 0 will be before iteration 1 in the final array).

Parameters:
  • context (PCGContext) – Context of the execution

  • iteration (int64) – Index of the current iteration. Must only be used to access input data, as this call is multi-threaded. It is not safe to access output data.

  • a (PCGSpatialData) – Optional input spatial data, can be null. Constant, must not be modified.

  • b (PCGSpatialData) – Optional input spatial data, can be null. Constant, must not be modified.

  • out_metadata (PCGMetadata) – Output metadata to write attribute to. Can be modified.

Returns:

True if the point should be kept, False if not.

out_point (PCGPoint): Point that will be added to the output data. Can be modified.

Return type:

PCGPoint or None

loop_n_times(context: PCGContext, num_iterations: int, optional_a: PCGSpatialData = Ellipsis, optional_b: PCGSpatialData = Ellipsis, optional_out_data: PCGPointData = Ellipsis) Tuple[PCGContext, PCGPointData]

deprecated: ‘loop_n_times’ was renamed to ‘iteration_loop’.

loop_on_point_pairs(context: PCGContext, outer_data: PCGPointData, inner_data: PCGPointData, optional_out_data: PCGPointData = Ellipsis) Tuple[PCGContext, PCGPointData]

deprecated: ‘loop_on_point_pairs’ was renamed to ‘nested_loop’.

loop_on_points(context: PCGContext, data: PCGPointData, optional_out_data: PCGPointData = Ellipsis) Tuple[PCGContext, PCGPointData]

deprecated: ‘loop_on_points’ was renamed to ‘point_loop’.

multi_loop_on_points(context: PCGContext, data: PCGPointData, optional_out_data: PCGPointData = Ellipsis) Tuple[PCGContext, PCGPointData]

deprecated: ‘multi_loop_on_points’ was renamed to ‘variable_loop’.

multi_point_loop_body(context: PCGContext, data: PCGPointData, point: PCGPoint, out_metadata: PCGMetadata, iteration: int) None

deprecated: ‘multi_point_loop_body’ was renamed to ‘variable_loop_body’.

nested_loop(context, outer_data, inner_data, optional_out_data=None) -> (context=PCGContext, out_data=PCGPointData)

Calls the NestedLoopBody function on all nested loop pairs (e.g. (o, i) for all o in Outer, i in Inner)

Parameters:
Returns:

context (PCGContext):

out_data (PCGPointData):

Return type:

tuple

nested_loop_body(context, outer_data, inner_data, outer_point, inner_point, out_metadata, outer_iteration, inner_iteration) PCGPoint or None

Multi-threaded loop that will iterate on all nested loop pairs (e.g. (o, i) for all o in Outer, i in Inner). All points will be added in the same order than in input (e.g: (0,0), (0,1), (0,2), …). Will be called by Nested Loop function.

Parameters:
  • context (PCGContext) – Context of the execution

  • outer_data (PCGPointData) – Outer point data. Constant, must not be modified.

  • inner_data (PCGPointData) – Inner point data. Constant, must not be modified.

  • outer_point (PCGPoint) – Outer Point for the current iteration. Constant, must not be modified.

  • inner_point (PCGPoint) – Inner Point for the current iteration. Constant, must not be modified.

  • out_metadata (PCGMetadata) – Output metadata to write attribute to. Can be modified.

  • outer_iteration (int64) – Index of the current point in outer data. Must only be used to access input data, as this call is multi-threaded. It is not safe to access output data.

  • inner_iteration (int64) – Index of the current point in inner data. Must only be used to access input data, as this call is multi-threaded. It is not safe to access output data.

Returns:

True if the point should be kept, False if not.

out_point (PCGPoint): Point that will be added to the output data. Can be modified.

Return type:

PCGPoint or None

node_color_override() LinearColor

Override for the default node color.

Return type:

LinearColor

node_title_override() Name

Override for the default node name

Return type:

Name

node_type_override() PCGSettingsType

Override to change the node type.

Return type:

PCGSettingsType

property only_expose_preconfigured_settings: bool

[Read-Write]

Type:

(bool)

output_labels() None

deprecated: ‘output_labels’ was renamed to ‘custom_output_labels’.

property output_pin_labels: None

[Read-Only]

Type:

(Set[Name])

point_loop(context, data, optional_out_data=None) -> (context=PCGContext, out_data=PCGPointData)

Calls the PointLoopBody function on all points

Parameters:
Returns:

context (PCGContext):

out_data (PCGPointData):

Return type:

tuple

point_loop_body(context, data, point, out_metadata, iteration) PCGPoint or None

Multi-threaded loop that will iterate on all points in InData. All points will be added in the same order than in input. Will be called by Point Loop function.

Parameters:
  • context (PCGContext) – Context of the execution

  • data (PCGPointData) – Input point data. Constant, must not be modified.

  • point (PCGPoint) – Point for the current iteration. Constant, must not be modified.

  • out_metadata (PCGMetadata) – Output metadata to write attribute to. Can be modified.

  • iteration (int64) – Index of the current point. Must only be used to access input data, as this call is multi-threaded. It is not safe to access output data.

Returns:

True if the point should be kept, False if not.

out_point (PCGPoint): Point that will be added to the output data. Can be modified.

Return type:

PCGPoint or None

point_pair_loop_body(context: PCGContext, outer_data: PCGPointData, inner_data: PCGPointData, outer_point: PCGPoint, inner_point: PCGPoint, out_metadata: PCGMetadata, outer_iteration: int, inner_iteration: int) PCGPoint | None

deprecated: ‘point_pair_loop_body’ was renamed to ‘nested_loop_body’.

property preconfigured_info: None

[Read-Write]

Type:

(Array[PCGPreConfiguredSettingsInfo])

property requires_game_thread: bool

[Read-Write] Controls whether this node execution can be run from a non-game thread. This is not related to the Loop functions provided/implemented in this class, which should always run on any thread.

Type:

(bool)

variable_loop(context, data, optional_out_data=None) -> (context=PCGContext, out_data=PCGPointData)

Calls the VariableLoopBody function on all points, each call can return a variable number of points

Parameters:
Returns:

context (PCGContext):

out_data (PCGPointData):

Return type:

tuple

variable_loop_body(context, data, point, out_metadata, iteration) Array[PCGPoint]

Multi-threaded loop that will be called on all points in InData. Can return a variable number of output points. All points will be added in the same order than in input. Will be called by Variable Loop function.

Parameters:
  • context (PCGContext) – Context of the execution

  • data (PCGPointData) – Input point data. Constant, must not be modified.

  • point (PCGPoint) – Point for the current iteration. Constant, must not be modified.

  • out_metadata (PCGMetadata) – Output metadata to write attribute to. Can be modified.

  • iteration (int64) – Index of the current point. Must only be used to access input data, as this call is multi-threaded. It is not safe to access output data.

Returns:

Array of new points that will be added to the output point data.

Return type:

Array[PCGPoint]