unreal.DynamicMesh

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

Bases: Object

UDynamicMesh is a UObject container for a FDynamicMesh3.

C++ Source:

  • Module: GeometryFramework

  • File: UDynamicMesh.h

Editor Properties: (see get_editor_property/set_editor_property)

  • enable_mesh_generator (bool): [Read-Write] Controls whether the active Generator (if configured) will be applied when rebuilding the mesh

  • mesh_modified_bp_event (OnDynamicMeshModifiedBP): [Read-Write] Blueprintable event called when mesh is modified, in the same cases as OnMeshChanged

add_triangle_to_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

add_triangles_to_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

add_uv_element_to_mesh(uv_set_index, new_uv_position, defer_change_notifications=False) -> (DynamicMesh, new_uv_element_id=int32, is_valid_uv_set=bool)

Adds a new UV Element to the specified UV Channel of the Mesh and returns a new UV Element ID.

Parameters:
  • uv_set_index (int32) –

  • new_uv_position (Vector2D) –

  • defer_change_notifications (bool) –

Returns:

new_uv_element_id (int32):

is_valid_uv_set (bool):

Return type:

tuple

add_vertex_to_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:
  • new_position (Vector) –

  • defer_change_notifications (bool) –

Returns:

new_vertex_index (int32):

Return type:

int32

add_vertices_to_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

append_bounding_box(primitive_options, transform, box, steps_x=0, steps_y=0, steps_z=0, debug=None) DynamicMesh

Appends a 3D box to the Target Mesh with dimensions and origin taken from the input Box

Parameters:
Return type:

DynamicMesh

append_box(primitive_options, transform, dimension_x=100.000000, dimension_y=100.000000, dimension_z=100.000000, steps_x=0, steps_y=0, steps_z=0, origin=GeometryScriptPrimitiveOriginMode.BASE, debug=None) DynamicMesh

Appends a 3D box to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_buffers_to_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

append_capsule(primitive_options, transform, radius=30.000000, line_length=75.000000, hemisphere_steps=5, circle_steps=8, origin=GeometryScriptPrimitiveOriginMode.BASE, debug=None) DynamicMesh

Appends a 3D Capsule to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_cone(primitive_options, transform, base_radius=50.000000, top_radius=5.000000, height=100.000000, radial_steps=12, height_steps=4, capped=True, origin=GeometryScriptPrimitiveOriginMode.BASE, debug=None) DynamicMesh

Appends a 3D cone to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_curved_stairs(primitive_options, transform, step_width=100.000000, step_height=20.000000, inner_radius=150.000000, curve_angle=90.000000, num_steps=8, floating=False, debug=None) DynamicMesh

Appends a rising circular staircase to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_cylinder(primitive_options, transform, radius=50.000000, height=100.000000, radial_steps=12, height_steps=0, capped=True, origin=GeometryScriptPrimitiveOriginMode.BASE, debug=None) DynamicMesh

Appends a 3D Cylinder (with optional end caps) to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_delaunay_triangulation2d(primitive_options, transform, vertex_positions, constrained_edges, triangulation_options, debug=None) -> (DynamicMesh, positions_to_vertex_i_ds=Array[int32], has_duplicate_vertices=bool)

Generates a Delaunay Triangulation of the provided vertices, and appends it to the Target Mesh. If optional Constrained Edges are provided, will generate a Constrained Delaunay Triangulation which connects the specified vertices with edges. On success, all vertices are always appended to the output mesh, though duplicate vertices will not be used in any triangles and may optionally be removed. Use PositionsToVertexIDs to map indices in the input VertexPositions array to vertex IDs in the Dynamic Mesh.

Parameters:
Returns:

positions_to_vertex_i_ds (Array[int32]):

has_duplicate_vertices (bool):

Return type:

tuple

append_disc(primitive_options, transform, radius=50.000000, angle_steps=16, spoke_steps=0, start_angle=0.000000, end_angle=360.000000, hole_radius=0.000000, debug=None) DynamicMesh

Appends a planar disc to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_linear_stairs(primitive_options, transform, step_width=100.000000, step_height=20.000000, step_depth=30.000000, num_steps=8, floating=False, debug=None) DynamicMesh

Appends a linear staircase to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_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

append_mesh_repeated(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:
  • 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

append_mesh_transformed(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:
  • 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

append_rectangle(primitive_options: GeometryScriptPrimitiveOptions, transform: Transform, dimension_x: float = 100.0, dimension_y: float = 100.0, steps_width: int = 0, steps_height: int = 0, debug: GeometryScriptDebug = Ellipsis) DynamicMesh

deprecated: ‘append_rectangle’ was renamed to ‘append_rectangle_compatibility_5_0’.

append_rectangle_compatibility_5_0(primitive_options, transform, dimension_x=100.000000, dimension_y=100.000000, steps_width=0, steps_height=0, debug=None) DynamicMesh

5.0 Preview 1 Compatibility version of AppendRectangleXY. Incorrectly interprets the input dimensions. Incorrectly divides the input DimensionX and DimensionY by 2. warning: It is strongly recommended that callers of this function update to the current AppendRectangleXY function!

Parameters:
Return type:

DynamicMesh

append_rectangle_xy(primitive_options, transform, dimension_x=100.000000, dimension_y=100.000000, steps_width=0, steps_height=0, debug=None) DynamicMesh

Appends a planar Rectangle to a Dynamic Mesh.

Parameters:
Return type:

DynamicMesh

append_revolve_path(primitive_options, transform, path_vertices, revolve_options, steps=8, capped=True, debug=None) DynamicMesh

Revolves an open 2D path, with optional top and bottom end caps, appending the result to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_revolve_polygon(primitive_options, transform, polygon_vertices, revolve_options, radius=100.000000, steps=8, debug=None) DynamicMesh

In the coordinate system of the revolve polygon, +X is towards the “outside” of the revolve donut, and +Y is “up” (ie +Z in local space) Polygon should be oriented counter-clockwise to produce a correctly-oriented shape, otherwise it will be inside-out Polygon endpoint is not repeated.

Parameters:
Return type:

DynamicMesh

append_round_rectangle(primitive_options: GeometryScriptPrimitiveOptions, transform: Transform, dimension_x: float = 100.0, dimension_y: float = 100.0, corner_radius: float = 5.0, steps_width: int = 0, steps_height: int = 0, steps_round: int = 4, debug: GeometryScriptDebug = Ellipsis) DynamicMesh

deprecated: ‘append_round_rectangle’ was renamed to ‘append_round_rectangle_compatibility_5_0’.

append_round_rectangle_compatibility_5_0(primitive_options, transform, dimension_x=100.000000, dimension_y=100.000000, corner_radius=5.000000, steps_width=0, steps_height=0, steps_round=4, debug=None) DynamicMesh

5.0 Preview 1 Compatibility version of AppendRoundRectangleXY. Incorrectly divides the input DimensionX and DimensionY by 2. warning: It is strongly recommended that callers of this function update to the current AppendRoundRectangleXY function!

Parameters:
Return type:

DynamicMesh

append_round_rectangle_xy(primitive_options, transform, dimension_x=100.000000, dimension_y=100.000000, corner_radius=5.000000, steps_width=0, steps_height=0, steps_round=4, debug=None) DynamicMesh

Appends a planar Rectangle with Rounded Corners (RoundRect) to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_simple_extrude_polygon(primitive_options, transform, polygon_vertices, height=100.000000, height_steps=0, capped=True, origin=GeometryScriptPrimitiveOriginMode.BASE, debug=None) DynamicMesh

Polygon should be oriented counter-clockwise to produce a correctly-oriented shape, otherwise it will be inside-out Polygon endpoint is not repeated.

Parameters:
Return type:

DynamicMesh

append_simple_swept_polygon(primitive_options, transform, polygon_vertices, sweep_path, loop=False, capped=True, start_scale=1.000000, end_scale=1.000000, debug=None) DynamicMesh

Sweeps a 2D polygon along an arbitrary 3D path, appending the result to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_sphere_box(primitive_options, transform, radius=50.000000, steps_x=6, steps_y=6, steps_z=6, origin=GeometryScriptPrimitiveOriginMode.CENTER, debug=None) DynamicMesh

Appends a 3D sphere triangulated using box topology to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_sphere_lat_long(primitive_options, transform, radius=50.000000, steps_phi=10, steps_theta=16, origin=GeometryScriptPrimitiveOriginMode.CENTER, debug=None) DynamicMesh

Appends a 3D Sphere triangulated using latitude/longitude topology to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_spiral_revolve_polygon(primitive_options, transform, polygon_vertices, revolve_options, radius=100.000000, steps=18, rise_per_revolution=50.000000, debug=None) DynamicMesh

Revolves a 2D polygon on a helical path, like one used to create a vertical spiral, appending the result to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_sweep_polygon(primitive_options, transform, polygon_vertices, sweep_path, loop=False, capped=True, start_scale=1.000000, end_scale=1.000000, rotation_angle_deg=0.000000, debug=None) DynamicMesh

Sweep the given 2D PolygonVertices along the SweepPath specified as a set of FTransforms If the 2D vertices are (U,V), then in the coordinate space of the FTransform, X points “along” the path, Y points “right” (U) and Z points “up” (V).

Parameters:
  • primitive_options (GeometryScriptPrimitiveOptions) –

  • transform (Transform) –

  • polygon_vertices (Array[Vector2D]) – vertices of the closed 2D polyon that will be swept along the SweepPath

  • sweep_path (Array[Transform]) – defines the 3D sweep path curve as a 3D poly-path, with rotation and scaling at each polypath vertex taken from the Transform

  • loop (bool) – if true, SweepPath is considered to be a Loop and a section connecting the end and start of the path is added (bCapped is ignored)

  • capped (bool) – if true the open ends of the swept generalized cylinder are triangulated

  • start_scale (float) – uniform scaling applied to the 2D polygon at the start of the path. Interpolated via arc length to EndScale at the end of the path.

  • end_scale (float) – uniform scaling applied to the 2D polygon at the end of the path

  • rotation_angle_deg (float) – Rotation applied to the 2D Polygon. Positive rotation rotates clockwise, ie Up/+Z/+V towards Right/+Y/+U

  • debug (GeometryScriptDebug) –

Return type:

DynamicMesh

append_sweep_polyline(primitive_options, transform, polyline_vertices, sweep_path, polyline_tex_param_u, sweep_path_tex_param_v, loop=False, start_scale=1.000000, end_scale=1.000000, rotation_angle_deg=0.000000, debug=None) DynamicMesh

Sweep the given 2D PolylineVertices along the SweepPath specified as a set of FTransforms If the 2D vertices are (U,V), then in the coordinate space of the FTransform, X points “along” the path, Y points “right” (U) and Z points “up” (V).

Parameters:
  • primitive_options (GeometryScriptPrimitiveOptions) –

  • transform (Transform) –

  • polyline_vertices (Array[Vector2D]) – vertices of the open 2D path that will be swept along the SweepPath

  • sweep_path (Array[Transform]) – defines the 3D sweep path curve as a 3D poly-path, with rotation and scaling at each polypath vertex taken from the Transform

  • polyline_tex_param_u (Array[float]) – defines U coordinate value for each element in PolylineVertices. Must be same length as PolylineVertices (ignored if length=0).

  • sweep_path_tex_param_v (Array[float]) – defines V coordinate value for each element in SweepPath. Must be same length as SweepPath if bLoop=false, length+1 if bLoop=true, and ignored if length=0.

  • loop (bool) – if true, SweepPath is considered to be a Loop and a section connecting the end and start of the path is added (bCapped is ignored)

  • start_scale (float) – uniform scaling applied to the 2D polygon at the start of the path. Interpolated via arc length to EndScale at the end of the path.

  • end_scale (float) – uniform scaling applied to the 2D polygon at the end of the path

  • rotation_angle_deg (float) – Rotation applied to the 2D Polygon. Positive rotation rotates clockwise, ie Up/+Z/+V towards Right/+Y/+U. This Rotation is applied before any rotation in the SweepPath Transforms.

  • debug (GeometryScriptDebug) –

Return type:

DynamicMesh

append_torus(primitive_options, transform, revolve_options, major_radius=50.000000, minor_radius=25.000000, major_steps=16, minor_steps=8, origin=GeometryScriptPrimitiveOriginMode.BASE, debug=None) DynamicMesh

Appends a 3D torus (donut) or partial torus to the Target Mesh.

Parameters:
Return type:

DynamicMesh

append_triangulated_polygon(primitive_options, transform, polygon_vertices, allow_self_intersections=True, debug=None) DynamicMesh

Appends a Triangulated Polygon to the Target Mesh. Polygon should be oriented counter-clockwise to produce a correctly-oriented shape, otherwise it will be inside-out Polygon endpoint is not repeated.

Parameters:
Return type:

DynamicMesh

append_triangulated_polygon3d(primitive_options, transform, polygon_vertices3d, debug=None) DynamicMesh

Appends a Triangulated Polygon (with vertices specified in 3D) to the Target Mesh. Uses Ear Clipping-based triangulation. Output vertices will always be 1:1 with input vertices. Polygon endpoint is not repeated.

Parameters:
Return type:

DynamicMesh

append_voronoi_diagram2d(primitive_options, transform, voronoi_sites, voronoi_options, debug=None) DynamicMesh

Generates triangulated Voronoi Cells from the provided Voronoi Sites, identifying each with PolyGroups, and appends to the Target Mesh.

Parameters:
Return type:

DynamicMesh

apply_bend_warp_to_mesh(options, bend_orientation, bend_angle=45.000000, bend_extent=50.000000, debug=None) DynamicMesh

Applies a Bend Warp around an axis defined by the Bend Orientation transform. The extents of the affected region can be controlled by the Options.

Parameters:
Return type:

DynamicMesh

apply_displace_from_per_vertex_vectors(selection, vector_list, magnitude=5.000000, debug=None) DynamicMesh

Add the vectors in VectorList, scaled by Magnitude, to the vertex positions in Target Mesh. VectorList Length must be >= the MaxVertexID of the Target Mesh.

Parameters:
Return type:

DynamicMesh

apply_displace_from_texture_map(texture, selection, options, uv_layer=0, debug=None) DynamicMesh

Applies a displacement to a Dynamic Mesh based on a Texture2D and a UV Channel.

Parameters:
Return type:

DynamicMesh

apply_flare_warp_to_mesh(options, flare_orientation, flare_percent_x=0.000000, flare_percent_y=0.000000, flare_extent=50.000000, debug=None) DynamicMesh

Applies a Flare/Bulge warp around an axis defined by the Flare Orientation transform. The amount of flare in the perpendicular directions can be controlled by FlarePercentX and FlarePercentY and the extents of the affected region can be controlled by the Options.

Parameters:
Return type:

DynamicMesh

apply_iterative_smoothing_to_mesh(selection, options, debug=None) DynamicMesh

Applies a number of iterations of mesh smoothing to a Dynamic Mesh.

Parameters:
Return type:

DynamicMesh

apply_math_warp_to_mesh(warp_orientation, warp_type, options, debug=None) DynamicMesh

Applies various simple math-function-based warps around an axis defined by the Warp Orientation transform, currently a 1D or 2D sine-wave with arbitrary orientation may be selected by WarpType.

Parameters:
Return type:

DynamicMesh

apply_mesh_bevel_selection(selection, bevel_mode, bevel_options, debug=None) DynamicMesh

Apply a Mesh Bevel operation to parts of TargetMesh using the BevelOptions settings.

Parameters:
Return type:

DynamicMesh

apply_mesh_boolean(target_transform, tool_mesh, tool_transform, operation, options, debug=None) DynamicMesh

Applies a Boolean operation (such as, Union, Intersect, and Subtract) to the Target Dynamic Mesh based on a Tool Dynamic Mesh.

Parameters:
Return type:

DynamicMesh

apply_mesh_disconnect_faces(selection, allow_bowties_in_output=True, debug=None) DynamicMesh

Disconnect the triangles of TargetMesh identified by the Selection. The input Selection will still identify the same geometric elements after Disconnecting.

Parameters:
Return type:

DynamicMesh

apply_mesh_duplicate_faces(selection, group_options=[GeometryScriptMeshEditPolygroupMode.PRESERVE_EXISTING, 0], debug=None) -> (DynamicMesh, new_triangles=GeometryScriptMeshSelection)

Duplicate the triangles of TargetMesh identified by the Selection

Parameters:
Returns:

new_triangles (GeometryScriptMeshSelection): a Mesh Selection of the duplicate triangles is returned here (with type Triangles)

Return type:

GeometryScriptMeshSelection

apply_mesh_extrude(options: GeometryScriptMeshExtrudeOptions, debug: GeometryScriptDebug = Ellipsis) DynamicMesh

deprecated: ‘apply_mesh_extrude’ was renamed to ‘apply_mesh_extrude_compatibility_5p0’.

apply_mesh_extrude_compatibility_5p0(options, debug=None) DynamicMesh

Backwards-Compatibility implementations

These are versions/variants of the above functions that were released in previous UE 5.x versions, that have since been updated. To avoid breaking user scripts, these previous versions are currently kept and called via redirectors registered in GeometryScriptingCoreModule.cpp.

These functions may be deprecated in future UE releases.

param options:

type options:

GeometryScriptMeshExtrudeOptions

param debug:

type debug:

GeometryScriptDebug

rtype:

DynamicMesh

apply_mesh_inset_outset_faces(options, selection, debug=None) DynamicMesh

Apply an Inset or Outset to the faces of TargetMesh identified by the Selection, or all faces if the Selection is empty.

Parameters:
Return type:

DynamicMesh

apply_mesh_linear_extrude_faces(options, selection, debug=None) DynamicMesh

Apply Linear Extrusion (ie extrusion in a single direction) to the triangles of TargetMesh identified by the Selection. The input Selection will still identify the same geometric elements after the Extrusion

Parameters:
Return type:

DynamicMesh

apply_mesh_mirror(mirror_frame, options, debug=None) DynamicMesh

Mirrors a mesh across a plane, with optional cutting and welding of triangles.

Parameters:
Return type:

DynamicMesh

apply_mesh_morphology(options, debug=None) DynamicMesh

Replaces the mesh with an SDF-based offset mesh approximation.

Parameters:
Return type:

DynamicMesh

apply_mesh_offset(options, debug=None) DynamicMesh

Offset the vertices of TargetMesh from their initial positions based on averaged vertex normals. This function is intended for high-res meshes, for polymodeling-style offsets, ApplyMeshOffsetFaces will produce better results.

Parameters:
Return type:

DynamicMesh

apply_mesh_offset_faces(options, selection, debug=None) DynamicMesh

Apply an Offset to the faces of TargetMesh identified by the Selection, or all faces if the Selection is empty. The Offset direction at each vertex can be derived from the averaged vertex normals or per-triangle normals.

Parameters:
Return type:

DynamicMesh

apply_mesh_plane_cut(cut_frame, options, debug=None) DynamicMesh

Applies a plane cut to a mesh, optionally filling any holes created.

Parameters:
Return type:

DynamicMesh

apply_mesh_plane_slice(cut_frame, options, debug=None) DynamicMesh

Slices a mesh into two halves, with optional hole filling.

Parameters:
Return type:

DynamicMesh

apply_mesh_polygroup_bevel(options, debug=None) DynamicMesh

Apply a Mesh Bevel operation to all PolyGroup Edges.

Parameters:
Return type:

DynamicMesh

apply_mesh_self_union(options, debug=None) DynamicMesh

Mesh-Boolean-Union an object with itself to repair self-intersections, remove floating geometry, etc.

Parameters:
Return type:

DynamicMesh

apply_mesh_shell(options, debug=None) DynamicMesh

Create a thickened shell from TargetMesh by offsetting the vertex positions along averaged vertex normals, inwards or outwards. Similar to ApplyMeshOffset but also includes the initial mesh (possibly flipped, if the offset is positive)

Parameters:
Return type:

DynamicMesh

apply_mesh_solidify(options, debug=None) DynamicMesh

Replaces the mesh with a voxelized-and-meshed approximation (VoxWrap operation).

Parameters:
Return type:

DynamicMesh

apply_perlin_noise_to_mesh(selection, options, debug=None) DynamicMesh

Applies 3D Perlin noise displacement to the Target Mesh.

Parameters:
Return type:

DynamicMesh

apply_pn_tessellation(options, tessellation_level=3, debug=None) DynamicMesh

Apply PN Tessellation to the Target Mesh as controlled by the Tessellation Level and the Options.

Parameters:
Return type:

DynamicMesh

apply_polygroup_catmull_clark_sub_d(subdivisions, group_layer, debug=None) DynamicMesh

Apply Polygroup Catmull Clark Sub D

Parameters:
Return type:

DynamicMesh

apply_selective_tessellation(selection, options, tessellation_level=1, pattern_type=SelectiveTessellatePatternType.CONCENTRIC_RINGS, debug=None) DynamicMesh

Selectively Tessellate a Selection of the Target Mesh or possibly the entire mesh as controlled by the Options.

Parameters:
Return type:

DynamicMesh

apply_simplify_to_planar(options, debug=None) DynamicMesh

Simplifies planar areas of the mesh that have more triangles than necessary. Note that it does not change the 3D shape of the mesh. Planar regions are identified by comparison of face normals using a Angle Threshold in the Options.

Parameters:
Return type:

DynamicMesh

apply_simplify_to_polygroup_topology(options, group_layer, debug=None) DynamicMesh

Simplifies the mesh down to the PolyGroup Topology. For example, the high-level faces of the mesh PolyGroups. Another example would be on a default Box-Sphere where simplifying to PolyGroup topology produces a box.

Parameters:
Return type:

DynamicMesh

apply_simplify_to_tolerance(tolerance, options, debug=None) DynamicMesh

Simplifies the mesh to a target geometric tolerance. Stops when any further simplification would result in a deviation from the input mesh larger than the tolerance. Behavior can be additionally controlled with the Options.

Parameters:
Return type:

DynamicMesh

apply_simplify_to_triangle_count(triangle_count, options, debug=None) DynamicMesh

Simplifies the mesh until a target triangle count is reached. Behavior can be additionally controlled with the Options.

Parameters:
Return type:

DynamicMesh

apply_simplify_to_vertex_count(vertex_count, options, debug=None) DynamicMesh

Simplifies the mesh until a target vertex count is reached. Behavior can be additionally controlled with the Options.

Parameters:
Return type:

DynamicMesh

apply_triangle_loop_sub_d(subdivisions, debug=None) DynamicMesh

Apply Triangle Loop Sub D

Parameters:
Return type:

DynamicMesh

apply_twist_warp_to_mesh(options, twist_orientation, twist_angle=45.000000, twist_extent=50.000000, debug=None) DynamicMesh

Applies a twist warp around an axis defined by the Twist Orientation transform. The extents of the affected region can be controlled by the Options.

Parameters:
Return type:

DynamicMesh

apply_uniform_remesh(remesh_options, uniform_options, debug=None) DynamicMesh

Apply Uniform Remeshing to the TargetMesh. warning: this function can be quite expensive. The results may be non-deterministic, and are expected to change in future versions.

Parameters:
Return type:

DynamicMesh

apply_uniform_tessellation(tessellation_level=3, debug=None) DynamicMesh

Apply Uniform Tessellation to the Target Mesh as controlled by the Tessellation Level and the Options.

Parameters:
Return type:

DynamicMesh

auto_generate_patch_builder_mesh_u_vs(uv_set_index, options, debug=None) DynamicMesh

Computes new UVs for the specified UV Channel using PatchBuilder method in the Options, and optionally packs.

Parameters:
Return type:

DynamicMesh

auto_generate_x_atlas_mesh_u_vs(uv_set_index, options, debug=None) DynamicMesh

Computes new UVs for the specified UV Channel using XAtlas, and optionally packs.

Parameters:
Return type:

DynamicMesh

auto_repair_normals(debug=None) DynamicMesh

Attempt to repair inconsistent normals in TargetMesh. Currently this is done in two passes. In the first pass, triangles with reversed orientation from their neighours are incrementally flipped until each connected component has a consistent orientation, if this is possible (note that this is not always globally possible, eg for a mobius-strip topology there is no consistent orientation). In the second pass, the “global” orientation is detected by casting rays from outside the mesh. This may produce incorrect results for meshes that are not closed.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

blur_mesh_vertex_colors(selection, num_iterations=1, strength=0.500000, blur_mode=GeometryScriptBlurColorMode.UNIFORM, options=[True, True, True, True], debug=None) DynamicMesh

Blur the color attribute of the mesh. If the mesh has no color attribute, the function returns the mesh unchanged.

Parameters:
  • selection (GeometryScriptMeshSelection) – Only vertices in the selection will have their color attribute blurred.

  • num_iterations (int32) – The number of blur iterations.

  • strength (double) – Each iteration, we will blur between the vertex of the color at the previous iteration and its neighbors’ average by Strength amount (expected to be in the zero to one range).

  • blur_mode (GeometryScriptBlurColorMode) – Determines how neighbors are weighted when computing their average.

  • options (GeometryScriptBlurMeshVertexColorsOptions) –

  • debug (GeometryScriptDebug) –

Return type:

DynamicMesh

build_bvh_for_mesh(debug=None) -> (DynamicMesh, output_bvh=GeometryScriptDynamicMeshBVH)

Builds a Bounding Volume Hierarchy (BVH) object for a mesh that can be used with multiple spatial queries.

Parameters:

debug (GeometryScriptDebug) –

Returns:

output_bvh (GeometryScriptDynamicMeshBVH):

Return type:

GeometryScriptDynamicMeshBVH

clear_material_i_ds(clear_value=0, debug=None) DynamicMesh

Resets all Material IDs on a mesh to the given ClearValue, or 0 if no ClearValue is provided. If Material IDs are not already enabled on the Target Mesh, this function will first enable them and then set the value.

Parameters:
Return type:

DynamicMesh

clear_polygroups(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

compact_material_i_ds(source_material_list, debug=None) -> (DynamicMesh, compacted_material_list=Array[MaterialInterface])

Compact the MaterialIDs of the TargetMesh, ie remove any un-used MaterialIDs and remap the remaining N in-use MaterialIDs to the range [0,N-1]. Optionally compute a Compacted list of Materials.

Parameters:
Returns:

compacted_material_list (Array[MaterialInterface]): new Compacted Material list, one-to-one with new compacted MaterialIDs

Return type:

Array[MaterialInterface]

compact_mesh(debug=None) DynamicMesh

Compacts the mesh’s vertices and triangles to remove any “holes” in the Vertex ID or Triangle ID lists.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

compute_mesh_convex_decomposition(copy_to_mesh, options, debug=None) -> (DynamicMesh, copy_to_mesh=DynamicMesh, copy_to_mesh_out=DynamicMesh)

Compute a Convex Hull Decomposition of the given TargetMesh. Assuming more than one hull is requested, multiple hulls will be returned that attempt to approximate the mesh. There is no guarantee that the entire mesh is contained in the hulls. warning: this function can be quite expensive, and the results are expected to change in the future as the Convex Decomposition algorithm is improved

Parameters:
Returns:

copy_to_mesh (DynamicMesh):

copy_to_mesh_out (DynamicMesh):

Return type:

tuple

compute_mesh_convex_hull(copy_to_mesh, selection, options, debug=None) -> (DynamicMesh, copy_to_mesh=DynamicMesh, copy_to_mesh_out=DynamicMesh)

Compute the Convex Hull of a given Mesh, or part of the mesh if an optional Selection is provided

Parameters:
Returns:

copy_to_mesh (DynamicMesh):

copy_to_mesh_out (DynamicMesh):

Return type:

tuple

compute_mesh_local_uv_param(center_point, center_point_triangle_id, radius=1.000000, use_interpolated_normal=False, tangent_y_direction=[0.000000, 0.000000, 0.000000], uv_rotation_deg=0.000000, debug=None) -> (DynamicMesh, vertex_i_ds=Array[int32], vertex_u_vs=Array[Vector2D])

Compute local UV parameterization on TargetMesh vertices around the given CenterPoint / Triangle. This method uses a Discrete Exponential Map parameterization, which unwraps the mesh locally based on geodesic distances and angles. The CenterPoint will have UV value (0,0), and the computed vertex UVs will be such that Length(UV) == geodesic distance.

Parameters:
  • center_point (Vector) – the center point of the parameterization. This point must lie on the triangle specified by CenterPointTriangleID

  • center_point_triangle_id (int32) – the ID of the Triangle that contains CenterPoint

  • radius (double) – the parameterization will be computed out to this geodesic radius

  • use_interpolated_normal (bool) – if true (default false), the normal frame used for the parameterization will be taken from the normal overlay, otherwise the CenterPointTriangleID normal will be used

  • tangent_y_direction (Vector) –

  • uv_rotation_deg (double) –

  • debug (GeometryScriptDebug) –

Returns:

vertex_i_ds (Array[int32]): output list of VertexIDs that UVs have been computed for, ie are within geodesic distance Radius from the CenterPoint

vertex_u_vs (Array[Vector2D]): output list of Vertex UVs that corresponds to VertexIDs

Return type:

tuple

compute_mesh_swept_hull(copy_to_mesh, projection_frame, options, debug=None) -> (DynamicMesh, copy_to_mesh=DynamicMesh, copy_to_mesh_out=DynamicMesh)

Compute the Swept Hull of a given Mesh for a given 3D Plane defined by ProjectionFrame. The Swept Hull is a linear sweep of the 2D convex hull of the mesh vertices projected onto the plane (the sweep precisely contains the mesh extents along the plane normal)

Parameters:
Returns:

copy_to_mesh (DynamicMesh):

copy_to_mesh_out (DynamicMesh):

Return type:

tuple

compute_non_uniform_point_sampling(options, non_uniform_options, debug=None) -> (DynamicMesh, samples=Array[Transform], sample_radii=Array[double], triangle_i_ds=GeometryScriptIndexList)

Compute a set of sample points lying on the surface of TargetMesh based on the provided sampling Options and NonUniformOptions. The sample points have radii in the range [Options.SamplingRadius, NonUniformOptions.MaxSamplingRadius], and are non-overlapping, ie the distance between two points is always larger than the sum of their respective radii.

Parameters:
Returns:

samples (Array[Transform]):

sample_radii (Array[double]):

triangle_i_ds (GeometryScriptIndexList):

Return type:

tuple

compute_point_sampling(options, debug=None) -> (DynamicMesh, samples=Array[Transform], triangle_i_ds=GeometryScriptIndexList)

Compute a set of sample points lying on the surface of TargetMesh based on the provided sampling Options. Samples are approximately uniformly distributed, and non-overlapping relative to the provided Options.SamplingRadius, ie the distance between any pair of samples if >= 2*SamplingRadius.

Parameters:
Returns:

samples (Array[Transform]): output list of sample points. Transform Location is sample position, Rotation orients Z with the triangle normal

triangle_i_ds (GeometryScriptIndexList): TriangleID that contains each sample point. Length is the same as Samples array.

Return type:

tuple

compute_polygroups_from_angle_threshold(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:
  • 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

compute_polygroups_from_polygon_detection(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

compute_smooth_bone_weights(skeleton, options, profile=['Default'], debug=None) DynamicMesh

Computes a smooth skin binding for the given mesh to the skeleton provided.

Parameters:
Return type:

DynamicMesh

compute_split_normals(split_options, calculate_options, debug=None) DynamicMesh

Recompute hard edges / split-normals for TargetMesh based on the provided SplitOptions, and then recompute the new shared triangle-vertex normals using the given CalculateOptions. The normal recomputation is identical to calling RecomputeNormals.

Parameters:
Return type:

DynamicMesh

compute_tangents(options, debug=None) DynamicMesh

Recompute Tangents for the TargetMesh, using the method and settings specified by FGeometryScriptTangentsOptions note: If recomputing Tangents for use with a DynamicMeshComponent, it is also necessary to set the Tangents Type on the Component to “Externally Provided”

Parameters:
Return type:

DynamicMesh

compute_triangle_barycentric_coords(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:
  • triangle_id (int32) –

  • point (Vector) –

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

compute_vertex_weighted_point_sampling(options, non_uniform_options, vertex_weights, debug=None) -> (DynamicMesh, samples=Array[Transform], sample_radii=Array[double], triangle_i_ds=GeometryScriptIndexList)

Compute a set of sample points lying on the surface of TargetMesh based on the provided sampling Options and NonUniformOptions. The sample points have radii in the range [Options.SamplingRadius, NonUniformOptions.MaxSamplingRadius], and are non-overlapping, ie the distance between two points is always larger than the sum of their respective radii.

Parameters:
Returns:

samples (Array[Transform]):

sample_radii (Array[double]):

triangle_i_ds (GeometryScriptIndexList):

Return type:

tuple

convert_components_to_polygroups(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

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

Create a Mesh Selection from the IndexArray.

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

convert_index_list_to_mesh_selection(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

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

Create a Mesh Selection from the IndexSet.

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

convert_mesh_selection(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

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

Convert a Mesh Selection to an Index Array

Parameters:

selection (GeometryScriptMeshSelection) –

Returns:

index_array (Array[int32]):

selection_type (GeometryScriptMeshSelectionType):

Return type:

tuple

convert_mesh_selection_to_index_list(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

convert_mesh_vertex_colors_linear_to_srgb(debug=None) DynamicMesh

Apply a Linear to SRGB color transformation on all vertex colors on the mesh.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

convert_mesh_vertex_colors_srgb_to_linear(debug=None) DynamicMesh

Apply a SRGB to Linear color transformation on all vertex colors on the mesh.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

convert_uv_islands_to_polygroups(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:
  • 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

copy_bones_from_mesh(target_mesh, debug=None) DynamicMesh

Copy the bone attributes (skeleton) from the SourceMesh to the TargetMesh.

Parameters:
Return type:

DynamicMesh

copy_mesh_selection_to_mesh(store_to_submesh, selection, append_to_existing=False, preserve_group_i_ds=False, debug=None) -> (DynamicMesh, store_to_submesh=DynamicMesh, store_to_submesh_out=DynamicMesh)

Extract the triangles identified by Selection from TargetMesh and copy/add them to StoreToSubmesh

Parameters:
  • store_to_submesh (DynamicMesh) –

  • selection (GeometryScriptMeshSelection) –

  • append_to_existing (bool) – if false (default), StoreToSubmesh is cleared, otherwise selected triangles are appended

  • preserve_group_i_ds (bool) – if true, GroupIDs of triangles on TargetMesh are preserved in StoreToSubmesh. Otherwise new GroupIDs are allocated.

  • debug (GeometryScriptDebug) –

Returns:

store_to_submesh (DynamicMesh):

store_to_submesh_out (DynamicMesh):

Return type:

tuple

copy_mesh_to_mesh(copy_to_mesh, debug=None) -> (DynamicMesh, copy_to_mesh=DynamicMesh, copy_to_mesh_out=DynamicMesh)

Set CopyToMesh to be the same mesh as CopyFromMesh

Parameters:
Returns:

copy_to_mesh (DynamicMesh):

copy_to_mesh_out (DynamicMesh):

Return type:

tuple

copy_mesh_to_mesh_uv_layer(to_uv_set_index, copy_to_mesh, only_uv_positions=True, debug=None) -> (DynamicMesh, copy_to_mesh=DynamicMesh, copy_to_mesh_out=DynamicMesh, found_topology_errors=bool, is_valid_uv_set=bool)

Transfer the 3D vertex positions and triangles of CopyFromUVMesh to the given UV Channel identified by ToUVChannel of CopyToMesh. 3D positions (X,Y,Z) will be copied as UV positions (X,Y), ie Z is ignored.

bOnlyUVPositions controls whether only UV positions will be updated, or if the UV topology will be fully replaced. When false, CopyFromUVMesh must currently have a MaxVertexID <= that of the UV Channel MaxElementID When true, CopyFromUVMesh must currently have a MaxTriangleID <= that of CopyToMesh

Parameters:
  • to_uv_set_index (int32) –

  • copy_to_mesh (DynamicMesh) –

  • only_uv_positions (bool) – if true, only (valid, matching) UV positions are updated, a full new UV topology is created

  • debug (GeometryScriptDebug) –

Returns:

copy_to_mesh (DynamicMesh):

copy_to_mesh_out (DynamicMesh):

found_topology_errors (bool):

is_valid_uv_set (bool): will be returned false if To UV Channel is not available

Return type:

tuple

copy_mesh_uv_layer_to_mesh(uv_set_index, copy_to_uv_mesh, debug=None) -> (DynamicMesh, copy_to_uv_mesh=DynamicMesh, copy_to_uv_mesh_out=DynamicMesh, invalid_topology=bool, is_valid_uv_set=bool)

Copy the 2D UVs from the given UV Channel in CopyFromMesh to the 3D vertex positions in CopyToUVMesh, with the triangle mesh topology defined by the UV Channel. Generally this “UV Mesh” topology will not be the same as the 3D mesh topology. PolyGroup IDs and Material IDs are preserved in the UVMesh.

2D UV Positions are copied to 3D as (X, Y, 0)

CopyMeshToMeshUVChannel will copy the 3D UV Mesh back to the UV Channel. This pair of functions can then be used to implement UV generation/editing via other mesh functions.

Parameters:
Returns:

copy_to_uv_mesh (DynamicMesh):

copy_to_uv_mesh_out (DynamicMesh):

invalid_topology (bool): will be returned true if any topological issues were found

is_valid_uv_set (bool): will be returned false if UVSetIndex is not available

Return type:

tuple

copy_polygroups_layer(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

copy_uv_set(from_uv_set, to_uv_set, debug=None) DynamicMesh

Copy the data in one UV Channel to another UV Channel on the same Target Mesh.

Parameters:
Return type:

DynamicMesh

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

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

Parameters:

selection_type (GeometryScriptMeshSelectionType) –

Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

create_surface_path(direction, start_triangle_id, start_bary_coords, max_path_length, debug=None) -> (DynamicMesh, surface_path=GeometryScriptPolyPath, found_errors=bool)

Computes a PolyPath that represents a “straight” surface path starting at the prescribed point on the mesh, and continuing in the indicated direction until reaching the requested path length or encountering a mesh boundary, whichever comes first.

Parameters:
  • direction (Vector) – is a three-dimensional vector that is projected onto the mesh surface to determine the path direction.

  • start_triangle_id (int32) – the ID of mesh Triangle that contains the start point of the path.

  • start_bary_coords (Vector) – indicates the location of start point within the start triangle, in terms of barycentric coordinates.

  • max_path_length (float) – sets the maximal length of the path, but the actual path may be shorter as it automatically terminates when encountering a mesh boundary edge.

  • debug (GeometryScriptDebug) –

Returns:

surface_path (GeometryScriptPolyPath): holds on return a PolyPath that forms a “straight” path along the mesh surface from the start position.

found_errors (bool):

Return type:

tuple

delete_selected_triangles_from_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

delete_triangle_from_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:
  • triangle_id (int32) –

  • defer_change_notifications (bool) –

Returns:

was_triangle_deleted (bool):

Return type:

bool

delete_triangles_by_material_id(material_id, defer_change_notifications=False, debug=None) -> (DynamicMesh, num_deleted=int32)

Delete all triangles in TargetMesh with the given MaterialID

Parameters:
Returns:

num_deleted (int32): number of deleted triangles is returned here

Return type:

int32

delete_triangles_from_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

delete_triangles_in_polygroup(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

delete_vertex_from_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:
  • vertex_id (int32) –

  • defer_change_notifications (bool) –

Returns:

was_vertex_deleted (bool):

Return type:

bool

delete_vertices_from_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

discard_bones_from_mesh(debug=None) DynamicMesh

Discard the bone attributes (skeleton) from the TargetMesh.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

discard_mesh_attributes(defer_change_notifications=False) DynamicMesh

Discard Mesh Attributes

Parameters:

defer_change_notifications (bool) –

Return type:

DynamicMesh

discard_tangents(debug=None) DynamicMesh

Remove any existing Tangents Attribute Layer from the TargetMesh

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

enable_material_i_ds(debug=None) DynamicMesh

Enables per-triangle Material IDs on a mesh and initializes the values to 0. If Target Mesh already has Material IDs, this function will do nothing.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

enable_polygroups(debug=None) DynamicMesh

Enables the standard PolyGroup Layer on the Target Mesh.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

expand_contract_mesh_selection(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:
  • 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

expand_mesh_selection_to_connected(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

fill_all_mesh_holes(fill_options, debug=None) -> (DynamicMesh, num_filled_holes=int32, num_failed_hole_fills=int32)

Tries to fill all open boundary loops (such as holes in the geometry surface) of a mesh.

Parameters:
Returns:

num_filled_holes (int32): reports the number of holes filled by the function.

num_failed_hole_fills (int32):

Return type:

tuple

find_nearest_point_on_mesh(query_bvh, query_point, options, debug=None) -> (DynamicMesh, nearest_result=GeometryScriptTrianglePoint, outcome=GeometryScriptSearchOutcomePins)

Finds the nearest point (Nearest Result) on the Target Mesh to a given 3D point (Query Point) by using the Query BVH.

Parameters:
Returns:

nearest_result (GeometryScriptTrianglePoint): on return, holds the nearest point on the mesh to the QueryPoint

outcome (GeometryScriptSearchOutcomePins): will be either Found or Not Found depending on the success of the query. Note NearestResult.bValid will be false if the query failed.

Return type:

tuple

find_nearest_ray_intersection_with_mesh(query_bvh, ray_origin, ray_direction, options, debug=None) -> (DynamicMesh, hit_result=GeometryScriptRayHitResult, outcome=GeometryScriptSearchOutcomePins)

Finds the nearest intersection of a 3D ray with the mesh by using the Query BVH. Note, depending on the Ray Origin and Ray Direction, there is the possibility that the ray might not intersect with the Target Mesh. Should the ray miss, the HitResult.bHit will be false and the Outcome will be Not Found.

Parameters:
Returns:

hit_result (GeometryScriptRayHitResult):

outcome (GeometryScriptSearchOutcomePins):

Return type:

tuple

flip_normals(debug=None) DynamicMesh

Flip/Invert the normal vectors of TargetMesh by multiplying them by -1, as well as reversing the mesh triangle orientations, ie triangle (a,b,c) becomes (b,a,c)

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

get_all_bones_info(debug=None) -> (DynamicMesh, bones_info=Array[GeometryScriptBoneInfo])

Get an array of bones representing the skeleton. Each entry contains information about the bone.

Parameters:

debug (GeometryScriptDebug) –

Returns:

bones_info (Array[GeometryScriptBoneInfo]): Skeleton information.

Return type:

Array[GeometryScriptBoneInfo]

get_all_split_u_vs_at_vertex(uv_set_index, vertex_id) -> (DynamicMesh, element_i_ds=Array[int32], element_u_vs=Array[Vector2D], have_valid_u_vs=bool)

Returns the unique UV element IDs and values associated with the mesh vertex, in the specified UV Channel. If the Vertex or UV channel does not exist, the arrays will be empty and bHaveValidUVs will be set to false.

Parameters:
  • uv_set_index (int32) –

  • vertex_id (int32) –

Returns:

element_i_ds (Array[int32]):

element_u_vs (Array[Vector2D]):

have_valid_u_vs (bool):

Return type:

tuple

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

Returns an Index List of all Triangle IDs in a mesh.

Returns:

triangle_id_list (GeometryScriptIndexList):

has_triangle_id_gaps (bool): will be true on return if there are breaks in the sequential numeration of Triangle IDs, as would happen after deleting triangles.

Return type:

tuple

get_all_triangle_indices(skip_gaps) -> (DynamicMesh, triangle_list=GeometryScriptTriangleList, has_triangle_id_gaps=bool)
  • Returns a TriangleList of all Triangle Vertex ID triplets in a mesh.

Parameters:

skip_gaps (bool) – if false there will be a one-to-one correspondence between Triangle ID and entries in the triangle list and invalid triplets of (-1,-1,-1) will correspond to Triangle IDs not found in the Target Mesh. *

Returns:

triangle_list (GeometryScriptTriangleList):

has_triangle_id_gaps (bool): will be false on return if the mesh had no gaps in Triangle IDs or if bSkipGaps was set to true.

Return type:

tuple

get_all_triangle_material_i_ds() -> (DynamicMesh, material_id_list=GeometryScriptIndexList, has_material_i_ds=bool)

Returns an Index List of all triangle Material IDs, constructed with one entry for each consecutive Triangle ID. If Material IDs are not enabled on the mesh, bHasMaterialsIDs will be set to false on return and nothing will be added to the Material ID List. warning: if the mesh is not Triangle-Compact (eg GetHasTriangleIDGaps == false) then the returned list will also have the same gaps where the number -1 will be recorded for any missing Triangle IDs.

Returns:

material_id_list (GeometryScriptIndexList):

has_material_i_ds (bool):

Return type:

tuple

get_all_triangle_polygroup_i_ds(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

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

Returns an IndexList of all Vertex IDs in mesh.

Returns:

vertex_id_list (GeometryScriptIndexList):

has_vertex_id_gaps (bool):

Return type:

tuple

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

Returns a Vector List of all the mesh vertex 3D positions (possibly large!).

Parameters:

skip_gaps (bool) – if false there will be a one-to-one correspondence between Vertex ID and entries in the Position List where a zero vector (0,0,0) will correspond to Vertex IDs not found in the Target Mesh.

Returns:

position_list (GeometryScriptVectorList):

has_vertex_id_gaps (bool): will be false if the mesh had no gaps in Vertex IDs or if bSkipGaps was set to true.

Return type:

tuple

get_bone_children(bone_name, recursive, debug=None) -> (DynamicMesh, is_valid_bone_name=bool, children_info=Array[GeometryScriptBoneInfo])

Get the information about the children of the bone.

Parameters:
  • bone_name (Name) – The name of bone.

  • recursive (bool) – If set to true, grandchildren will also be added recursively

  • debug (GeometryScriptDebug) –

Returns:

is_valid_bone_name (bool): Set to true if the TargetMesh contains a bone with the given name, false otherwise.

children_info (Array[GeometryScriptBoneInfo]): The informattion of the children.

Return type:

tuple

get_bone_index(bone_name, debug=None) -> (DynamicMesh, is_valid_bone_name=bool, bone_index=int32)

Get Bone Index

Parameters:
Returns:

is_valid_bone_name (bool):

bone_index (int32):

Return type:

tuple

get_bone_info(bone_name, debug=None) -> (DynamicMesh, is_valid_bone_name=bool, bone_info=GeometryScriptBoneInfo)

Get the bone information.

Parameters:
Returns:

is_valid_bone_name (bool): Set to true if the TargetMesh contains a bone with the given name, false otherwise.

bone_info (GeometryScriptBoneInfo): The information about the bone.

Return type:

tuple

get_has_material_i_ds() bool

Returns true if the mesh has Material IDs available/enabled.

Return type:

bool

get_has_polygroups() bool

Returns true if the mesh has a standard PolyGroup Layer.

Return type:

bool

get_has_triangle_id_gaps() bool

Returns true if there are gaps in the Triangle ID list, such that Get Num Triangle IDs is greater than Get Triangle Count.

Return type:

bool

get_has_triangle_normals() bool
Returns:

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

Return type:

bool

get_has_vertex_colors() bool
Returns:

true if the TargetMesh has the Vertex Colors attribute enabled

Return type:

bool

get_has_vertex_id_gaps() bool

Returns true if there are gaps in the Vertex ID list. For example, Get Number of Vertex IDs is greater than Get Vertex Count.

Return type:

bool

get_interpolated_triangle_normal(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:
  • 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

get_interpolated_triangle_normal_tangents(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:
  • 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

get_interpolated_triangle_position(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:
  • 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

get_interpolated_triangle_uv(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:
  • uv_set_index (int32) –

  • triangle_id (int32) –

  • barycentric_coords (Vector) –

Returns:

tri_has_valid_u_vs (bool):

interpolated_uv (Vector2D):

Return type:

tuple

get_interpolated_triangle_vertex_color(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:
  • triangle_id (int32) –

  • barycentric_coords (Vector) –

  • default_color (LinearColor) –

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

get_is_closed_mesh() bool

Returns true if the mesh is closed, such as no topological boundary edges.

Return type:

bool

get_is_dense_mesh() bool

Returns true if the mesh is dense. For example, no gaps in Vertex IDs or Triangle IDs. Note if a mesh is not dense, the Compact Mesh node can be used to removed the gaps.

Return type:

bool

get_largest_vertex_bone_weight(vertex_id, profile=["Default"]) -> (DynamicMesh, bone_weight=GeometryScriptBoneWeight, has_valid_bone_weights=bool)

Return the Bone/Skin Weight with the maximum weight at a given vertex of TargetMesh

Parameters:
Returns:

bone_weight (GeometryScriptBoneWeight): the bone index and weight that was found to have the maximum weight

has_valid_bone_weights (bool): will be returned as true if the vertex has bone weights in the given profile and a largest weight was found

Return type:

tuple

get_material_i_ds_of_triangles(triangle_id_list, debug=None) -> (DynamicMesh, material_id_list=GeometryScriptIndexList)

This populates the MaterialIDList with Material IDs for each triangle in the TriangleIDList. If a triangle is not present in the Target Mesh the number -1 will be used for the corresponding Material ID. If Material IDs are not enabled on the TargetMesh no Material IDs will be added to the result list.

Parameters:
Returns:

material_id_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

get_max_bone_weight_index(profile=["Default"]) -> (DynamicMesh, has_bone_weights=bool, max_bone_index=int32)

Determine the largest bone weight index that exists on the Mesh

Parameters:

profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile

Returns:

has_bone_weights (bool): will be returned true if the requested bone weight profile exists

max_bone_index (int32): maximum bone index will be returned here, or -1 if no bone indices exist

Return type:

tuple

get_max_material_id() -> (int32, has_material_i_ds=bool)

Get Max Material ID

Returns:

has_material_i_ds (bool):

Return type:

bool

get_mesh_bounding_box() Box

Computes the bounding box of the mesh vertices in the local space of the mesh.

Return type:

Box

get_mesh_has_attribute_set() bool

Returns true if the Target Mesh has attributes enabled.

Return type:

bool

get_mesh_has_tangents(debug=None) -> (DynamicMesh, has_tangents=bool)

Check if the TargetMesh has a Tangents Attribute Layer enabled

Parameters:

debug (GeometryScriptDebug) –

Returns:

has_tangents (bool):

Return type:

bool

get_mesh_info_string() str

Returns information about the Target Mesh, such as the vertex and triangle count as well as some attribute information.

Return type:

str

get_mesh_per_vertex_colors(blend_split_vertex_values=True) -> (DynamicMesh, color_list=GeometryScriptColorList, is_valid_color_set=bool, has_vertex_id_gaps=bool)

Get a list of single vertex colors for each mesh vertex in the TargetMesh, derived from the VertexColor Overlay. The VertexColor Overlay may store multiple colors for a single vertex (ie different colors for that vertex on different triangles) In such cases the colors can either be averaged, or the last color seen will be used, depending on the bBlendSplitVertexValues parameter.

Parameters:

blend_split_vertex_values (bool) – control how multiple colors at the same vertex should be interpreted

Returns:

color_list (GeometryScriptColorList): output color list will be stored here. Size will be equal to the MaxVertexID of TargetMesh (not the VertexCount!)

is_valid_color_set (bool): will be set to true if the VertexColor Overlay was valid

has_vertex_id_gaps (bool): will be set to true if some vertex indices in TargetMesh were invalid, ie MaxVertexID > VertexCount

Return type:

tuple

get_mesh_per_vertex_normals(average_split_vertex_values=True) -> (DynamicMesh, normal_list=GeometryScriptVectorList, is_valid_normal_set=bool, has_vertex_id_gaps=bool)

Get a list of single normal vectors for each mesh vertex in the TargetMesh, derived from the Normals Overlay. The Normals Overlay may store multiple normals for a single vertex (ie split normals) In such cases the normals can either be averaged, or the last normal seen will be used, depending on the bAverageSplitVertexValues parameter.

Parameters:

average_split_vertex_values (bool) – control how multiple normals at the same vertex should be interpreted

Returns:

normal_list (GeometryScriptVectorList): output normal list will be stored here. Size will be equal to the MaxVertexID of TargetMesh (not the VertexCount!)

is_valid_normal_set (bool): will be set to true if the Normal Overlay was valid

has_vertex_id_gaps (bool): will be set to true if some vertex indices in TargetMesh were invalid, ie MaxVertexID > VertexCount

Return type:

tuple

get_mesh_per_vertex_tangents(average_split_vertex_values=True) -> (DynamicMesh, tangent_x_list=GeometryScriptVectorList, tangent_y_list=GeometryScriptVectorList, is_valid_tangent_set=bool, has_vertex_id_gaps=bool)

Get a list of single tangent vectors for each mesh vertex in the TargetMesh, derived from the Tangents Overlays. The Tangents Overlay may store multiple tangents for a single vertex (ie split tangents) In such cases the tangents can either be averaged, or the last tangent seen will be used, depending on the bAverageSplitVertexValues parameter.

Parameters:

average_split_vertex_values (bool) – control how multiple tangents at the same vertex should be interpreted

Returns:

tangent_x_list (GeometryScriptVectorList): output Tangent “X” vectors list will be stored here. Size will be equal to the MaxVertexID of TargetMesh (not the VertexCount!)

tangent_y_list (GeometryScriptVectorList): output Tangent “Y” vectors (Binormal/Bitangent) list will be stored here. Size will be equal to TangentXList

is_valid_tangent_set (bool): will be set to true if the Tangent Overlay was valid

has_vertex_id_gaps (bool): will be set to true if some vertex indices in TargetMesh were invalid, ie MaxVertexID > VertexCount

Return type:

tuple

get_mesh_per_vertex_u_vs(uv_set_index, debug=None) -> (DynamicMesh, uv_list=GeometryScriptUVList, is_valid_uv_set=bool, has_vertex_id_gaps=bool, has_split_u_vs=bool)

Get a list of single vertex UVs for each mesh vertex in the TargetMesh, derived from the specified UV Channel. The UV Channel may store multiple UVs for a single vertex (along UV seams) In such cases an arbitrary UV will be stored for that vertex, and bHasSplitUVs will be returned as true

Parameters:
Returns:

uv_list (GeometryScriptUVList): output UV list will be stored here. Size will be equal to the MaxVertexID of TargetMesh (not the VertexCount!)

is_valid_uv_set (bool): will be set to true if the UV Channel was valid

has_vertex_id_gaps (bool): will be set to true if some vertex indices in TargetMesh were invalid, ie MaxVertexID > VertexCount

has_split_u_vs (bool): will be set to true if there were split UVs in the UV Channel

Return type:

tuple

get_mesh_selection_boundary_loops(selection, debug=None) -> (DynamicMesh, index_loops=Array[GeometryScriptIndexList], path_loops=Array[GeometryScriptPolyPath], num_loops=int32, found_errors=bool)

Compute the set of Vertex Loops bordering a Mesh Selection. Both the 3D polylines and lists of vertex indices are returned for each Loop. Note that for a Vertex selection this will function return the border loops around the set of vertex triangle one-rings.

Parameters:
Returns:

index_loops (Array[GeometryScriptIndexList]): for each discovered Loop, the IndexList of mesh vertex indices around the loop is returned here

path_loops (Array[GeometryScriptPolyPath]): for each discovered Loop, the PolyPath of mesh vertex positions around the loop is returned here. The ordering for each loop is the same as IndexLoops.

num_loops (int32): number of loops found is returned here

found_errors (bool): true is returned here if topological errors were found during loop computation. In this case the Loop set may be incomplete.

Return type:

tuple

get_mesh_selection_bounding_box(selection, debug=None) -> (DynamicMesh, selection_bounds=Box, is_empty=bool)

Get the 3D Bounding Box of a Mesh Selection, ie bounding box of vertices contained in the Selection

Parameters:
Returns:

selection_bounds (Box):

is_empty (bool): will return as true if the selection was empty (the box will be initialized to 0 in this case)

Return type:

tuple

get_mesh_triangle_uv_element_i_ds(uv_set_index, triangle_id) -> (DynamicMesh, triangle_uv_elements=IntVector, have_valid_u_vs=bool)

Returns the UV Element IDs associated with the three vertices of the triangle in the specified UV Channel. If the Triangle does not exist in the mesh or if no UVs are set in the specified UV Channel for the triangle, bHaveValidUVs will be returned as false.

Parameters:
  • uv_set_index (int32) –

  • triangle_id (int32) –

Returns:

triangle_uv_elements (IntVector):

have_valid_u_vs (bool):

Return type:

tuple

get_mesh_uv_element_position(uv_set_index, element_id) -> (DynamicMesh, uv_position=Vector2D, is_valid_element_id=bool)

Returns the UV Position for a given UV Element ID in the specified UV Channel. If the UV Set or Element ID does not exist, bIsValidElementID will be returned as false.

Parameters:
  • uv_set_index (int32) –

  • element_id (int32) –

Returns:

uv_position (Vector2D):

is_valid_element_id (bool):

Return type:

tuple

get_mesh_uv_size_info(uv_set_index, selection, only_include_valid_uv_tris=True, debug=None) -> (DynamicMesh, mesh_area=double, uv_area=double, mesh_bounds=Box, uv_bounds=Box2D, is_valid_uv_set=bool, found_unset_u_vs=bool)

Compute information about dimensions and areas for a UV Set of a Mesh, with an optional Mesh Selection

Parameters:
  • uv_set_index (int32) – index of UV Channel to query

  • selection (GeometryScriptMeshSelection) – subset of triangles to process, whole mesh is used if selection is not provided

  • only_include_valid_uv_tris (bool) – if true, only triangles with valid UVs are included in 3D Mesh Area/Bounds

  • debug (GeometryScriptDebug) –

Returns:

mesh_area (double): output 3D area of queried triangles

uv_area (double): output 2D UV-space area of queried triangles

mesh_bounds (Box): output 3D bounding box of queried triangles

uv_bounds (Box2D): output 2D UV-space bounding box of queried triangles

is_valid_uv_set (bool): output flag set to false if UV Channel does not exist on the target mesh. In this case Areas and Bounds are not initialized.

found_unset_u_vs (bool): output flag set to true if any of the queried triangles do not have valid UVs set

Return type:

tuple

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

Computes the volume and area of the mesh.

Returns:

surface_area (float):

volume (float):

Return type:

tuple

get_mesh_volume_area_center() -> (surface_area=float, volume=float, center_of_mass=Vector)

Computes the volume, area and center-of-mass of the mesh.

Returns:

surface_area (float):

volume (float):

center_of_mass (Vector):

Return type:

tuple

get_num_connected_components() int32

Returns the number of separate connected components in the mesh, such as “triangle patches” internally connected by shared edges.

Return type:

int32

get_num_extended_polygroup_layers() int32

Returns the count of extended PolyGroup Layers.

Return type:

int32

get_num_open_border_edges() int32

Returns the number of topological boundary edges in the mesh, i.e counts edges that only have one adjacent triangle.

Return type:

int32

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

Returns the number of open border loops, such as “holes” in the mesh.

Returns:

ambiguous_topology_found (bool):

Return type:

bool

get_num_triangle_i_ds() int32

Gets the number of Triangle IDs in the mesh. This may be larger than the Triangle Count if the mesh is not dense, even after deleting triangles.

Return type:

int32

get_num_uv_sets() int32

Gets the number of UV Channels on the Target Mesh.

Return type:

int32

get_num_vertex_i_ds() int32

Gets the number of Vertex IDs in the mesh, which may be larger than the Vertex Count, if the mesh is not dense (e.g. after deleting vertices).

Return type:

int32

get_polygroup_i_ds_in_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

get_root_bone_name(debug=None) -> (DynamicMesh, bone_name=Name)

Get the name of the root bone.

Parameters:

debug (GeometryScriptDebug) –

Returns:

bone_name (Name): The name of the root bone.

Return type:

Name

get_shortest_surface_path(start_triangle_id, start_bary_coords, end_triangle_id, end_bary_coords, debug=None) -> (DynamicMesh, shortest_path=GeometryScriptPolyPath, found_errors=bool)

Computes a PolyPath that represents the shortest mesh surface path between two prescribed points on the provided mesh. This can fail if the Start and End points are within separate connected components of the mesh.

Parameters:
  • start_triangle_id (int32) – the ID of mesh Triangle that contains the start point of the path.

  • start_bary_coords (Vector) – indicates the location of start point within the start triangle, in terms of barycentric coordinates.

  • end_triangle_id (int32) – the ID of mesh Triangle that contains the end point of the path.

  • end_bary_coords (Vector) – indicates the location of the end point within the end triangle, in terms of barycentric coordinates.

  • debug (GeometryScriptDebug) –

Returns:

shortest_path (GeometryScriptPolyPath):

found_errors (bool):

Return type:

tuple

get_shortest_vertex_path(start_vertex_id, end_vertex_id, debug=None) -> (DynamicMesh, vertex_id_list=GeometryScriptIndexList, found_errors=bool)

Computes a vertex list that represents the shortest path constrained to travel along mesh triangle edges between the prescribed start and end vertex. This can fail if the Start and End points are within separate connected components of the mesh.

Parameters:
  • start_vertex_id (int32) – indicates ID of mesh vertex that defines the starting point of the path.

  • end_vertex_id (int32) – indicates ID of the mesh vertex that defined the end point of the path.

  • debug (GeometryScriptDebug) –

Returns:

vertex_id_list (GeometryScriptIndexList):

found_errors (bool): will be false on success.

Return type:

tuple

get_sub_mesh_from_mesh(store_to_submesh, triangle_list, debug=None) -> (DynamicMesh, store_to_submesh=DynamicMesh, store_to_submesh_out=DynamicMesh)

CopyMeshSelectionToMesh should be used instead of this function

Parameters:
Returns:

store_to_submesh (DynamicMesh):

store_to_submesh_out (DynamicMesh):

Return type:

tuple

get_triangle_count() int32
Returns:

number of triangles in the mesh

Return type:

int32

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

Get Triangle Face Normal

Parameters:

triangle_id (int32) –

Returns:

is_valid_triangle (bool):

Return type:

bool

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

Returns the Vertex ID triplet for the specified Triangle.

Parameters:

triangle_id (int32) – indicates the triangle to query on the Target Mesh.

Returns:

is_valid_triangle (bool): will be false on return if the Triangle ID does not exist in the Target Mesh, in that case the returned vertex triplet will be (-1, -1, -1).

Return type:

bool

get_triangle_material_id(triangle_id) -> (int32, is_valid_triangle=bool)

Returns the current Material ID for a Triangle. If the mesh does not have Material IDs enabled or if the Triangle ID is not an element of the mesh, the value 0 will be returned and bIsValidTriangle will be false.

Parameters:

triangle_id (int32) –

Returns:

is_valid_triangle (bool):

Return type:

bool

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

For the specified Triangle ID 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, i.e. they will potentially be split-normals.

Parameters:

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

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

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

Parameters:

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

get_triangle_polygroup_id(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:
  • 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

get_triangle_positions(triangle_id) -> (is_valid_triangle=bool, vertex1=Vector, vertex2=Vector, vertex3=Vector)
  • Returns the 3D positions (in the mesh local space) of the three vertices of the requested triangle.

  • If the Triangle ID is not an element of the Target Mesh, all three vertices will be returned as (0, 0, 0) and bIsValidTriangle will be set to false.

Parameters:

triangle_id (int32) –

Returns:

is_valid_triangle (bool):

vertex1 (Vector):

vertex2 (Vector):

vertex3 (Vector):

Return type:

tuple

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

Returns the UV values associated with the three vertices of the triangle in the specified UV Channel. If the Triangle does not exist in the mesh or if no UVs are set in the specified UV Channel for the triangle, the resulting values will be (0,0) and bHaveValidUVs will be set to false.

Parameters:
  • uv_set_index (int32) –

  • triangle_id (int32) –

Returns:

uv1 (Vector2D):

uv2 (Vector2D):

uv3 (Vector2D):

have_valid_u_vs (bool):

Return type:

tuple

get_triangle_vertex_colors(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:

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

get_triangles_by_material_id(material_id, debug=None) -> (DynamicMesh, triangle_id_list=GeometryScriptIndexList)

Populates Triangle ID List with the Triangle IDs of triangles that share the specified Material ID in the Target Mesh.

Parameters:
Returns:

triangle_id_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

get_triangles_in_polygroup(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

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

Gets the 2D bounding box of all UVs in the UV Channel. If the UV Channel does not exist, or if the UV Channel is empty, the resulting box will be invalid.

Parameters:

uv_set_index (int32) –

Returns:

is_valid_uv_set (bool):

uv_set_is_empty (bool):

Return type:

tuple

get_vertex_bone_weights(vertex_id, profile=["Default"]) -> (DynamicMesh, bone_weights=Array[GeometryScriptBoneWeight], has_valid_bone_weights=bool)

Return an array of Bone/Skin Weights at a given vertex of TargetMesh

Parameters:
Returns:

bone_weights (Array[GeometryScriptBoneWeight]): output array of bone index/weight pairs for the given Vertex

has_valid_bone_weights (bool): will be returned as true if the vertex has bone weights in the given profile, ie BoneWeights is valid

Return type:

tuple

get_vertex_connected_triangles(vertex_id) -> (DynamicMesh, triangles=Array[int32])

Return array of Triangle IDs connected to the given VertexID, ie the triangle one-ring

Parameters:

vertex_id (int32) –

Returns:

triangles (Array[int32]):

Return type:

Array[int32]

get_vertex_connected_vertices(vertex_id) -> (DynamicMesh, vertices=Array[int32])

Return array of Vertex IDs connected via a mesh edge to the given VertexID, ie the vertex one-ring

Parameters:

vertex_id (int32) –

Returns:

vertices (Array[int32]):

Return type:

Array[int32]

get_vertex_count() int32

Gets the number of vertices in the mesh. Note this may be less than the number of Vertex IDs used as some vertices may have been deleted.

Return type:

int32

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

Gets the 3D position of a mesh vertex in the mesh local space, by Vertex ID.

Parameters:

vertex_id (int32) –

Returns:

is_valid_vertex (bool):

Return type:

bool

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

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

Parameters:
  • 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

is_bvh_valid_for_mesh(test_bvh, debug=None) -> (DynamicMesh, is_valid=bool)

Checks if the provided Bounding Volume Hierarchy (BVH) can still be used with the Mesh — it generally returns false if the mesh has been changed.

Parameters:
Returns:

is_valid (bool):

Return type:

bool

is_empty() bool
Returns:

true if the mesh has no triangles

Return type:

bool

is_intersecting_mesh(target_transform, other_mesh, other_transform, debug=None) -> (DynamicMesh, is_intersecting=bool)

Returns true if the two input meshes (with optional transforms) are geometrically intersecting.

Parameters:
Returns:

is_intersecting (bool):

Return type:

bool

is_point_inside_mesh(query_bvh, query_point, options, debug=None) -> (DynamicMesh, is_inside=bool, outcome=GeometryScriptContainmentOutcomePins)

Tests if a point is inside the mesh using the Fast Winding Number query and data stored in the BVH.

Parameters:
Returns:

is_inside (bool):

outcome (GeometryScriptContainmentOutcomePins):

Return type:

tuple

is_same_mesh_as(other_mesh, options, debug=None) -> (DynamicMesh, is_same_mesh=bool)

Returns true if the two input meshes are equivalent under the comparisons defined by the input options.

Parameters:
Returns:

is_same_mesh (bool):

Return type:

bool

is_valid_triangle_id(triangle_id) bool

Returns true if Triangle ID refers to a valid Triangle in the Target Mesh.

Parameters:

triangle_id (int32) –

Return type:

bool

is_valid_vertex_id(vertex_id) bool

Returns true if Vertex ID refers to a valid vertex in the Target Mesh.

Parameters:

vertex_id (int32) –

Return type:

bool

measure_distances_between_meshes(other_mesh, options, debug=None) -> (DynamicMesh, max_distance=double, min_distance=double, average_distance=double, root_mean_sqr_deviation=double)

Measures the min/max and average closest-point distances between two meshes.

Parameters:
Returns:

max_distance (double):

min_distance (double):

average_distance (double):

root_mean_sqr_deviation (double):

Return type:

tuple

mesh_create_bone_weights(replace_existing_profile=False, profile=["Default"]) -> (DynamicMesh, profile_existed=bool)

Create a new BoneWeights attribute on the TargetMesh, if it does not already exist. If it does exist, and bReplaceExistingProfile is passed as true, the attribute will be removed and re-added, to reset it.

Parameters:
  • replace_existing_profile (bool) – if true, if the Profile already exists, it is reset

  • profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile

Returns:

profile_existed (bool): will be returned true if the requested bone weight profile already existed

Return type:

bool

mesh_has_bone_weights(profile=["Default"]) -> (DynamicMesh, has_bone_weights=bool)

Check whether the TargetMesh has a per-vertex Bone/Skin Weight Attribute set

Parameters:

profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile

Returns:

has_bone_weights (bool): will be returned true if the requested bone weight profile exists

Return type:

bool

property mesh_modified_bp_event: OnDynamicMeshModifiedBP

[Read-Write] Blueprintable event called when mesh is modified, in the same cases as OnMeshChanged

Type:

(OnDynamicMeshModifiedBP)

rebuild_bvh_for_mesh(update_bvh, only_if_invalid=True, debug=None) -> (DynamicMesh, update_bvh=GeometryScriptDynamicMeshBVH)

Rebuilds the Bounding Volume Hierarchy (BVH) for the mesh in-place, which can reduce memory allocations, compared to building a new BVH.

Parameters:
Returns:

update_bvh (GeometryScriptDynamicMeshBVH):

Return type:

GeometryScriptDynamicMeshBVH

recompute_mesh_u_vs(uv_set_index, options, selection, debug=None) DynamicMesh

Recomputes UVs in the UV Channel for a Mesh based on different types of well-defined UV islands, such as existing UV islands, PolyGroups, or a subset of the mesh based on a non-empty Selection.

Parameters:
Return type:

DynamicMesh

recompute_normals(calculate_options, defer_change_notifications=False, debug=None) DynamicMesh

Recompute the normals of TargetMesh using the given CalculateOptions. This method will preserve any existing hard edges, ie each shared triangle-vertex normal is recomputed by averaging the face normals of triangles that reference that shared triangle-vertex normal

Parameters:
Return type:

DynamicMesh

recompute_normals_for_mesh_selection(selection, calculate_options, defer_change_notifications=False, debug=None) DynamicMesh

Recompute the normals of TargetMesh on all the triangles/vertices of the given Selection using the given CalculateOptions. This method will preserve any existing hard edges, ie each shared triangle-vertex normal is recomputed by averaging the face normals of triangles that reference that shared triangle-vertex normal

Parameters:
Return type:

DynamicMesh

remap_material_i_ds(from_material_id, to_material_id, debug=None) DynamicMesh

For all triangles with a Material ID matching the given value (From Material ID), update the Material ID to the new value (To Material ID).

Parameters:
Return type:

DynamicMesh

remap_to_new_material_i_ds_by_material(from_material_list, to_material_list, missing_material_id=-1, debug=None) DynamicMesh

Remap the Material IDs of the TargetMesh to a new set of Material IDs based on a ‘From’/Current Material List, and a New Material List. For each triangle, the current Material is determined as FromMaterialList[MaterialID], and then the first index of this Material is found in the ToMaterialList, and this index is used as the new MaterialID

If a Material cannot be found in ToMaterialList, a warning will be printed and the MaterialID left unmodified, unless MissingMaterialID is set to a value >= 0, in which case MissingMaterialID will be assigned

Parameters:
Return type:

DynamicMesh

remove_hidden_triangles(options, debug=None) DynamicMesh

Removes any triangles in the mesh that are not visible from the exterior view, under various definitions of “visible” and “outside” as specified by the Options.

Parameters:
Return type:

DynamicMesh

remove_small_components(options, debug=None) DynamicMesh
  • Removes connected components of the mesh that have a volume, area, or triangle count below a threshold as specified by the Options.

Parameters:
Return type:

DynamicMesh

remove_unused_vertices(debug=None) DynamicMesh

Remove vertices that are not used by any triangles. Note: Does not update the IDs of any remaining vertices; use CompactMesh to do so.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

repack_mesh_u_vs(uv_set_index, repack_options, debug=None) DynamicMesh

Packs the existing UV islands in the specified UV Channel into standard UV space based on the Repack Options.

Parameters:
Return type:

DynamicMesh

repair_mesh_degenerate_geometry(options, debug=None) DynamicMesh

Removes triangles that have area or edge length below specified amounts depending on the Options requested.

Parameters:
Return type:

DynamicMesh

reset() DynamicMesh

Clear the internal mesh to an empty mesh. This does not allocate a new mesh, so any existing mesh pointers/refs are still valid

Return type:

DynamicMesh

reset_to_cube() DynamicMesh

Clear the internal mesh to a 100x100x100 cube with base at the origin. This this instead of Reset() if an initially-empty mesh is undesirable (eg for a Component)

Return type:

DynamicMesh

resolve_mesh_t_junctions(resolve_options, debug=None) DynamicMesh

Attempts to resolve T-Junctions in the mesh by addition of vertices and welding.

Parameters:
Return type:

DynamicMesh

rotate_mesh(rotation, rotation_origin=[0.000000, 0.000000, 0.000000], debug=None) DynamicMesh

Rotates the mesh relative to the specified Rotation Origin.

Parameters:
Return type:

DynamicMesh

rotate_mesh_selection(selection, rotation, rotation_origin=[0.000000, 0.000000, 0.000000], debug=None) DynamicMesh

Rotates the selected part of the mesh relative to the specified Rotation Origin.

Parameters:
Return type:

DynamicMesh

rotate_mesh_u_vs(uv_set_index, rotation_angle, rotation_origin, selection, debug=None) DynamicMesh

Update all the selected UV values in the specified UV Channel by a rotation of Rotation Angle (in degrees) relative to the Rotation Origin. If the provided Selection is empty, the update is applied to the entire UV Channel.

Parameters:
Return type:

DynamicMesh

scale_mesh(scale=[1.000000, 1.000000, 1.000000], scale_origin=[0.000000, 0.000000, 0.000000], fix_orientation_for_negative_scale=True, debug=None) DynamicMesh

Applies the provided Scale transformation relative to the Scale Origin to the vertices of a Mesh.

Parameters:
Return type:

DynamicMesh

scale_mesh_selection(selection, scale=[1.000000, 1.000000, 1.000000], scale_origin=[0.000000, 0.000000, 0.000000], debug=None) DynamicMesh

Applies the given Scale transform relative to the Scale Origin to the selection part of the mesh.

Parameters:
Return type:

DynamicMesh

scale_mesh_u_vs(uv_set_index, scale, scale_origin, selection, debug=None) DynamicMesh

Update all selected UV values in the specified UV Channel by Scale, mathematically the new value is given by (UV - ScaleOrigin) * Scale + ScaleOrigin If the provided Selection is empty, the update is applied to the entire UV Channel.

Parameters:
Return type:

DynamicMesh

select_mesh_elements_by_normal_angle(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:
  • 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

select_mesh_elements_in_box(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:
  • 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

select_mesh_elements_in_box_with_bvh(query_bvh, query_box, options, selection_type=GeometryScriptMeshSelectionType.VERTICES, min_num_triangle_points=3, debug=None) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create Mesh Selection of mesh elements in TargetMesh contained by QueryBox, using QueryBVH to accellerate the computation. Triangles are selected if MinNumTrianglePoints or more vertices are inside the box. PolyGroups are selected if any of their triangles are inside the box

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection

select_mesh_elements_in_sphere(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:
  • 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

select_mesh_elements_inside_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:
  • 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

select_mesh_elements_with_plane(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:
  • 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

set_all_mesh_vertex_positions(position_list, debug=None) DynamicMesh

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

Parameters:
Return type:

DynamicMesh

set_all_triangle_material_i_ds(triangle_material_id_list, defer_change_notifications=False, debug=None) DynamicMesh

Sets the Material ID of all triangles in a mesh to the values in an input Index List.

Parameters:
Return type:

DynamicMesh

set_all_vertex_bone_weights(bone_weights, profile=['Default']) DynamicMesh

Set all vertices of the TargetMesh to the given Bone/Skin Weights

Parameters:
Return type:

DynamicMesh

set_material_id_for_mesh_selection(selection, material_id, defer_change_notifications=False, debug=None) DynamicMesh

Set a new MaterialID on all the triangles of the given Selection.

Parameters:
Return type:

DynamicMesh

set_material_id_on_triangles(triangle_id_list, material_id, defer_change_notifications=False, debug=None) DynamicMesh

Assigns the Material ID to all the triangles specified by the Triangle ID List.

Parameters:
  • triangle_id_list (GeometryScriptIndexList) – the triangles in the target mesh that will be updated with the new Material ID

  • material_id (int32) – the ID to be assigned to each triangle in the input list.

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

  • debug (GeometryScriptDebug) –

Return type:

DynamicMesh

set_mesh_constant_vertex_color(color, flags, clear_existing=False, debug=None) DynamicMesh

Set all vertex colors (optionally specific channels) in the TargetMesh VertexColor Overlay to a constant value

Parameters:
Return type:

DynamicMesh

set_mesh_per_vertex_colors(vertex_color_list, debug=None) DynamicMesh

Set all vertex colors in the TargetMesh VertexColor Overlay to the specified per-vertex colors

Parameters:
Return type:

DynamicMesh

set_mesh_per_vertex_normals(vertex_normal_list, debug=None) DynamicMesh

Set all normals in the TargetMesh Normals Overlay to the specified per-vertex normals

Parameters:
Return type:

DynamicMesh

set_mesh_per_vertex_tangents(tangent_x_list, tangent_y_list, debug=None) DynamicMesh

Set all tangents in the TargetMesh Tangents Overlays to the specified per-vertex tangents note: If setting Tangents for use with a DynamicMeshComponent, it is also necessary to set the Tangents Type on the Component to “Externally Provided”

Parameters:
Return type:

DynamicMesh

set_mesh_selection_vertex_color(selection, color, flags, create_color_seam=False, debug=None) DynamicMesh

Set the colors in the TargetMesh VertexColor Overlay identified by the Selection to a constant value. For a Vertex Selection, each existing VertexColor Overlay Element for the vertex is updated. For a Triangle or PolyGroup Selection, all Overlay Elements in the identified Triangles are updated.

Parameters:
  • selection (GeometryScriptMeshSelection) –

  • color (LinearColor) – the constant color to set

  • flags (GeometryScriptColorFlags) – specify which RGBA channels to set (default all channels)

  • create_color_seam (bool) – if true, a “hard edge” in the vertex colors is created, by creating new Elements for all the triangles in the selection. If enabled, Vertex selections are converted to Triangle selections, and Flags is ignored.

  • debug (GeometryScriptDebug) –

Return type:

DynamicMesh

set_mesh_triangle_normals(triangle_id, normals, defer_change_notifications=False) -> (DynamicMesh, is_valid_triangle=bool)

Set the triangle-vertex normals for the given TriangleID on the TargetMesh. This will create unique triangle-vertex normals, ie it will create hard edges / split normals in the normal overlay for each edge of the triangle.

Parameters:
  • triangle_id (int32) –

  • normals (GeometryScriptTriangle) –

  • defer_change_notifications (bool) – if true, no mesh change notification will be sent. Set to true if changing many normals in a loop.

Returns:

is_valid_triangle (bool): will be returned as false if TriangleID does not refer to a valid triangle

Return type:

bool

set_mesh_triangle_u_vs(uv_set_index, triangle_id, u_vs, defer_change_notifications=False) -> (DynamicMesh, is_valid_triangle=bool)

Sets the UVs of a mesh triangle in the given UV Channel. This function will create new UV elements for each vertex of the triangle, meaning that the triangle will become an isolated UV island.

Parameters:
Returns:

is_valid_triangle (bool):

Return type:

bool

set_mesh_triangle_uv_element_i_ds(uv_set_index, triangle_id, triangle_uv_elements, defer_change_notifications=False) -> (DynamicMesh, is_valid_triangle=bool)

Sets the UV Element IDs for a given Triangle in the specified UV Channel, ie the “UV Triangle” indices. This function does not create new UVs, the provided UV Elements must already. The UV Triangle can only be set if the resulting topology would be valid, ie the Elements cannot be shared between different base Mesh Vertices, so they must either be unused by any other triangles, or already associated with the same mesh vertex in other UV triangles. If any conditions are not met, bIsValidTriangle will be returned as false.

Parameters:
  • uv_set_index (int32) –

  • triangle_id (int32) –

  • triangle_uv_elements (IntVector) –

  • defer_change_notifications (bool) –

Returns:

is_valid_triangle (bool):

Return type:

bool

set_mesh_u_vs_from_box_projection(uv_set_index, box_transform, selection, min_island_tri_count=2, debug=None) DynamicMesh

Using Box Projection, update the UVs in the UV Channel for an entire mesh or a subset defined by a non-empty Selection.

Parameters:
Return type:

DynamicMesh

set_mesh_u_vs_from_cylinder_projection(uv_set_index, cylinder_transform, selection, split_angle=45.000000, debug=None) DynamicMesh

Using Cylinder Projection, update the UVs in the UV Channel for an entire mesh or a subset defined by a non-empty Selection.

Parameters:
Return type:

DynamicMesh

set_mesh_u_vs_from_planar_projection(uv_set_index, plane_transform, selection, debug=None) DynamicMesh

Scale of PlaneTransform defines world-space dimension that maps to 1 UV dimension

Parameters:
Return type:

DynamicMesh

set_mesh_uv_element_position(uv_set_index, element_id, new_uv_position, defer_change_notifications=False) -> (DynamicMesh, is_valid_element_id=bool)

Sets the UV position of a specific ElementID in the given UV Set/Channel If the UV Set or Element ID does not exist, bIsValidElementID will be returned as false.

Parameters:
  • uv_set_index (int32) –

  • element_id (int32) –

  • new_uv_position (Vector2D) –

  • defer_change_notifications (bool) –

Returns:

is_valid_element_id (bool):

Return type:

bool

set_num_extended_polygroup_layers(num_layers, debug=None) DynamicMesh

Sets the number of extended PolyGroup Layers on a Mesh.

Parameters:
Return type:

DynamicMesh

set_num_uv_sets(num_uv_sets, debug=None) DynamicMesh

Set the number of UV Channels on the Target Mesh. If not already enabled, this will enable the mesh attributes.

Parameters:
Return type:

DynamicMesh

set_per_face_normals(debug=None) DynamicMesh

Recompute the normals of TargetMesh by setting the normals of each triangle vertex to the triangle/face normal. Each vertex will have a unique normal in each triangle, ie there will be hard edges / split normals at every mesh edge

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

set_per_vertex_normals(debug=None) DynamicMesh

Recompute the normals of TargetMesh by averaging the triangle/face normals around each vertex, using combined area and angle weighting. Each vertex will have a single normal, ie there will be no hard edges.

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

set_polygroup_for_mesh_selection(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:
  • 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

set_polygroup_material_id(group_layer, polygroup_id, material_id, defer_change_notifications=False, debug=None) -> (DynamicMesh, is_valid_polygroup_id=bool)

Set a new MaterialID on all the triangles of TargetMesh with the given PolyGroup.

Parameters:
  • group_layer (GeometryScriptGroupLayer) – PolyGroup Layer to use as basis for PolyGroups

  • polygroup_id (int32) – PolyGroup ID that specifies Triangles to set to new MaterialID

  • material_id (int32) – explicit new MaterialID to set

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

  • debug (GeometryScriptDebug) –

Returns:

is_valid_polygroup_id (bool):

Return type:

bool

set_triangle_material_id(triangle_id, material_id, defer_change_notifications=False) -> (DynamicMesh, is_valid_triangle=bool)

Assigns the specified triangle the given Material ID. If the Target Mesh does not have Material IDs enabled, or if the Triangle ID is not an element of the Target Mesh then bIsValidTriangle will be set to false.

Parameters:
  • triangle_id (int32) –

  • material_id (int32) –

  • defer_change_notifications (bool) –

Returns:

is_valid_triangle (bool):

Return type:

bool

set_vertex_bone_weights(vertex_id, bone_weights, profile=["Default"]) -> (DynamicMesh, is_valid_vertex_id=bool)

Set the Bone/Skin Weights at a given vertex of TargetMesh

Parameters:
Returns:

is_valid_vertex_id (bool): will be returned as true if the vertex ID is valid

Return type:

bool

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

Set Vertex Position

Parameters:
  • vertex_id (int32) –

  • new_position (Vector) –

  • defer_change_notifications (bool) –

Returns:

is_valid_vertex (bool):

Return type:

bool

split_mesh_bowties(mesh_bowties=True, attribute_bowties=True, debug=None) DynamicMesh

Splits Bowties in the mesh and/or the attributes. A Bowtie is formed when a single vertex is connected to more than two boundary edges, and splitting duplicates the shared vertex so each triangle will have a unique copy.

Parameters:
Return type:

DynamicMesh

split_mesh_by_components(mesh_pool, debug=None) -> (DynamicMesh, component_meshes=Array[DynamicMesh])

Create a new Mesh for each Connected Component of TargetMesh. New meshes are drawn from MeshPool if it is provided, otherwise new UDynamicMesh instances are allocated

Parameters:
  • mesh_pool (DynamicMeshPool) – New meshes in ComponentMeshes output list are allocated from this pool if it is provided (highly recommended!!)

  • debug (GeometryScriptDebug) –

Returns:

component_meshes (Array[DynamicMesh]): New List of meshes is returned here

Return type:

Array[DynamicMesh]

split_mesh_by_material_i_ds(mesh_pool, debug=None) -> (DynamicMesh, component_meshes=Array[DynamicMesh], component_material_i_ds=Array[int32])

Create a new Mesh for each MaterialID of TargetMesh. New meshes are drawn from MeshPool if it is provided, otherwise new UDynamicMesh instances are allocated

Parameters:
  • mesh_pool (DynamicMeshPool) – New meshes in ComponentMeshes output list are allocated from this pool if it is provided (highly recommended!!)

  • debug (GeometryScriptDebug) –

Returns:

component_meshes (Array[DynamicMesh]): New List of meshes is returned here

component_material_i_ds (Array[int32]): MaterialID for each Mesh in ComponentMeshes is returned here

Return type:

tuple

split_mesh_by_polygroups(group_layer, mesh_pool, debug=None) -> (DynamicMesh, component_meshes=Array[DynamicMesh], component_polygroups=Array[int32])

Create a new Mesh for each Polygroup of TargetMesh. Note that this may be a large number of meshes! New meshes are drawn from MeshPool if it is provided, otherwise new UDynamicMesh instances are allocated

Parameters:
Returns:

component_meshes (Array[DynamicMesh]): New List of meshes is returned here

component_polygroups (Array[int32]): Original Polygroup for each Mesh in ComponentMeshes is returned here

Return type:

tuple

transfer_bone_weights_from_mesh(target_mesh, options=[TransferBoneWeightsMethod.CLOSEST_POINT_ON_SURFACE, OutputTargetMeshBones.SOURCE_BONES, ['Default'], ['Default'], -1.000000, -1.000000, True, 0, 0.000000, 'None'], debug=None) DynamicMesh

Transfer the bone weights from the SourceMesh to the TargetMesh. Assumes that the meshes are aligned. Otherwise, use the TransformMesh geometry script function to align them.

Parameters:
Return type:

DynamicMesh

transform_mesh(transform, fix_orientation_for_negative_scale=True, debug=None) DynamicMesh

Applies the provided Transform to the vertices of a Mesh.

Parameters:
Return type:

DynamicMesh

transform_mesh_selection(selection, transform, debug=None) DynamicMesh

Applies the given Transform to the vertices identified by the Selection of the mesh.

Parameters:
Return type:

DynamicMesh

translate_mesh(translation, debug=None) DynamicMesh

Applies the provided Translation to the vertices of a Mesh.

Parameters:
Return type:

DynamicMesh

translate_mesh_selection(selection, translation, debug=None) DynamicMesh

Applies the given Translation to the vertices identified by the Selection of the mesh.

Parameters:
Return type:

DynamicMesh

translate_mesh_u_vs(uv_set_index, translation, selection, debug=None) DynamicMesh

Update all selected UV values in the specified UV Channel by adding the Translation value to each. If the provided Selection is empty, the Translation is applied to the entire UV Channel.

Parameters:
Return type:

DynamicMesh

translate_pivot_to_location(pivot_location, debug=None) DynamicMesh

Set the Pivot Location for the Mesh. Since the Pivot of a Mesh object is always the point at (0,0,0), this function simply translates the mesh by -PivotLocation.

Parameters:
Return type:

DynamicMesh

update_vertex_normal(vertex_id, update_normal=True, new_normal, update_tangents, new_tangent_x, new_tangent_y, merge_split_values, defer_change_notifications=False) -> (DynamicMesh, is_valid_vertex=bool)

Update the Normals and/or Tangents at VertexID of TargetMesh. Note that the specified vertex may have “split normals” or “split tangents”, ie in the case of hard/crease normals, UV seams, and so on. In these situations, by default each of the unique normals/tangents at the vertex will be updated, but they will not be “merged”, ie they will remain split. However if bMergeSplitValues=true, then the vertex will be “un-split”, ie after the function call the vertex will have a single unique shared normal and/or tangents.

Note that this function requires that some normals/tangents already exist on the TargetMesh. If this is not the case, functions like SetPerVertexNormals and ComputeTangents can be used to initialize the normals/tangents first.

Parameters:
  • vertex_id (int32) –

  • update_normal (bool) – if true (default) then the normals overlay is updated

  • new_normal (Vector) – the new normal vector. This vector will not be normalized, it must be normalized by the calling code.

  • update_tangents (bool) – if true then the tangents overlay will be updated. If the tangents overlay does not exist, this function returns an error.

  • new_tangent_x (Vector) – the new tangent vector. This vector will not be normalized, it must be normalized by the calling code.

  • new_tangent_y (Vector) – the new bitangent/binormal vector. This vector will not be normalized, it must be normalized by the calling code.

  • merge_split_values (bool) – if true, any split normals/tangents at the vertex will be cleared, and a unique normal/tangent element will be set in the connected triangles

  • defer_change_notifications (bool) – if true, no mesh change notification will be sent. Set to true if changing many normals in a loop.

Returns:

is_valid_vertex (bool): will be set to true on return if the VertexID was valid, ie had valid normals and tangents

Return type:

bool

weld_mesh_edges(weld_options, debug=None) DynamicMesh

Welds any open boundary edges of the mesh together if possible in order to remove “cracks.”

Parameters:
Return type:

DynamicMesh