unreal.DynamicMesh

class unreal.DynamicMesh(outer: Optional[Object] = None, name: Union[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] Enable Mesh Generator: Controls whether the active Generator (if configured) will be applied when rebuilding the mesh

  • mesh_modified_bp_event (OnDynamicMeshModifiedBP): [Read-Write] Mesh Modified BPEvent: 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)

Add Triangle to Mesh

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)

Add Triangles to Mesh

Parameters:
Returns:

new_indices_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

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

Add Vertex to Mesh

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)

Add Vertices to Mesh

Parameters:
Returns:

new_indices_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

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

Append Box

Parameters:
Return type:

DynamicMesh

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

Append Buffers to Mesh

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

Append Capsule

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

Append Cone

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

Append Curved Stairs

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

Append Cylinder

Parameters:
Return type:

DynamicMesh

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

Append Disc

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

Append Linear Stairs

Parameters:
Return type:

DynamicMesh

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

Apply AppendTransform to AppendMesh and then add its geometry to the TargetMesh

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

Append Rectangle XY

Parameters:
Return type:

DynamicMesh

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

Append Revolve Path

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

Append Round Rectangle XY

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

Append Simple Swept Polygon

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

Append Sphere Box

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

Append Sphere Lat Long

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

Append Spiral Revolve Polygon

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 PolylineVertices 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

Append Torus

Parameters:
Return type:

DynamicMesh

append_triangulated_polygon(primitive_options, transform, polygon_vertices, allow_self_intersections=True, 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_voronoi_diagram2d(primitive_options, transform, voronoi_sites, voronoi_options, debug=None) DynamicMesh

Append Voronoi Diagram 2D

Parameters:
Return type:

DynamicMesh

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

Apply Bend Warp to Mesh

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 TargetMesh. VectorList Length must be >= the as TargetMesh MaxVertexID.

Parameters:
Return type:

DynamicMesh

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

Apply Displace from Texture Map

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

Apply Flare Warp to Mesh

Parameters:
Return type:

DynamicMesh

apply_iterative_smoothing_to_mesh(selection, options, debug=None) DynamicMesh

Apply Iterative Smoothing to Mesh

Parameters:
Return type:

DynamicMesh

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

Apply Math Warp to Mesh

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

Apply Mesh Boolean

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

Apply Mesh Mirror

Parameters:
Return type:

DynamicMesh

apply_mesh_morphology(options, debug=None) DynamicMesh

Apply Mesh Morphology

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

Apply Mesh Plane Cut

Parameters:
Return type:

DynamicMesh

apply_mesh_plane_slice(cut_frame, options, debug=None) DynamicMesh

Apply Mesh Plane Slice

Parameters:
Return type:

DynamicMesh

apply_mesh_polygroup_bevel(options, debug=None) DynamicMesh

Apply Mesh Polygroup Bevel

Parameters:
Return type:

DynamicMesh

apply_mesh_self_union(options, debug=None) DynamicMesh

Apply Mesh Self Union

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

Apply Mesh Solidify

Parameters:
Return type:

DynamicMesh

apply_perlin_noise_to_mesh(selection, options, debug=None) DynamicMesh

Apply Perlin Noise to Mesh

Parameters:
Return type:

DynamicMesh

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

Apply PNTessellation

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_recursive_pn_tessellation(options, num_iterations=3, debug=None) DynamicMesh

Apply Recursive PNTessellation deprecated: Use ‘Apply PN Tessellation’ instead; this deprecated version recursively subdivided the mesh NumIterations times while the new version splits every triangle into (TessellationLevel+1)^2 smaller triangles.

Parameters:
Return type:

DynamicMesh

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

Apply Selective Tessellation

Parameters:
Return type:

DynamicMesh

apply_simplify_to_planar(options, debug=None) DynamicMesh

Apply Simplify to Planar

Parameters:
Return type:

DynamicMesh

apply_simplify_to_polygroup_topology(options, group_layer, debug=None) DynamicMesh

Apply Simplify to Polygroup Topology

Parameters:
Return type:

DynamicMesh

apply_simplify_to_tolerance(tolerance, options, debug=None) DynamicMesh

Apply Simplify to Tolerance

Parameters:
Return type:

DynamicMesh

apply_simplify_to_triangle_count(triangle_count, options, debug=None) DynamicMesh

Apply Simplify to Triangle Count

Parameters:
Return type:

DynamicMesh

apply_simplify_to_vertex_count(vertex_count, options, debug=None) DynamicMesh

Apply Simplify to Vertex Count

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

Apply Twist Warp to Mesh

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

Parameters:
Return type:

DynamicMesh

auto_generate_patch_builder_mesh_u_vs(uv_set_index, options, debug=None) DynamicMesh

Auto Generate Patch Builder Mesh UVs

Parameters:
Return type:

DynamicMesh

auto_generate_x_atlas_mesh_u_vs(uv_set_index, options, debug=None) DynamicMesh

Auto Generate XAtlas Mesh UVs

Parameters:
Return type:

DynamicMesh

auto_repair_normals(debug=None) DynamicMesh

Auto Repair Normals

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

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

Build BVHFor Mesh

Parameters:

debug (GeometryScriptDebug) –

Returns:

output_bvh (GeometryScriptDynamicMeshBVH):

Return type:

GeometryScriptDynamicMeshBVH

clear_material_i_ds(clear_value=0, debug=None) DynamicMesh

Clear Material IDs

Parameters:
Return type:

DynamicMesh

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

Clear Polygroups

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

Compact Mesh

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_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_polygroups_from_angle_threshold(group_layer, crease_angle=15.000000, min_group_size=2, debug=None) DynamicMesh

Compute Polygroups from Angle Threshold

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

Compute Polygroups from Polygon Detection

Parameters:
Return type:

DynamicMesh

compute_split_normals(split_options, calculate_options, debug=None) DynamicMesh

Compute Split Normals

Parameters:
Return type:

DynamicMesh

compute_tangents(options, debug=None) DynamicMesh

Compute Tangents

Parameters:
Return type:

DynamicMesh

convert_components_to_polygroups(group_layer, debug=None) DynamicMesh

Convert Components to Polygroups

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 List

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

Convert UVIslands to Polygroups

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 Layer identified by ToUVSetIndex 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 Layer 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 ToUVSetIndex 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 UVSetIndex in CopyFromMesh to the 3D vertex positions in CopyToUVMesh, with the triangle mesh topolgoy defined by the UV Set. Generally this “UV Mesh” topolgoy 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)

CopyMeshToMeshUVLayer will copy the 3D UV Mesh back to the UV Set. 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

Copy Polygroups Layer

Parameters:
Return type:

DynamicMesh

copy_uv_set(from_uv_set, to_uv_set, debug=None) DynamicMesh

Copy UVSet

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

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

Delete Selected Triangles from Mesh

Parameters:
Returns:

num_deleted (int32):

Return type:

int32

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

Delete Triangle from Mesh

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)

Delete Triangles from Mesh

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)

Delete Triangles in Polygroup

Parameters:
Returns:

num_deleted (int32):

Return type:

int32

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

Delete Vertex from Mesh

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)

Delete Vertices from Mesh

Parameters:
Returns:

num_deleted (int32):

Return type:

int32

discard_mesh_attributes(defer_change_notifications=False) DynamicMesh

Discard Mesh Attributes

Parameters:

defer_change_notifications (bool) –

Return type:

DynamicMesh

enable_material_i_ds(debug=None) DynamicMesh

Enable Material IDs

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

enable_polygroups(debug=None) DynamicMesh

Enable Polygroups

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)

Fill All Mesh Holes

Parameters:
Returns:

num_filled_holes (int32):

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)

Find Nearest Point on Mesh

Parameters:
Returns:

nearest_result (GeometryScriptTrianglePoint):

outcome (GeometryScriptSearchOutcomePins):

Return type:

tuple

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

Find Nearest Ray Intersection with Mesh

Parameters:
Returns:

hit_result (GeometryScriptRayHitResult):

outcome (GeometryScriptSearchOutcomePins):

Return type:

tuple

flip_normals(debug=None) DynamicMesh

Flip Normals

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

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

Get All Triangle IDs

Returns:

triangle_id_list (GeometryScriptIndexList):

has_triangle_id_gaps (bool):

Return type:

tuple

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

Get All Triangle Indices

Parameters:

skip_gaps (bool) –

Returns:

triangle_list (GeometryScriptTriangleList):

has_triangle_id_gaps (bool):

Return type:

tuple

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

Get All Triangle Material 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)

Get All Vertex IDs

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)

Get All Vertex Positions

Parameters:

skip_gaps (bool) –

Returns:

position_list (GeometryScriptVectorList):

has_vertex_id_gaps (bool):

Return type:

tuple

get_has_material_i_ds() bool

Get Has Material IDs

Return type:

bool

get_has_polygroups() bool

Get Has Polygroups

Return type:

bool

get_has_triangle_id_gaps() bool

Get Has Triangle IDGaps

Return type:

bool

get_has_vertex_id_gaps() bool

Get Has Vertex IDGaps

Return type:

bool

get_is_closed_mesh() bool

Get Is Closed Mesh

Return type:

bool

get_is_dense_mesh() bool

Get Is Dense Mesh

Return type:

bool

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

Get Material IDs Of Triangles

Parameters:
Returns:

material_id_list (GeometryScriptIndexList):

Return type:

GeometryScriptIndexList

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

Get Mesh Bounding Box

Return type:

Box

get_mesh_has_attribute_set() bool

Get Mesh Has Attribute Set

Return type:

bool

get_mesh_info_string() str

Get Mesh Info String

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_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 Overlay. The UV Overlay 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 Overlay 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 overlay

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_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 Set 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 UVSetIndex 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)

Get Mesh Volume Area

Returns:

surface_area (float):

volume (float):

Return type:

tuple

get_num_connected_components() int32

Get Num Connected Components

Return type:

int32

get_num_extended_polygroup_layers() int32

Get Num Extended Polygroup Layers

Return type:

int32

get_num_open_border_edges() int32

Get Num Open Border Edges

Return type:

int32

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

Get Num Open Border Loops

Returns:

ambiguous_topology_found (bool):

Return type:

bool

get_num_triangle_i_ds() int32

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

Return type:

int32

get_num_uv_sets() int32

Get Num UVSets

Return type:

int32

get_num_vertex_i_ds() int32

Get Num Vertex IDs

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_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)

Get Triangle Indices

Parameters:

triangle_id (int32) –

Returns:

is_valid_triangle (bool):

Return type:

bool

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

Get Triangle Material ID

Parameters:

triangle_id (int32) –

Returns:

is_valid_triangle (bool):

Return type:

bool

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

Get Triangle Polygroup ID

Parameters:
Returns:

is_valid_triangle (bool):

Return type:

bool

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

Get Triangle Positions

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)

Get Triangle UVs

Parameters:
  • uv_set_index (int32) –

  • triangle_id (int32) –

Returns:

uv1 (Vector2D):

uv2 (Vector2D):

uv3 (Vector2D):

have_valid_u_vs (bool):

Return type:

tuple

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

Get Triangles by Material ID

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)

Get UVSet Bounding Box

Parameters:

uv_set_index (int32) –

Returns:

is_valid_uv_set (bool):

uv_set_is_empty (bool):

Return type:

tuple

get_vertex_count() int32

Get Vertex Count

Return type:

int32

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

Get Vertex Position

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)

Is BVHValid for Mesh

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)

Is Intersecting Mesh

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)

Is Point Inside Mesh

Parameters:
Returns:

is_inside (bool):

outcome (GeometryScriptContainmentOutcomePins):

Return type:

tuple

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

Is Same Mesh As

Parameters:
Returns:

is_same_mesh (bool):

Return type:

bool

is_valid_triangle_id(triangle_id) bool

Is Valid Triangle ID

Parameters:

triangle_id (int32) –

Return type:

bool

is_valid_vertex_id(vertex_id) bool

Is Valid Vertex ID

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)

Measure Distances Between Meshes

Parameters:
Returns:

max_distance (double):

min_distance (double):

average_distance (double):

root_mean_sqr_deviation (double):

Return type:

tuple

property mesh_modified_bp_event: OnDynamicMeshModifiedBP

[Read-Write] Mesh Modified BPEvent: 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)

Rebuild BVHFor Mesh

Parameters:
Returns:

update_bvh (GeometryScriptDynamicMeshBVH):

Return type:

GeometryScriptDynamicMeshBVH

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

Recompute Mesh UVs

Parameters:
Return type:

DynamicMesh

recompute_normals(calculate_options, debug=None) DynamicMesh

Recompute Normals

Parameters:
Return type:

DynamicMesh

remap_material_i_ds(from_material_id, to_material_id, debug=None) DynamicMesh

Remap Material IDs

Parameters:
Return type:

DynamicMesh

remove_hidden_triangles(options, debug=None) DynamicMesh

Remove Hidden Triangles

Parameters:
Return type:

DynamicMesh

remove_small_components(options, debug=None) DynamicMesh

Remove Small Components

Parameters:
Return type:

DynamicMesh

repack_mesh_u_vs(uv_set_index, repack_options, debug=None) DynamicMesh

Repack Mesh UVs

Parameters:
Return type:

DynamicMesh

repair_mesh_degenerate_geometry(options, debug=None) DynamicMesh

Repair Mesh Degenerate Geometry

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

Resolve Mesh TJunctions

Parameters:
Return type:

DynamicMesh

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

Rotate Mesh

Parameters:
Return type:

DynamicMesh

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

Rotate Mesh Selection

Parameters:
Return type:

DynamicMesh

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

Rotate Mesh UVs

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

Scale 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

Scale Mesh Selection

Parameters:
Return type:

DynamicMesh

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

Scale Mesh UVs

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_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_triangle_material_i_ds(triangle_material_id_list, defer_change_notifications=False, debug=None) DynamicMesh

Set All Triangle Material IDs

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

Set Material IDOn Triangles

Parameters:
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_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 Mesh Triangle Normals

Parameters:
Returns:

is_valid_triangle (bool):

Return type:

bool

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

Set Mesh Triangle UVs

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

Set Mesh UVs from Box Projection

Parameters:
Return type:

DynamicMesh

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

Set Mesh UVs from Cylinder Projection

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_num_extended_polygroup_layers(num_layers, debug=None) DynamicMesh

Set Num Extended Polygroup Layers

Parameters:
Return type:

DynamicMesh

set_num_uv_sets(num_uv_sets, debug=None) DynamicMesh

Set Num UVSets

Parameters:
Return type:

DynamicMesh

set_per_face_normals(debug=None) DynamicMesh

Set Per Face Normals

Parameters:

debug (GeometryScriptDebug) –

Return type:

DynamicMesh

set_per_vertex_normals(debug=None) DynamicMesh

Set Per Vertex Normals

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)

Set Triangle Material ID

Parameters:
  • triangle_id (int32) –

  • material_id (int32) –

  • defer_change_notifications (bool) –

Returns:

is_valid_triangle (bool):

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

Split Mesh Bowties

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

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

Transform Mesh

Parameters:
Return type:

DynamicMesh

transform_mesh_selection(selection, transform, debug=None) DynamicMesh

Transform Mesh Selection

Parameters:
Return type:

DynamicMesh

translate_mesh(translation, debug=None) DynamicMesh

Translate Mesh

Parameters:
Return type:

DynamicMesh

translate_mesh_selection(selection, translation, debug=None) DynamicMesh

Translate Mesh Selection

Parameters:
Return type:

DynamicMesh

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

Translate Mesh UVs

Parameters:
Return type:

DynamicMesh

weld_mesh_edges(weld_options, debug=None) DynamicMesh

Weld Mesh Edges

Parameters:
Return type:

DynamicMesh