unreal.GeometryScript_MeshEdits

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

Bases: BlueprintFunctionLibrary

Geometry Script Library Mesh Basic Edit Functions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshBasicEditFunctions.h

classmethod add_triangle_to_mesh(target_mesh, new_triangle, new_triangle_group_id=0, defer_change_notifications=False, debug=None) -> (DynamicMesh, new_triangle_index=int32)

Adds a triangle (Vertex ID triplet) to the mesh and updates New Triangle Index with the resulting Triangle ID.

Parameters:
Returns:

new_triangle_index (int32):

Return type:

int32

classmethod add_triangles_to_mesh(target_mesh, new_triangles_list, new_triangle_group_id=0, defer_change_notifications=False, debug=None) -> (DynamicMesh, new_indices_list=GeometryScriptIndexList)

Adds a list of triangles to the mesh and populates the New Indices List with the corresponding new Triangle IDs.

Parameters:
Returns:

new_indices_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

classmethod add_vertex_to_mesh(target_mesh, new_position, defer_change_notifications=False) -> (DynamicMesh, new_vertex_index=int32)

Adds a new vertex to the mesh and returns a new Vertex ID (NewVertexIndex).

Parameters:
Returns:

new_vertex_index (int32):

Return type:

int32

classmethod add_vertices_to_mesh(target_mesh, new_positions_list, defer_change_notifications=False) -> (DynamicMesh, new_indices_list=GeometryScriptIndexList)

Adds a list of vertices to the mesh, and populates the NewIndicesList with the corresponding new Vertex IDs.

Parameters:
Returns:

new_indices_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

classmethod append_buffers_to_mesh(target_mesh, buffers, material_id=0, defer_change_notifications=False, debug=None) -> (DynamicMesh, new_triangle_indices_list=GeometryScriptIndexList)

Adds a set of vertices/triangles to the mesh, with Normals, UVs, and Colors; returning the new triangles indices

Parameters:
Returns:

new_triangle_indices_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

classmethod append_mesh(target_mesh, append_mesh, append_transform, defer_change_notifications=False, append_options=[GeometryScriptCombineAttributesMode.ENABLE_ALL_MATCHING], debug=None) DynamicMesh

Apply Append Transform to Append Mesh and then add its geometry to the Target Mesh.

Parameters:
Return type:

DynamicMesh

classmethod append_mesh_repeated(target_mesh, append_mesh, append_transform, repeat_count=1, apply_transform_to_first_instance=True, defer_change_notifications=False, append_options=[GeometryScriptCombineAttributesMode.ENABLE_ALL_MATCHING], debug=None) DynamicMesh

Repeatedly apply AppendTransform to the AppendMesh, each time adding the geometry to TargetMesh.

Parameters:
  • target_mesh (DynamicMesh)

  • append_mesh (DynamicMesh)

  • append_transform (Transform)

  • repeat_count (int32) – number of times to repeat the transform-append cycle

  • apply_transform_to_first_instance (bool) – if true, the AppendTransform is applied before the first mesh append, otherwise it is applied after

  • defer_change_notifications (bool)

  • append_options (GeometryScriptAppendMeshOptions) – Control how details like mesh attributes are handled when one mesh is appended to another

  • debug (GeometryScriptDebug)

Return type:

DynamicMesh

classmethod append_mesh_repeated_with_materials(target_mesh, target_mesh_material_list, append_mesh, append_mesh_material_list, append_transform, repeat_count=1, apply_transform_to_first_instance=True, defer_change_notifications=False, append_options=[GeometryScriptCombineAttributesMode.ENABLE_ALL_MATCHING], compact_appended_materials=True, debug=None) -> (DynamicMesh, result_mesh_material_list=Array[MaterialInterface])

Repeatedly apply AppendTransform to the AppendMesh, each time adding the geometry to TargetMesh. Also combines materials lists of the Target and Append meshes, and updates the output mesh materials to reference the combined list.

Parameters:
Returns:

result_mesh_material_list (Array[MaterialInterface]):

Return type:

Array[MaterialInterface]

classmethod append_mesh_transformed(target_mesh, append_mesh, append_transforms, constant_transform, constant_transform_is_relative=True, defer_change_notifications=False, append_options=[GeometryScriptCombineAttributesMode.ENABLE_ALL_MATCHING], debug=None) DynamicMesh

For each transform in AppendTransforms, apply the transform to AppendMesh and then add its geometry to the TargetMesh.

Parameters:
  • target_mesh (DynamicMesh)

  • append_mesh (DynamicMesh)

  • append_transforms (Array[Transform])

  • constant_transform (Transform) – the Constant transform will be applied after each Append transform

  • constant_transform_is_relative (bool) – if true, the Constant transform is applied “in the frame” of the Append Transform, otherwise it is applied as a second transform in local coordinates (ie rotate around the AppendTransform X axis, vs around the local X axis)

  • defer_change_notifications (bool)

  • append_options (GeometryScriptAppendMeshOptions) – Control how details like mesh attributes are handled when one mesh is appended to another

  • debug (GeometryScriptDebug)

Return type:

DynamicMesh

classmethod append_mesh_transformed_with_materials(target_mesh, target_mesh_material_list, append_mesh, append_mesh_material_list, append_transforms, constant_transform, constant_transform_is_relative=True, defer_change_notifications=False, append_options=[GeometryScriptCombineAttributesMode.ENABLE_ALL_MATCHING], compact_appended_materials=True, debug=None) -> (DynamicMesh, result_mesh_material_list=Array[MaterialInterface])

For each transform in AppendTransforms, apply the transform to AppendMesh and then add its geometry to the TargetMesh. Also combines materials lists of the Target and Append meshes, and updates the output mesh materials to reference the combined list.

Parameters:
  • target_mesh (DynamicMesh)

  • target_mesh_material_list (Array[MaterialInterface])

  • append_mesh (DynamicMesh)

  • append_mesh_material_list (Array[MaterialInterface])

  • append_transforms (Array[Transform])

  • constant_transform (Transform) – the Constant transform will be applied after each Append transform

  • constant_transform_is_relative (bool) – if true, the Constant transform is applied “in the frame” of the Append Transform, otherwise it is applied as a second transform in local coordinates (ie rotate around the AppendTransform X axis, vs around the local X axis)

  • defer_change_notifications (bool)

  • append_options (GeometryScriptAppendMeshOptions) – Control how details like mesh attributes are handled when one mesh is appended to another

  • compact_appended_materials (bool)

  • debug (GeometryScriptDebug)

Returns:

result_mesh_material_list (Array[MaterialInterface]):

Return type:

Array[MaterialInterface]

classmethod append_mesh_with_materials(target_mesh, target_mesh_material_list, append_mesh, append_mesh_material_list, append_transform, defer_change_notifications=False, append_options=[GeometryScriptCombineAttributesMode.ENABLE_ALL_MATCHING], compact_appended_materials=True, debug=None) -> (DynamicMesh, result_mesh_material_list=Array[MaterialInterface])

Apply Append Transform to Append Mesh and then add its geometry to the Target Mesh. Also combines materials lists of the Target and Append meshes, and updates the output mesh materials to reference the combined list.

Parameters:
Returns:

result_mesh_material_list (Array[MaterialInterface]):

Return type:

Array[MaterialInterface]

classmethod delete_selected_triangles_from_mesh(target_mesh, selection, defer_change_notifications=False) -> (DynamicMesh, num_deleted=int32)

Removes specified triangles, identified by mesh selection, from the mesh. On return, NumDeleted will contain the actual number of triangles removed.

Parameters:
Returns:

num_deleted (int32):

Return type:

int32

classmethod delete_triangle_from_mesh(target_mesh, triangle_id, defer_change_notifications=False) -> (DynamicMesh, was_triangle_deleted=bool)

Removes a triangle from the mesh as indicated by the Triangle ID. Should the delete fail, e.g. if the specified triangle was not a mesh element, the flag bWasTriangleDelete will be set to false.

Parameters:
  • target_mesh (DynamicMesh)

  • triangle_id (int32)

  • defer_change_notifications (bool)

Returns:

was_triangle_deleted (bool):

Return type:

bool

classmethod delete_triangles_from_mesh(target_mesh, triangle_list, defer_change_notifications=False) -> (DynamicMesh, num_deleted=int32)

Removes a list of triangles from the mesh. On return, NumDeleted will contain the actual number of triangles removed.

Parameters:
Returns:

num_deleted (int32):

Return type:

int32

classmethod delete_vertex_from_mesh(target_mesh, vertex_id, defer_change_notifications=False) -> (DynamicMesh, was_vertex_deleted=bool)

Removes a vertex from the mesh as indicated by the VertexID. Should the delete fail, e.g. if the specified vertex was not a mesh element, the flag bWasVertexDeleted will be set to false.

Parameters:
  • target_mesh (DynamicMesh)

  • vertex_id (int32)

  • defer_change_notifications (bool)

Returns:

was_vertex_deleted (bool):

Return type:

bool

classmethod delete_vertices_from_mesh(target_mesh, vertex_list, defer_change_notifications=False) -> (DynamicMesh, num_deleted=int32)

Removes a list of vertices from the mesh. On return, NumDeleted will contain the actual number of vertices removed.

Parameters:
Returns:

num_deleted (int32):

Return type:

int32

classmethod discard_mesh_attributes(target_mesh, defer_change_notifications=False) DynamicMesh

Discard Mesh Attributes

Parameters:
Return type:

DynamicMesh

classmethod merge_mesh_vertex_pair(target_mesh, vertex_keep, vertex_discard, options, interp_param=0.500000, defer_change_notifications=False, debug=None) -> (DynamicMesh, success=bool)

Attempt to merge together two vertices, and report whether they were merged. Note that some merges may be prevented because they would create non-manifold edges in the mesh, which are not supported.

Parameters:
  • target_mesh (DynamicMesh) – Mesh in which to merge vertices

  • vertex_keep (int32) – Vertex to keep after merge

  • vertex_discard (int32) – Vertex to discard after merge

  • options (GeometryScriptMergeVertexOptions) – Options for merge, controlling which merges should be permitted

  • interp_param (double) – The kept vertex is moved to interpolated position Lerp(VertexKeep Position, VertexDiscard Position, InterpParam)

  • defer_change_notifications (bool) – Whether to defer change notifications after this operation

  • debug (GeometryScriptDebug)

Returns:

success (bool): Flag indicating whether the merge succeeded

Return type:

bool

classmethod merge_mesh_vertices_in_selections(target_mesh, selection_keep, selection_discard, options, interp_param=0.500000, distance_threshold=1.000000, defer_change_notifications=False, debug=None) -> (DynamicMesh, num_merged=int32)

Attempt to merge together vertices in one selection to their closest vertices in the second selection, within a distance threshold. Note that some merges may be prevented because they would create non-manifold edges in the mesh, which are not supported.

Parameters:
  • target_mesh (DynamicMesh) – Mesh in which to merge vertices

  • selection_keep (GeometryScriptMeshSelection) – Selection of vertices to be merged with SelectionDiscard, treated as ‘kept’ vertices for purposes of interpolation.

  • selection_discard (GeometryScriptMeshSelection) – Selection of vertices to be merged with SelectionKeep. Note: If a vertex is in both selections, it will be treated as if it were only in SelectionKeep.

  • options (GeometryScriptMergeVertexOptions) – Options for merge, controlling which merges should be permitted

  • interp_param (double) – The kept vertex is moved to interpolated position Lerp(VertexKeep Position, VertexDiscard Position, InterpParam)

  • distance_threshold (double) – Vertices further apart than this threshold will not be merged

  • defer_change_notifications (bool) – Whether to defer change notifications after this operation

  • debug (GeometryScriptDebug)

Returns:

num_merged (int32): Number of vertices merged

Return type:

int32

classmethod set_all_mesh_vertex_positions(target_mesh, position_list, debug=None) DynamicMesh

Set all vertex positions in the TargetMesh to the specified Positions.

Parameters:
Return type:

DynamicMesh

classmethod set_vertex_position(target_mesh, vertex_id, new_position, defer_change_notifications=False) -> (DynamicMesh, is_valid_vertex=bool)

Set Vertex Position

Parameters:
Returns:

is_valid_vertex (bool):

Return type:

bool