unreal.GeometryScript_MeshSelection

class unreal.GeometryScript_MeshSelection(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: BlueprintFunctionLibrary

Geometry Script Library Mesh Selection Functions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshSelectionFunctions.h

classmethod combine_mesh_selections(selection_a, selection_b, combine_mode=GeometryScriptCombineSelectionMode.ADD) GeometryScriptMeshSelection

Combine two Mesh Selections into a new Mesh Selection. The two inputs SelectionA and SelectionB must have the same Type.

Parameters:
Returns:

result_selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod convert_index_array_to_mesh_selection(target_mesh, index_array, selection_type) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a Mesh Selection from the IndexArray.

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod convert_index_list_to_mesh_selection(target_mesh, index_list, selection_type) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a Mesh Selection from the Index List. For cases where the IndexList Type does not match the SelectionType, ConvertMeshSelection with bAllowPartialInclusion=true is used to convert.

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod convert_index_set_to_mesh_selection(target_mesh, index_set, selection_type) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a Mesh Selection from the IndexSet.

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod convert_mesh_selection(target_mesh, from_selection, new_type=GeometryScriptMeshSelectionType.TRIANGLES, allow_partial_inclusion=True) -> (DynamicMesh, to_selection=GeometryScriptMeshSelection)

Convert a Mesh Selection to a different Type (eg Vertices to Triangles, etc) By default, Vertices map to Triangle one-rings, and Triangles to all contained vertices. If bAllowPartialInclusion is disabled, then more restrictive conversions are performed, as follows:

For To-Vertices, only include vertices where all one-ring triangles are included in FromSelection. For To-Triangles, only include triangles where all tri vertices are included in FromSelection. For To-Polygroups, only include groups where all group triangles are included in FromSelection

Parameters:
Returns:

to_selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod convert_mesh_selection_to_index_array(target_mesh, selection) -> (DynamicMesh, index_array=Array[int32], selection_type=GeometryScriptMeshSelectionType)

Convert a Mesh Selection to an Index List

Parameters:
Returns:

index_array (Array[int32]):

selection_type (GeometryScriptMeshSelectionType):

Return type:

tuple

classmethod convert_mesh_selection_to_index_list(target_mesh, selection, convert_to_type=GeometryScriptIndexType.ANY) -> (DynamicMesh, index_list=GeometryScriptIndexList, result_list_type=GeometryScriptIndexType)

Convert a Mesh Selection to an Index List

Parameters:
Returns:

index_list (GeometryScriptIndexList):

result_list_type (GeometryScriptIndexType):

Return type:

tuple

classmethod create_select_all_mesh_selection(target_mesh, selection_type=GeometryScriptMeshSelectionType.TRIANGLES) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a Selection of the given SelectionType that contains all the mesh elements of TargetMesh

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod debug_print_mesh_selection(selection, disable=False) None

Print information about the Mesh Selection to the Output Log

Parameters:
classmethod expand_contract_mesh_selection(target_mesh, selection, iterations=1, contract=False, only_expand_to_face_neighbours=False) -> (DynamicMesh, new_selection=GeometryScriptMeshSelection)

Grow or Shrink the Selection on the TargetMesh to connected neighbours. For Vertex selections, Expand includes vertices in one-ring of selected vertices, and Contract removes any vertices with a one-ring neighbour that is not selected For Triangle selections, Add/Remove Triangles connected to selected Triangles For Polygroup selections, Add/Remove Polygroups connected to selected Polygroups

Parameters:
  • target_mesh (DynamicMesh) –

  • selection (GeometryScriptMeshSelection) –

  • iterations (int32) – number of times to Expand/Contract the Selection. Valid range is [0,100] where 0 is a no-op.

  • contract (bool) – if true selection contracts instead of growing

  • only_expand_to_face_neighbours (bool) – if true, only adjacent Triangles/Polygroups directly connected by an edge are added, vs connected to any selected vertex

Returns:

new_selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod expand_mesh_selection_to_connected(target_mesh, selection, connection_type=GeometryScriptTopologyConnectionType.GEOMETRIC) -> (DynamicMesh, new_selection=GeometryScriptMeshSelection)

Expand the Selection on the TargetMesh to connected regions and return the NewSelection

Parameters:
Returns:

new_selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod get_mesh_selection_info(selection) -> (selection_type=GeometryScriptMeshSelectionType, num_selected=int32)

Query information about a Mesh Selection

Parameters:

selection (GeometryScriptMeshSelection) –

Returns:

selection_type (GeometryScriptMeshSelectionType):

num_selected (int32):

Return type:

tuple

classmethod invert_mesh_selection(target_mesh, selection, only_to_connected=False) -> (DynamicMesh, new_selection=GeometryScriptMeshSelection)

Invert the Selection on the TargetMesh, ie select what is not currently selected

Parameters:
  • target_mesh (DynamicMesh) –

  • selection (GeometryScriptMeshSelection) –

  • only_to_connected (bool) – if true, the inverse is limited to mesh areas geometrically connected to the Selection, instead of the entire mesh

Returns:

new_selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod select_mesh_elements_by_normal_angle(target_mesh, normal=[0.000000, 0.000000, 1.000000], max_angle_deg=1.000000, selection_type=GeometryScriptMeshSelectionType.TRIANGLES, invert=False, min_num_triangle_points=3) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a new Mesh Selection of the SelectionType for the TargetMesh by finding all elements that have a normal vector that is within an angular deviation threshold from the given Normal. For Triangle and Polygroup selections the triangle facet normal is used, for Vertex selections the per-vertex averaged normal is used.

Parameters:
  • target_mesh (DynamicMesh) –

  • normal (Vector) – normal/direction vector to measure against

  • max_angle_deg (double) – maximum angular deviation from Normal, in degrees

  • selection_type (GeometryScriptMeshSelectionType) –

  • invert (bool) – return a selection of all elements not within the given deviation

  • min_num_triangle_points (int32) – number of vertices of a triangle that must be within the angular deviation for it to be selected (1,2, or 3)

Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod select_mesh_elements_in_box(target_mesh, box, selection_type=GeometryScriptMeshSelectionType.TRIANGLES, invert=False, min_num_triangle_points=3) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a new Mesh Selection of the SelectionType for the TargetMesh by finding all elements contained in the Box.

Parameters:
  • target_mesh (DynamicMesh) –

  • box (Box) –

  • selection_type (GeometryScriptMeshSelectionType) –

  • invert (bool) – return a selection of all elements not in the Box

  • min_num_triangle_points (int32) – number of vertices of a triangle that must be in the box for it to be selected (1,2, or 3)

Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod select_mesh_elements_in_sphere(target_mesh, sphere_origin=[0.000000, 0.000000, 0.000000], sphere_radius=100.000000, selection_type=GeometryScriptMeshSelectionType.TRIANGLES, invert=False, min_num_triangle_points=3) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a new Mesh Selection of the SelectionType for the TargetMesh by finding all elements contained in the Sphere.

Parameters:
  • target_mesh (DynamicMesh) –

  • sphere_origin (Vector) – center point of the Sphere

  • sphere_radius (double) – radius of the Sphere

  • selection_type (GeometryScriptMeshSelectionType) –

  • invert (bool) – return a selection of all elements not in the Sphere

  • min_num_triangle_points (int32) – number of vertices of a triangle that must be in the Sphere for it to be selected (1,2, or 3)

Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod select_mesh_elements_inside_mesh(target_mesh, selection_mesh, selection_mesh_transform, selection_type=GeometryScriptMeshSelectionType.TRIANGLES, invert=False, shell_distance=0.000000, winding_threshold=0.500000, min_num_triangle_points=3) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a new Mesh Selection of the SelectionType for the TargetMesh by finding all elements inside a second SelectionMesh For Triangle and Polygroup selections the triangle facet normal is used, for Vertex selections the per-vertex averaged normal is used.

Parameters:
  • target_mesh (DynamicMesh) –

  • selection_mesh (DynamicMesh) –

  • selection_mesh_transform (Transform) – Transform applied to SelectionMesh for inside/outside testing

  • selection_type (GeometryScriptMeshSelectionType) –

  • invert (bool) – return a selection of all elements not within the given deviation

  • shell_distance (double) – If > 0, points within this distance from SelectionMesh will also be considered “inside”

  • winding_threshold (double) – Threshold used for Fast Mesh Winding Number inside/outside test (range is [0,1], with 1 being “inside”)

  • min_num_triangle_points (int32) – number of vertices of a triangle that must be within the angular deviation for it to be selected (1,2, or 3)

Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

classmethod select_mesh_elements_with_plane(target_mesh, plane_origin=[0.000000, 0.000000, 0.000000], plane_normal=[0.000000, 0.000000, 1.000000], selection_type=GeometryScriptMeshSelectionType.TRIANGLES, invert=False, min_num_triangle_points=3) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create a new Mesh Selection of the SelectionType for the TargetMesh by finding all elements on the “positive” side of a Plane

Parameters:
  • target_mesh (DynamicMesh) –

  • plane_origin (Vector) – center point of the Plane

  • plane_normal (Vector) – normal vector for the Plane

  • selection_type (GeometryScriptMeshSelectionType) –

  • invert (bool) – return a selection of all elements on the other (negative) side of the Plane

  • min_num_triangle_points (int32) – number of vertices of a triangle that must be on the positive Plane side to be selected (1,2, or 3)

Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection