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]

  • metadata (PCGMetadata): [Read-Only] Not accessible through blueprint to make sure the constness is preserved

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

const_metadata() PCGMetadata

Const Metadata

Return type:

PCGMetadata

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

Initialize from Data

Parameters:
intersect_with(other) PCGIntersectionData

Returns a specialized data to intersect with another data

Parameters:

other (PCGSpatialData) –

Return type:

PCGIntersectionData

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

property keep_zero_density_points: bool

[Read-Write]

Type:

(bool)

mutable_metadata() PCGMetadata

Mutable Metadata

Return type:

PCGMetadata

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

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) PCGDifferenceData

Subtract

Parameters:

other (PCGSpatialData) –

Return type:

PCGDifferenceData

property target_actor: Actor

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

Type:

(Actor)

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)

To Point Data with Context

Parameters:

context (PCGContext) –

Returns:

context (PCGContext):

Return type:

PCGContext

union_with(other) PCGUnionData

Returns a specialized data to union this with another data

Parameters:

other (PCGSpatialData) –

Return type:

PCGUnionData