unreal.GeometryScript_PolyGroups

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

Bases: BlueprintFunctionLibrary

Geometry Script Library Mesh Polygroup Functions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshPolygroupFunctions.h

classmethod clear_polygroups(target_mesh, group_layer, clear_value=0, debug=None) DynamicMesh

Resets the triangle PolyGroup assignments within a PolyGroup Layer to the given Clear Value (or 0 if no Clear Value is specified). Note, this will have no effect if PolyGroups have not been enabled on the mesh, or if the requested Group Layer does not exist.

Parameters:
Return type:

DynamicMesh

classmethod compute_polygroups_from_angle_threshold(target_mesh, group_layer, crease_angle=15.000000, min_group_size=2, debug=None) DynamicMesh

Sets PolyGroups by partitioning the mesh based on an edge crease/opening-angle. Note, this will have no effect if the Group Layer does not exist.

Parameters:
  • target_mesh (DynamicMesh) –

  • group_layer (GeometryScriptGroupLayer) – indicates the PolyGroup Layer that will be populated.

  • crease_angle (float) – measured in degrees and used when comparing adjacent faces.

  • min_group_size (int32) – the minimum number of triangles in each PolyGroup.

  • debug (GeometryScriptDebug) –

Return type:

DynamicMesh

classmethod compute_polygroups_from_polygon_detection(target_mesh, group_layer, respect_uv_seams=True, respect_hard_normals=False, quad_adjacency_weight=1.000000, quad_metric_clamp=1.000000, max_search_rounds=1, debug=None) DynamicMesh

Sets PolyGroups by identifying adjacent triangles that form reasonable quads. Note any triangles that do not neatly pair to form quads will receive their own PolyGroup.

Parameters:
Return type:

DynamicMesh

classmethod convert_components_to_polygroups(target_mesh, group_layer, debug=None) DynamicMesh

Creates and assigns a new PolyGroup for each disconnected component of a Mesh. Regions of a mesh are disconnected they do not have a triangle in common. Note, this will have no effect if the Group Layer does not exist.

Parameters:
Return type:

DynamicMesh

classmethod convert_uv_islands_to_polygroups(target_mesh, group_layer, uv_layer=0, debug=None) DynamicMesh

Creates and assigns a new PolyGroup for each disconnected UV island of a Mesh. Note, this will have no effect if either the requested UV Layer or Group Layer does not exist.

Parameters:
  • target_mesh (DynamicMesh) –

  • group_layer (GeometryScriptGroupLayer) – indicates PolyGroup Layer that will be populated with unique values for each UV island.

  • uv_layer (int32) – specifies the UV Layer used to construct the PolyGroups.

  • debug (GeometryScriptDebug) –

Return type:

DynamicMesh

classmethod copy_polygroups_layer(target_mesh, from_group_layer, to_group_layer, debug=None) DynamicMesh

Copies the triangle PolyGroup assignments from one layer on the Target Mesh to another. Note, this will have no effect if PolyGroups have not been enabled on the mesh, or if one of the requested Group Layers does not exist.

Parameters:
Return type:

DynamicMesh

classmethod delete_triangles_in_polygroup(target_mesh, group_layer, polygroup_id, defer_change_notifications=False, debug=None) -> (DynamicMesh, num_deleted=int32)

Deletes all triangles from the Target Mesh that have a particular PolyGroup ID, in the specific Group Layer.

Parameters:
Returns:

num_deleted (int32): on return will contain the number of triangles deleted from the Target Mesh.

Return type:

int32

classmethod enable_polygroups(target_mesh, debug=None) DynamicMesh

Enables the standard PolyGroup Layer on the Target Mesh.

Parameters:
Return type:

DynamicMesh

classmethod get_all_triangle_polygroup_i_ds(target_mesh, group_layer, polygroup_i_ds_out) -> (DynamicMesh, polygroup_i_ds_out=GeometryScriptIndexList)

Create list of per-triangle PolyGroup IDs for the PolyGroup in the Mesh warning: if the mesh is not Triangle-Compact (eg GetHasTriangleIDGaps == false) then the returned list will also have the same gaps

Parameters:
Returns:

polygroup_i_ds_out (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

classmethod get_polygroup_i_ds_in_mesh(target_mesh, group_layer, polygroup_i_ds_out) -> (DynamicMesh, polygroup_i_ds_out=GeometryScriptIndexList)

Create list of all unique PolyGroup IDs that exist in the PolyGroup Layer in the Mesh

Parameters:
Returns:

polygroup_i_ds_out (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

classmethod get_triangle_polygroup_id(target_mesh, group_layer, triangle_id) -> (int32, is_valid_triangle=bool)

Gets the PolyGroup ID associated with the specified Triangle ID and stored in the Group Layer. If the Group Layer or the Triangle does not exist, the value 0 will be returned and bIsValidTriangle set to false.

Parameters:
  • target_mesh (DynamicMesh) –

  • group_layer (GeometryScriptGroupLayer) – indicates the layer on the Target Mesh to query.

  • triangle_id (int32) – identifies a triangle in the Target Mesh.

Returns:

is_valid_triangle (bool): will be populated on return with false if either the Group Layer or the Triangle does not exist.

Return type:

bool

classmethod get_triangles_in_polygroup(target_mesh, group_layer, polygroup_id, triangle_i_ds_out) -> (DynamicMesh, triangle_i_ds_out=GeometryScriptIndexList)

Create list of all triangles with the given PolyGroup ID in the given GroupLayer (not necessarily a single connected-component)

Parameters:
Returns:

triangle_i_ds_out (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

classmethod set_num_extended_polygroup_layers(target_mesh, num_layers, debug=None) DynamicMesh

Sets the number of extended PolyGroup Layers on a Mesh.

Parameters:
Return type:

DynamicMesh

classmethod set_polygroup_for_mesh_selection(target_mesh, group_layer, selection, set_polygroup_id=0, generate_new_polygroup=False, defer_change_notifications=False) -> (DynamicMesh, set_polygroup_id_out=int32)

Set a new PolyGroup on all the triangles of the given Selection, for the given GroupLayer.

Parameters:
  • target_mesh (DynamicMesh) –

  • group_layer (GeometryScriptGroupLayer) –

  • selection (GeometryScriptMeshSelection) –

  • set_polygroup_id (int32) – explicit new PolyGroupID to set

  • generate_new_polygroup (bool) – if true, SetPolyGroupID is ignored and a new unique PolyGroupID is generated

  • defer_change_notifications (bool) – if true, the UDynamicMesh does not emit a change event/signal for this modification

Returns:

set_polygroup_id_out (int32): the PolyGroupID that was set on the triangles is returned here (whether explicit or auto-generated)

Return type:

int32