unreal.GeometryScript_MeshQueries

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

Bases: BlueprintFunctionLibrary

Geometry Script Library Mesh Query Functions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshQueryFunctions.h

classmethod compute_triangle_barycentric_coords(target_mesh, triangle_id, point) -> (DynamicMesh, is_valid_triangle=bool, vertex1=Vector, vertex2=Vector, vertex3=Vector, barycentric_coords=Vector)

Compute the barycentric coordinates (A,B,C) of the Point relative to the specified TriangleID of the TargetMesh. The properties of barycentric coordinates are such that A,B,C are all positive, A+B+C=1.0, and A*Vertex1 + B*Vertex2 + C*Vertex3 = Point. So, the barycentric coordinates can be used to smoothly interpolate/blend any other per-triangle-vertex quantities. The Point must lie in the plane of the Triangle, otherwise the coordinates are somewhat meaningless (but clamped to 0-1 range to avoid catastrophic errors) The Positions of the Triangle Vertices are also returned for convenience (similar to GetTrianglePositions)

Parameters:
Returns:

is_valid_triangle (bool): will be returned true if TriangleID exists in TargetMesh, and otherwise will be returned false

vertex1 (Vector):

vertex2 (Vector):

vertex3 (Vector):

barycentric_coords (Vector):

Return type:

tuple

classmethod get_all_triangle_i_ds(target_mesh) -> (DynamicMesh, triangle_id_list=GeometryScriptIndexList, has_triangle_id_gaps=bool)

Get All Triangle IDs

Parameters:

target_mesh (DynamicMesh) –

Returns:

triangle_id_list (GeometryScriptIndexList):

has_triangle_id_gaps (bool):

Return type:

tuple

classmethod get_all_triangle_indices(target_mesh, skip_gaps) -> (DynamicMesh, triangle_list=GeometryScriptTriangleList, has_triangle_id_gaps=bool)

Get All Triangle Indices

Parameters:
Returns:

triangle_list (GeometryScriptTriangleList):

has_triangle_id_gaps (bool):

Return type:

tuple

classmethod get_all_vertex_i_ds(target_mesh) -> (DynamicMesh, vertex_id_list=GeometryScriptIndexList, has_vertex_id_gaps=bool)

Get All Vertex IDs

Parameters:

target_mesh (DynamicMesh) –

Returns:

vertex_id_list (GeometryScriptIndexList):

has_vertex_id_gaps (bool):

Return type:

tuple

classmethod get_all_vertex_positions(target_mesh, skip_gaps) -> (DynamicMesh, position_list=GeometryScriptVectorList, has_vertex_id_gaps=bool)

Get All Vertex Positions

Parameters:
Returns:

position_list (GeometryScriptVectorList):

has_vertex_id_gaps (bool):

Return type:

tuple

classmethod get_has_material_i_ds(target_mesh) bool

Material Queries

Parameters:

target_mesh (DynamicMesh) –

Return type:

bool

classmethod get_has_polygroups(target_mesh) bool

Polygroup Queries

Parameters:

target_mesh (DynamicMesh) –

Return type:

bool

classmethod get_has_triangle_id_gaps(target_mesh) bool

Get Has Triangle IDGaps

Parameters:

target_mesh (DynamicMesh) –

Return type:

bool

classmethod get_has_triangle_normals(target_mesh) bool
Parameters:

target_mesh (DynamicMesh) –

Returns:

true if the TargetMesh has the Normals Attribute enabled (which allows for storing split normals)

Return type:

bool

classmethod get_has_vertex_colors(target_mesh) bool
Parameters:

target_mesh (DynamicMesh) –

Returns:

true if the TargetMesh has the Vertex Colors attribute enabled

Return type:

bool

classmethod get_has_vertex_id_gaps(target_mesh) bool

Get Has Vertex IDGaps

Parameters:

target_mesh (DynamicMesh) –

Return type:

bool

classmethod get_interpolated_triangle_normal(target_mesh, triangle_id, barycentric_coords) -> (DynamicMesh, tri_has_valid_normals=bool, interpolated_normal=Vector)

Compute the interpolated Normal (A*Normal1 + B*Normal2 + C*Normal3), where (A,B,C)=BarycentricCoords and the Normals are taken from the specified TriangleID in the Normal layer of the TargetMesh.

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

  • barycentric_coords (Vector) –

Returns:

tri_has_valid_normals (bool): will be returned true if TriangleID exists in TargetMesh and has Normals set, and otherwise will be returned false

interpolated_normal (Vector):

Return type:

tuple

classmethod get_interpolated_triangle_normal_tangents(target_mesh, triangle_id, barycentric_coords) -> (DynamicMesh, tri_has_valid_elements=bool, interpolated_normal=Vector, interpolated_tangent=Vector, interpolated_bi_tangent=Vector)

Compute the interpolated Normal and Tangents for the specified specified TriangleID in the Normal and Tangent attributes of the TargetMesh.

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

  • barycentric_coords (Vector) –

Returns:

tri_has_valid_elements (bool): will be returned true if TriangleID exists in TargetMesh and has Normals and Tangents set, and otherwise will be returned false

interpolated_normal (Vector):

interpolated_tangent (Vector):

interpolated_bi_tangent (Vector):

Return type:

tuple

classmethod get_interpolated_triangle_position(target_mesh, triangle_id, barycentric_coords) -> (DynamicMesh, is_valid_triangle=bool, interpolated_position=Vector)

Compute the interpolated Position (A*Vertex1 + B*Vertex2 + C*Vertex3), where (A,B,C)=BarycentricCoords and the Vertex positions are taken from the specified TriangleID of the TargetMesh.

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

  • barycentric_coords (Vector) –

Returns:

is_valid_triangle (bool): will be returned true if TriangleID exists in TargetMesh, and otherwise will be returned false

interpolated_position (Vector):

Return type:

tuple

classmethod get_interpolated_triangle_uv(target_mesh, uv_set_index, triangle_id, barycentric_coords) -> (DynamicMesh, tri_has_valid_u_vs=bool, interpolated_uv=Vector2D)

Compute the interpolated UV (A*UV1+ B*UV2+ C*UV3), where (A,B,C)=BarycentricCoords and the UV positions are taken from the specified TriangleID in the specified UVSet of the TargetMesh.

Parameters:
  • target_mesh (DynamicMesh) –

  • uv_set_index (int32) –

  • triangle_id (int32) –

  • barycentric_coords (Vector) –

Returns:

tri_has_valid_u_vs (bool):

interpolated_uv (Vector2D):

Return type:

tuple

classmethod get_interpolated_triangle_vertex_color(target_mesh, triangle_id, barycentric_coords, default_color) -> (DynamicMesh, tri_has_valid_vertex_colors=bool, interpolated_color=LinearColor)

Compute the interpolated Vertex Color (A*Color1 + B*Color2 + C*Color3), where (A,B,C)=BarycentricCoords and the Colors are taken from the specified TriangleID in the Vertex Color layer of the TargetMesh.

Parameters:
Returns:

tri_has_valid_vertex_colors (bool): will be returned true if TriangleID exists in TargetMesh and has Colors set, and otherwise will be returned false

interpolated_color (LinearColor):

Return type:

tuple

classmethod get_is_closed_mesh(target_mesh) bool

Get Is Closed Mesh

Parameters:

target_mesh (DynamicMesh) –

Return type:

bool

classmethod get_is_dense_mesh(target_mesh) bool

Get Is Dense Mesh

Parameters:

target_mesh (DynamicMesh) –

Return type:

bool

classmethod get_mesh_bounding_box(target_mesh) Box

Get Mesh Bounding Box

Parameters:

target_mesh (DynamicMesh) –

Return type:

Box

classmethod get_mesh_has_attribute_set(target_mesh) bool

Get Mesh Has Attribute Set

Parameters:

target_mesh (DynamicMesh) –

Return type:

bool

classmethod get_mesh_info_string(target_mesh) str

Get Mesh Info String

Parameters:

target_mesh (DynamicMesh) –

Return type:

str

classmethod get_mesh_volume_area(target_mesh) -> (surface_area=float, volume=float)

Get Mesh Volume Area

Parameters:

target_mesh (DynamicMesh) –

Returns:

surface_area (float):

volume (float):

Return type:

tuple

classmethod get_num_connected_components(target_mesh) int32

Get Num Connected Components

Parameters:

target_mesh (DynamicMesh) –

Return type:

int32

classmethod get_num_extended_polygroup_layers(target_mesh) int32

Get Num Extended Polygroup Layers

Parameters:

target_mesh (DynamicMesh) –

Return type:

int32

classmethod get_num_open_border_edges(target_mesh) int32

Get Num Open Border Edges

Parameters:

target_mesh (DynamicMesh) –

Return type:

int32

classmethod get_num_open_border_loops(target_mesh) -> (int32, ambiguous_topology_found=bool)

Get Num Open Border Loops

Parameters:

target_mesh (DynamicMesh) –

Returns:

ambiguous_topology_found (bool):

Return type:

bool

classmethod get_num_triangle_i_ds(target_mesh) int32

UDynamicMesh already has this function UFUNCTION(BlueprintPure, Category = “GeometryScript|MeshQueries”, meta=(ScriptMethod)) static UPARAM(DisplayName = “Triangle Count”) int32 GetTriangleCount( UDynamicMesh* TargetMesh );

Parameters:

target_mesh (DynamicMesh) –

Return type:

int32

classmethod get_num_uv_sets(target_mesh) int32

UV Queries

Parameters:

target_mesh (DynamicMesh) –

Return type:

int32

classmethod get_num_vertex_i_ds(target_mesh) int32

Get Num Vertex IDs

Parameters:

target_mesh (DynamicMesh) –

Return type:

int32

classmethod get_triangle_face_normal(target_mesh, triangle_id) -> (Vector, is_valid_triangle=bool)

Get Triangle Face Normal

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

Returns:

is_valid_triangle (bool):

Return type:

bool

classmethod get_triangle_indices(target_mesh, triangle_id) -> (IntVector, is_valid_triangle=bool)

Get Triangle Indices

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

Returns:

is_valid_triangle (bool):

Return type:

bool

classmethod get_triangle_normal_tangents(target_mesh, triangle_id) -> (DynamicMesh, tri_has_valid_elements=bool, normals=GeometryScriptTriangle, tangents=GeometryScriptTriangle, bi_tangents=GeometryScriptTriangle)

For the specified TriangleID of the TargetMesh, get the Normal and Tangent vectors at each vertex of the Triangle. These Normals/Tangents will be taken from the Normal and Tangents Overlays, ie they will potentially be split-normals.

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

Returns:

tri_has_valid_elements (bool): will be returned true if TriangleID exists in TargetMesh and has Normals and Tangents set

normals (GeometryScriptTriangle):

tangents (GeometryScriptTriangle):

bi_tangents (GeometryScriptTriangle):

Return type:

tuple

classmethod get_triangle_normals(target_mesh, triangle_id) -> (DynamicMesh, normal1=Vector, normal2=Vector, normal3=Vector, tri_has_valid_normals=bool)

For the specified TriangleID of the TargetMesh, get the Normal vectors at each vertex of the Triangle. These Normals will be taken from the Normal Overlay, ie they will potentially be split-normals.

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

Returns:

normal1 (Vector):

normal2 (Vector):

normal3 (Vector):

tri_has_valid_normals (bool): will be returned true if TriangleID exists in TargetMesh and has Normals set

Return type:

tuple

classmethod get_triangle_positions(target_mesh, triangle_id) -> (is_valid_triangle=bool, vertex1=Vector, vertex2=Vector, vertex3=Vector)

Get Triangle Positions

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

Returns:

is_valid_triangle (bool):

vertex1 (Vector):

vertex2 (Vector):

vertex3 (Vector):

Return type:

tuple

classmethod get_triangle_u_vs(target_mesh, uv_set_index, triangle_id) -> (uv1=Vector2D, uv2=Vector2D, uv3=Vector2D, have_valid_u_vs=bool)

Get Triangle UVs

Parameters:
  • target_mesh (DynamicMesh) –

  • uv_set_index (int32) –

  • triangle_id (int32) –

Returns:

uv1 (Vector2D):

uv2 (Vector2D):

uv3 (Vector2D):

have_valid_u_vs (bool):

Return type:

tuple

classmethod get_triangle_vertex_colors(target_mesh, triangle_id) -> (DynamicMesh, color1=LinearColor, color2=LinearColor, color3=LinearColor, tri_has_valid_vertex_colors=bool)

For the specified TriangleID of the TargetMesh, get the Vertex Colors at each vertex of the Triangle. These Colors will be taken from the Vertex Color Attribute, ie they will potentially be split-colors.

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

Returns:

color1 (LinearColor):

color2 (LinearColor):

color3 (LinearColor):

tri_has_valid_vertex_colors (bool): will be returned true if TriangleID exists in TargetMesh and has Vertex Colors set

Return type:

tuple

classmethod get_uv_set_bounding_box(target_mesh, uv_set_index) -> (Box2D, is_valid_uv_set=bool, uv_set_is_empty=bool)

Get UVSet Bounding Box

Parameters:
  • target_mesh (DynamicMesh) –

  • uv_set_index (int32) –

Returns:

is_valid_uv_set (bool):

uv_set_is_empty (bool):

Return type:

tuple

classmethod get_vertex_count(target_mesh) int32

Get Vertex Count

Parameters:

target_mesh (DynamicMesh) –

Return type:

int32

classmethod get_vertex_position(target_mesh, vertex_id) -> (Vector, is_valid_vertex=bool)

Get Vertex Position

Parameters:
Returns:

is_valid_vertex (bool):

Return type:

bool

classmethod is_valid_triangle_id(target_mesh, triangle_id) bool

Is Valid Triangle ID

Parameters:
  • target_mesh (DynamicMesh) –

  • triangle_id (int32) –

Return type:

bool

classmethod is_valid_vertex_id(target_mesh, vertex_id) bool

Is Valid Vertex ID

Parameters:
Return type:

bool