unreal.PCGSpatialData

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

Bases: PCGData

“Concrete” data base class for PCG generation This will be the base class for data classes that actually represent concrete evidence of spatial data - points, surfaces, splines, etc. In opposition to settings/control type of data.

Conceptually, any concrete data can be decayed into points (potentially through transformations) which hold metadata and a transform, and this is the basic currency of the PCG framework.

C++ Source:

  • Plugin: PCG

  • Module: PCG

  • File: PCGSpatialData.h

Editor Properties: (see get_editor_property/set_editor_property)

  • keep_zero_density_points (bool): [Read-Write]

  • target_actor (Actor): [Read-Write] Recipient of any artifacts generated using this data.

create_empty_metadata() PCGMetadata

Create Empty Metadata deprecated: The Create Empty Metadata function is not needed anymore - it can safely be removed

Return type:

PCGMetadata

get_bounds() Box

Returns the full bounds (including density fall-off) of the data

Return type:

Box

get_density_at_position(position) float

Computes the density at a given location

Parameters:

position (Vector)

Return type:

float

get_dimension() int32

Returns the dimension of the data type, which has nothing to do with the dimension of its points

Return type:

int32

get_normal() Vector

Returns the expected data normal (for surfaces) or eventual projection axis (for volumes)

Return type:

Vector

get_strict_bounds() Box

Returns the bounds in which the density is always 1

Return type:

Box

has_non_trivial_transform() bool

Returns true if the data has a non-trivial transform

Return type:

bool

initialize_from_data(source, metadata_parent_override=None, inherit_metadata=True, inherit_attributes=True) None

Prefer using InitializeFromDataWithParams instead. Note that InMetadataParentOverride is deprecated on the code side, and should not be used anymore.

Parameters:
initialize_from_data_with_params(params) None

Initialize from Data with Params

Parameters:

params (PCGInitializeFromDataParams)

intersect_with(other: PCGSpatialData) PCGIntersectionData

deprecated: ‘intersect_with’ was renamed to ‘k2_intersect_with’.

k2_intersect_with(other) PCGIntersectionData

Returns a specialized data to intersect with another data

Parameters:

other (PCGSpatialData)

Return type:

PCGIntersectionData

k2_project_on(other, params=[True, True, False, PCGProjectionColorBlendMode.SOURCE_VALUE, '', PCGMetadataFilterMode.EXCLUDE_ATTRIBUTES, PCGMetadataOp.TARGET_VALUE, PCGProjectionTagMergeMode.SOURCE]) PCGSpatialData

Returns a specialized data to project this on another data of equal or higher dimension. Returns copy of this data if projection fails.

Parameters:
Return type:

PCGSpatialData

k2_project_point(transform, bounds, params, out_metadata) PCGPoint or None

K2 Project Point

Parameters:
Returns:

out_point (PCGPoint):

Return type:

PCGPoint or None

k2_sample_point(transform, bounds, out_metadata) PCGPoint or None

Sample rotation, scale and other attributes from this data at the query position. Returns true if Transform location and Bounds overlaps this data.

Parameters:
Returns:

out_point (PCGPoint):

Return type:

PCGPoint or None

k2_subtract(other) PCGDifferenceData

K2 Subtract

Parameters:

other (PCGSpatialData)

Return type:

PCGDifferenceData

k2_union_with(other) PCGUnionData

Returns a specialized data to union this with another data

Parameters:

other (PCGSpatialData)

Return type:

PCGUnionData

property keep_zero_density_points: bool

[Read-Write]

Type:

(bool)

project_on(other: PCGSpatialData, params: PCGProjectionParams = Ellipsis) PCGSpatialData

deprecated: ‘project_on’ was renamed to ‘k2_project_on’.

project_point(transform: Transform, bounds: Box, params: PCGProjectionParams, out_metadata: PCGMetadata) PCGPoint | None

deprecated: ‘project_point’ was renamed to ‘k2_project_point’.

sample_point(transform: Transform, bounds: Box, out_metadata: PCGMetadata) PCGPoint | None

deprecated: ‘sample_point’ was renamed to ‘k2_sample_point’.

subtract(other: PCGSpatialData) PCGDifferenceData

deprecated: ‘subtract’ was renamed to ‘k2_subtract’.

property target_actor: Actor

[Read-Write] Recipient of any artifacts generated using this data.

Type:

(Actor)

to_base_point_data_with_context(context_handle) PCGBasePointData

To Base Point Data with Context

Parameters:

context_handle (PCGBlueprintContextHandle)

Return type:

PCGBasePointData

to_point_data() PCGPointData

Discretizes the data into points deprecated: The To Point Data function is deprecated - use To Point Data With Context instead.

Return type:

PCGPointData

to_point_data_with_context(context) -> (PCGPointData, context=PCGContext)

Prefer using ToBasePointDataWithContext

Parameters:

context (PCGContext)

Returns:

context (PCGContext):

Return type:

PCGContext

union_with(other: PCGSpatialData) PCGUnionData

deprecated: ‘union_with’ was renamed to ‘k2_union_with’.