unreal.WaveFunctionCollapseBPLibrary
¶
- class unreal.WaveFunctionCollapseBPLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibrary
Wave Function Collapse BPLibrary
C++ Source:
Plugin: WaveFunctionCollapse
Module: WaveFunctionCollapse
File: WaveFunctionCollapseBPLibrary.h
- classmethod add_to_adjacency_to_options_map(adjacency_to_options_map, adjacency, option) WaveFunctionCollapseAdjacencyToOptionsMap ¶
Add an entry to an AdjacencyToOptionsMap
- Parameters:
adjacency_to_options_map (WaveFunctionCollapseAdjacencyToOptionsMap) –
adjacency (WaveFunctionCollapseAdjacency) –
option (WaveFunctionCollapseOption) –
- Returns:
adjacency_to_options_map (WaveFunctionCollapseAdjacencyToOptionsMap):
- Return type:
- classmethod build_initial_tile(wfc_model) WaveFunctionCollapseTile ¶
Builds the initial tile which adds every unique option in a model to its RemainingOptions array and calculates its entropy
- Parameters:
wfc_model (WaveFunctionCollapseModel) – WaveFunctionCollapseModel
- Return type:
- classmethod calculate_shannon_entropy(options, wfc_model) float ¶
Calculates Shannon Entropy from an array of options and a given model
- Parameters:
options (Array[WaveFunctionCollapseOption]) – Array of options
wfc_model (WaveFunctionCollapseModel) – WaveFunctionCollapseModel that stores weights for options
- Return type:
- classmethod derive_model_from_actors(actors, wfc_model, tile_size, is_border_empty_option, is_min_z_floor_option, use_uniform_weight_distribution, auto_derive_z_axis_rotation_constraints, spawn_exclusion_assets, ignore_rotation_assets) None ¶
Derive constraints from a given layout of actors and append them to a model
- Parameters:
wfc_model (WaveFunctionCollapseModel) – to add constraints to
tile_size (float) – distance between tiles
is_border_empty_option (bool) – should the border be considered EmptyOption
is_min_z_floor_option (bool) – should the minimum Z actors be considered floor options (nothing can go below it)
use_uniform_weight_distribution (bool) –
auto_derive_z_axis_rotation_constraints (bool) – should it auto derive z-axis rotational variants
spawn_exclusion_assets (Array[SoftObjectPath]) – assets to exclude when spawning
ignore_rotation_assets (Array[SoftObjectPath]) – assets to ignore rotation variants
- classmethod get_adjacent_indices(index, resolution) Map[int32, WaveFunctionCollapseAdjacency] ¶
Get adjacent indices of a given index and its adjacency
- Parameters:
index (int32) – 2D array index
resolution (IntVector) –
- Returns:
Map of valid adjacent indices and its adjacency in relation to the given index
- Return type:
Map[int32, WaveFunctionCollapseAdjacency]
- classmethod get_adjacent_positions(position, resolution) Map[IntVector, WaveFunctionCollapseAdjacency] ¶
Get adjacent positions of a given position and its adjacency
- Parameters:
- Returns:
Map of valid adjacent positions and its adjacency in relation to the given position
- Return type:
- classmethod get_next_z_axis_clockwise_adjacency(adjacency) WaveFunctionCollapseAdjacency ¶
Get the next adjacency in clockwise direction on a Z-axis for a given adjacency. For example GetNextZAxisClockwiseAdjacency(Front) will return Right. Up or Down will return the original adjacency.
- Parameters:
adjacency (WaveFunctionCollapseAdjacency) – Adjacency direction
- Return type:
- classmethod get_opposite_adjacency(adjacency) WaveFunctionCollapseAdjacency ¶
Get the opposite adjacency for a given adjacency. For example GetOppositeAdjacency(Front) will return Back.
- Parameters:
adjacency (WaveFunctionCollapseAdjacency) – Adjacency direction
- Return type:
- classmethod get_position_to_option_map_from_actor(actor, tile_size, position_to_option_map) Map[IntVector, WaveFunctionCollapseOption] or None ¶
Get PositionToOptionsMap from a given actor that has ISM components. This is useful when you want to derive neighboring tile data from a WFC-solved actor to be used for post processing. This will only evaluate ISM components.
- Parameters:
actor (Actor) – Actor with ISM components
tile_size (float) – distance between tiles
position_to_option_map (Map[IntVector, WaveFunctionCollapseOption]) –
- Returns:
position_to_option_map (Map[IntVector, WaveFunctionCollapseOption]):
- Return type:
Map[IntVector, WaveFunctionCollapseOption] or None
- classmethod index_as_position(index, resolution) IntVector ¶
Convert 2D array index to 3D grid position
- classmethod is_option_contained(option, options) bool ¶
Is the option contained in the given options array
- Parameters:
option (WaveFunctionCollapseOption) – Option to check for
options (Array[WaveFunctionCollapseOption]) – Array of options
- Return type:
- classmethod is_soft_obj_path_equal(soft_object_path_a, soft_object_path_b) bool ¶
Is Soft Obj Path Equal
- Parameters:
soft_object_path_a (SoftObjectPath) –
soft_object_path_b (SoftObjectPath) –
- Return type:
- classmethod make_border_option() WaveFunctionCollapseOption ¶
Make FWaveFunctionCollapseOption of type: BorderOption
- Return type:
- classmethod make_empty_option() WaveFunctionCollapseOption ¶
Make FWaveFunctionCollapseOption of type: EmptyOption
- Return type:
- classmethod make_void_option() WaveFunctionCollapseOption ¶
Make FWaveFunctionCollapseOption of type: VoidOption
- Return type:
- classmethod position_as_index(position, resolution) int32 ¶
Convert 3D grid position to 2D array index