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 meshmesh_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)¶
Add Triangle to Mesh
- Parameters:
new_triangle (IntVector) –
new_triangle_group_id (int32) –
defer_change_notifications (bool) –
debug (GeometryScriptDebug) –
- 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:
new_triangles_list (GeometryScriptTriangleList) –
new_triangle_group_id (int32) –
defer_change_notifications (bool) –
debug (GeometryScriptDebug) –
- Returns:
new_indices_list (GeometryScriptIndexList):
- Return type:
- add_vertex_to_mesh(new_position, defer_change_notifications=False) -> (DynamicMesh, new_vertex_index=int32)¶
Add Vertex to Mesh
- add_vertices_to_mesh(new_positions_list, defer_change_notifications=False) -> (DynamicMesh, new_indices_list=GeometryScriptIndexList)¶
Add Vertices to Mesh
- Parameters:
new_positions_list (GeometryScriptVectorList) –
defer_change_notifications (bool) –
- Returns:
new_indices_list (GeometryScriptIndexList):
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
dimension_x (float) –
dimension_y (float) –
dimension_z (float) –
steps_x (int32) –
steps_y (int32) –
steps_z (int32) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
buffers (GeometryScriptSimpleMeshBuffers) –
material_id (int32) –
defer_change_notifications (bool) –
debug (GeometryScriptDebug) –
- Returns:
new_triangle_indices_list (GeometryScriptIndexList):
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
radius (float) –
line_length (float) –
hemisphere_steps (int32) –
circle_steps (int32) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
base_radius (float) –
top_radius (float) –
height (float) –
radial_steps (int32) –
height_steps (int32) –
capped (bool) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
step_width (float) –
step_height (float) –
inner_radius (float) –
curve_angle (float) –
num_steps (int32) –
floating (bool) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
radius (float) –
height (float) –
radial_steps (int32) –
height_steps (int32) –
capped (bool) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
radius (float) –
angle_steps (int32) –
spoke_steps (int32) –
start_angle (float) –
end_angle (float) –
hole_radius (float) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
step_width (float) –
step_height (float) –
step_depth (float) –
num_steps (int32) –
floating (bool) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
append_mesh (DynamicMesh) –
append_transform (Transform) –
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:
- 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:
- 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) –
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:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
dimension_x (float) –
dimension_y (float) –
steps_width (int32) –
steps_height (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
dimension_x (float) –
dimension_y (float) –
steps_width (int32) –
steps_height (int32) –
debug (GeometryScriptDebug) –
- Return type:
- append_revolve_path(primitive_options, transform, path_vertices, revolve_options, steps=8, capped=True, debug=None) DynamicMesh ¶
Append Revolve Path
- Parameters:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
revolve_options (GeometryScriptRevolveOptions) –
steps (int32) –
capped (bool) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
revolve_options (GeometryScriptRevolveOptions) –
radius (float) –
steps (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
dimension_x (float) –
dimension_y (float) –
corner_radius (float) –
steps_width (int32) –
steps_height (int32) –
steps_round (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
dimension_x (float) –
dimension_y (float) –
corner_radius (float) –
steps_width (int32) –
steps_height (int32) –
steps_round (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
height (float) –
height_steps (int32) –
capped (bool) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
radius (float) –
steps_x (int32) –
steps_y (int32) –
steps_z (int32) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
radius (float) –
steps_phi (int32) –
steps_theta (int32) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
revolve_options (GeometryScriptRevolveOptions) –
radius (float) –
steps (int32) –
rise_per_revolution (float) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
revolve_options (GeometryScriptRevolveOptions) –
major_radius (float) –
minor_radius (float) –
major_steps (int32) –
minor_steps (int32) –
origin (GeometryScriptPrimitiveOriginMode) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
allow_self_intersections (bool) –
debug (GeometryScriptDebug) –
- Return type:
- append_voronoi_diagram2d(primitive_options, transform, voronoi_sites, voronoi_options, debug=None) DynamicMesh ¶
Append Voronoi Diagram 2D
- Parameters:
primitive_options (GeometryScriptPrimitiveOptions) –
transform (Transform) –
voronoi_options (GeometryScriptVoronoiOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptBendWarpOptions) –
bend_orientation (Transform) –
bend_angle (float) –
bend_extent (float) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
selection (GeometryScriptMeshSelection) – if non-empty, only the vertices identified by the selection will be displaced. The VectorList must still be the same size as the whole mesh, this is just a filter on which vertices are updated.
vector_list (GeometryScriptVectorList) –
magnitude (float) –
debug (GeometryScriptDebug) –
- Return type:
- apply_displace_from_texture_map(texture, selection, options, uv_layer=0, debug=None) DynamicMesh ¶
Apply Displace from Texture Map
- Parameters:
texture (Texture2D) –
selection (GeometryScriptMeshSelection) –
options (GeometryScriptDisplaceFromTextureOptions) –
uv_layer (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptFlareWarpOptions) –
flare_orientation (Transform) –
flare_percent_x (float) –
flare_percent_y (float) –
flare_extent (float) –
debug (GeometryScriptDebug) –
- Return type:
- apply_iterative_smoothing_to_mesh(selection, options, debug=None) DynamicMesh ¶
Apply Iterative Smoothing to Mesh
- Parameters:
selection (GeometryScriptMeshSelection) –
options (GeometryScriptIterativeMeshSmoothingOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_math_warp_to_mesh(warp_orientation, warp_type, options, debug=None) DynamicMesh ¶
Apply Math Warp to Mesh
- Parameters:
warp_orientation (Transform) –
warp_type (GeometryScriptMathWarpType) –
options (GeometryScriptMathWarpOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
selection (GeometryScriptMeshSelection) – specifies which mesh edges to Bevel
bevel_mode (GeometryScriptMeshBevelSelectionMode) – specifies how Selection should be converted to a Triangle Region or set of PolyGroup Edges
bevel_options (GeometryScriptMeshBevelSelectionOptions) – settings for the Bevel Operation
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_boolean(target_transform, tool_mesh, tool_transform, operation, options, debug=None) DynamicMesh ¶
Apply Mesh Boolean
- Parameters:
target_transform (Transform) –
tool_mesh (DynamicMesh) –
tool_transform (Transform) –
operation (GeometryScriptBooleanOperation) –
options (GeometryScriptMeshBooleanOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
selection (GeometryScriptMeshSelection) –
allow_bowties_in_output (bool) – if false, any bowtie vertices resulting created in the Duplicate area will be disconnected into unique vertices
debug (GeometryScriptDebug) –
- Return type:
- 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:
selection (GeometryScriptMeshSelection) –
group_options (GeometryScriptMeshEditPolygroupOptions) –
debug (GeometryScriptDebug) –
- Returns:
new_triangles (GeometryScriptMeshSelection): a Mesh Selection of the duplicate triangles is returned here (with type Triangles)
- Return type:
- 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:
options (GeometryScriptMeshInsetOutsetFacesOptions) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptMeshLinearExtrudeOptions) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_mirror(mirror_frame, options, debug=None) DynamicMesh ¶
Apply Mesh Mirror
- Parameters:
mirror_frame (Transform) –
options (GeometryScriptMeshMirrorOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_morphology(options, debug=None) DynamicMesh ¶
Apply Mesh Morphology
- Parameters:
options (GeometryScriptMorphologyOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptMeshOffsetOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptMeshOffsetFacesOptions) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_plane_cut(cut_frame, options, debug=None) DynamicMesh ¶
Apply Mesh Plane Cut
- Parameters:
cut_frame (Transform) –
options (GeometryScriptMeshPlaneCutOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_plane_slice(cut_frame, options, debug=None) DynamicMesh ¶
Apply Mesh Plane Slice
- Parameters:
cut_frame (Transform) –
options (GeometryScriptMeshPlaneSliceOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_polygroup_bevel(options, debug=None) DynamicMesh ¶
Apply Mesh Polygroup Bevel
- Parameters:
options (GeometryScriptMeshBevelOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_self_union(options, debug=None) DynamicMesh ¶
Apply Mesh Self Union
- Parameters:
options (GeometryScriptMeshSelfUnionOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptMeshOffsetOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_mesh_solidify(options, debug=None) DynamicMesh ¶
Apply Mesh Solidify
- Parameters:
options (GeometryScriptSolidifyOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_perlin_noise_to_mesh(selection, options, debug=None) DynamicMesh ¶
Apply Perlin Noise to Mesh
- Parameters:
selection (GeometryScriptMeshSelection) –
options (GeometryScriptPerlinNoiseOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_pn_tessellation(options, tessellation_level=3, debug=None) DynamicMesh ¶
Apply PNTessellation
- Parameters:
options (GeometryScriptPNTessellateOptions) –
tessellation_level (int32) –
debug (GeometryScriptDebug) –
- Return type:
- apply_polygroup_catmull_clark_sub_d(subdivisions, group_layer, debug=None) DynamicMesh ¶
Apply Polygroup Catmull Clark Sub D
- Parameters:
subdivisions (int32) –
group_layer (GeometryScriptGroupLayer) –
debug (GeometryScriptDebug) –
- Return type:
- apply_selective_tessellation(selection, options, tessellation_level=1, pattern_type=SelectiveTessellatePatternType.CONCENTRIC_RINGS, debug=None) DynamicMesh ¶
Apply Selective Tessellation
- Parameters:
selection (GeometryScriptMeshSelection) –
options (GeometryScriptSelectiveTessellateOptions) –
tessellation_level (int32) –
pattern_type (SelectiveTessellatePatternType) –
debug (GeometryScriptDebug) –
- Return type:
- apply_simplify_to_planar(options, debug=None) DynamicMesh ¶
Apply Simplify to Planar
- Parameters:
options (GeometryScriptPlanarSimplifyOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_simplify_to_polygroup_topology(options, group_layer, debug=None) DynamicMesh ¶
Apply Simplify to Polygroup Topology
- Parameters:
options (GeometryScriptPolygroupSimplifyOptions) –
group_layer (GeometryScriptGroupLayer) –
debug (GeometryScriptDebug) –
- Return type:
- apply_simplify_to_tolerance(tolerance, options, debug=None) DynamicMesh ¶
Apply Simplify to Tolerance
- Parameters:
tolerance (float) –
options (GeometryScriptSimplifyMeshOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_simplify_to_triangle_count(triangle_count, options, debug=None) DynamicMesh ¶
Apply Simplify to Triangle Count
- Parameters:
triangle_count (int32) –
options (GeometryScriptSimplifyMeshOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_simplify_to_vertex_count(vertex_count, options, debug=None) DynamicMesh ¶
Apply Simplify to Vertex Count
- Parameters:
vertex_count (int32) –
options (GeometryScriptSimplifyMeshOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_triangle_loop_sub_d(subdivisions, debug=None) DynamicMesh ¶
Apply Triangle Loop Sub D
- Parameters:
subdivisions (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptTwistWarpOptions) –
twist_orientation (Transform) –
twist_angle (float) –
twist_extent (float) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
remesh_options (GeometryScriptRemeshOptions) –
uniform_options (GeometryScriptUniformRemeshOptions) –
debug (GeometryScriptDebug) –
- Return type:
- apply_uniform_tessellation(tessellation_level=3, debug=None) DynamicMesh ¶
Apply Uniform Tessellation
- Parameters:
tessellation_level (int32) –
debug (GeometryScriptDebug) –
- Return type:
- auto_generate_patch_builder_mesh_u_vs(uv_set_index, options, debug=None) DynamicMesh ¶
Auto Generate Patch Builder Mesh UVs
- Parameters:
uv_set_index (int32) –
options (GeometryScriptPatchBuilderOptions) –
debug (GeometryScriptDebug) –
- Return type:
- auto_generate_x_atlas_mesh_u_vs(uv_set_index, options, debug=None) DynamicMesh ¶
Auto Generate XAtlas Mesh UVs
- Parameters:
uv_set_index (int32) –
options (GeometryScriptXAtlasOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- build_bvh_for_mesh(debug=None) -> (DynamicMesh, output_bvh=GeometryScriptDynamicMeshBVH)¶
Build BVHFor Mesh
- Parameters:
debug (GeometryScriptDebug) –
- Returns:
output_bvh (GeometryScriptDynamicMeshBVH):
- Return type:
- clear_material_i_ds(clear_value=0, debug=None) DynamicMesh ¶
Clear Material IDs
- Parameters:
clear_value (int32) –
debug (GeometryScriptDebug) –
- Return type:
- clear_polygroups(group_layer, clear_value=0, debug=None) DynamicMesh ¶
Clear Polygroups
- Parameters:
group_layer (GeometryScriptGroupLayer) –
clear_value (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
source_material_list (Array[MaterialInterface]) – Input Material list, assumption is that SourceMaterialList.Num() == number of MaterialIDs on mesh at input
debug (GeometryScriptDebug) –
- Returns:
compacted_material_list (Array[MaterialInterface]): new Compacted Material list, one-to-one with new compacted MaterialIDs
- Return type:
- compact_mesh(debug=None) DynamicMesh ¶
Compact Mesh
- Parameters:
debug (GeometryScriptDebug) –
- Return type:
- 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:
copy_to_mesh (DynamicMesh) –
options (GeometryScriptConvexDecompositionOptions) –
debug (GeometryScriptDebug) –
- 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:
copy_to_mesh (DynamicMesh) –
selection (GeometryScriptMeshSelection) – selection of mesh faces/vertices to contain in the convex hull. If not provided, entire mesh is used.
options (GeometryScriptConvexHullOptions) –
debug (GeometryScriptDebug) –
- 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:
copy_to_mesh (DynamicMesh) –
projection_frame (Transform) –
options (GeometryScriptSweptHullOptions) –
debug (GeometryScriptDebug) –
- 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:
options (GeometryScriptMeshPointSamplingOptions) –
non_uniform_options (GeometryScriptNonUniformPointSamplingOptions) –
debug (GeometryScriptDebug) –
- 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:
options (GeometryScriptMeshPointSamplingOptions) –
debug (GeometryScriptDebug) –
- 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 ¶
Compute Polygroups from Angle Threshold
- Parameters:
group_layer (GeometryScriptGroupLayer) –
crease_angle (float) –
min_group_size (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
group_layer (GeometryScriptGroupLayer) –
respect_uv_seams (bool) –
respect_hard_normals (bool) –
quad_adjacency_weight (double) –
quad_metric_clamp (double) –
max_search_rounds (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
skeleton (Skeleton) – The skeleton to compute binding for the skin weights.
options (GeometryScriptSmoothBoneWeightsOptions) – The options to set for the binding algorithm.
profile (GeometryScriptBoneWeightProfile) – The skin weight profile to update with the smooth binding.
debug (GeometryScriptDebug) –
- Return type:
- 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:
split_options (GeometryScriptSplitNormalsOptions) –
calculate_options (GeometryScriptCalculateNormalsOptions) –
debug (GeometryScriptDebug) –
- Return type:
- compute_tangents(options, debug=None) DynamicMesh ¶
Recompute Tangents for the TargetMesh, using the method and settings specified by FGeometryScriptTangentsOptions
- Parameters:
options (GeometryScriptTangentsOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
options (GeometryScriptMeshPointSamplingOptions) –
non_uniform_options (GeometryScriptNonUniformPointSamplingOptions) –
vertex_weights (GeometryScriptScalarList) – defines a per-vertex weight in range [0,1], these are interpolated to create a scalar field over the mesh triangles which is used to weight the sampling radii
debug (GeometryScriptDebug) –
- Returns:
samples (Array[Transform]):
sample_radii (Array[double]):
triangle_i_ds (GeometryScriptIndexList):
- Return type:
tuple
- convert_components_to_polygroups(group_layer, debug=None) DynamicMesh ¶
Convert Components to Polygroups
- Parameters:
group_layer (GeometryScriptGroupLayer) –
debug (GeometryScriptDebug) –
- Return type:
- convert_index_array_to_mesh_selection(index_array, selection_type) -> (DynamicMesh, selection=GeometryScriptMeshSelection)¶
Create a Mesh Selection from the IndexArray.
- Parameters:
index_array (Array[int32]) –
selection_type (GeometryScriptMeshSelectionType) – type of indices specified in the selection
- Returns:
selection (GeometryScriptMeshSelection):
- Return type:
- 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:
index_list (GeometryScriptIndexList) –
selection_type (GeometryScriptMeshSelectionType) – type of indices desired in the Output selection
- Returns:
selection (GeometryScriptMeshSelection):
- Return type:
- convert_index_set_to_mesh_selection(index_set, selection_type) -> (DynamicMesh, selection=GeometryScriptMeshSelection)¶
Create a Mesh Selection from the IndexSet.
- Parameters:
index_set (Set[int32]) –
selection_type (GeometryScriptMeshSelectionType) – type of indices specified in the selection
- Returns:
selection (GeometryScriptMeshSelection):
- Return type:
- 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:
from_selection (GeometryScriptMeshSelection) –
new_type (GeometryScriptMeshSelectionType) –
allow_partial_inclusion (bool) – if false, perform more limited selection conversion as described above
- Returns:
to_selection (GeometryScriptMeshSelection):
- Return type:
- 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:
selection (GeometryScriptMeshSelection) –
convert_to_type (GeometryScriptIndexType) – optional parameter specifying the type of Index List to convert to. If Set to Any, no conversion will be performed.
- 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:
- 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:
- convert_uv_islands_to_polygroups(group_layer, uv_layer=0, debug=None) DynamicMesh ¶
Convert UVIslands to Polygroups
- Parameters:
group_layer (GeometryScriptGroupLayer) –
uv_layer (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
copy_to_mesh (DynamicMesh) –
debug (GeometryScriptDebug) –
- 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:
uv_set_index (int32) –
copy_to_uv_mesh (DynamicMesh) –
debug (GeometryScriptDebug) –
- 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:
from_group_layer (GeometryScriptGroupLayer) –
to_group_layer (GeometryScriptGroupLayer) –
debug (GeometryScriptDebug) –
- Return type:
- copy_uv_set(from_uv_set, to_uv_set, debug=None) DynamicMesh ¶
Copy UVSet
- Parameters:
from_uv_set (int32) –
to_uv_set (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- delete_selected_triangles_from_mesh(selection, defer_change_notifications=False) -> (DynamicMesh, num_deleted=int32)¶
Delete Selected Triangles from Mesh
- Parameters:
selection (GeometryScriptMeshSelection) –
defer_change_notifications (bool) –
- 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
- 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:
material_id (int32) –
defer_change_notifications (bool) –
debug (GeometryScriptDebug) –
- 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:
triangle_list (GeometryScriptIndexList) –
defer_change_notifications (bool) –
- 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:
group_layer (GeometryScriptGroupLayer) –
polygroup_id (int32) –
defer_change_notifications (bool) –
debug (GeometryScriptDebug) –
- 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
- delete_vertices_from_mesh(vertex_list, defer_change_notifications=False) -> (DynamicMesh, num_deleted=int32)¶
Delete Vertices from Mesh
- Parameters:
vertex_list (GeometryScriptIndexList) –
defer_change_notifications (bool) –
- 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:
- discard_tangents(debug=None) DynamicMesh ¶
Remove any existing Tangents Attribute Layer from the TargetMesh
- Parameters:
debug (GeometryScriptDebug) –
- Return type:
- enable_material_i_ds(debug=None) DynamicMesh ¶
Enable Material IDs
- Parameters:
debug (GeometryScriptDebug) –
- Return type:
- enable_polygroups(debug=None) DynamicMesh ¶
Enable Polygroups
- Parameters:
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
selection (GeometryScriptMeshSelection) –
connection_type (GeometryScriptTopologyConnectionType) – defines what “connected” means, ie purely geometric connection, or some additional constraint like same MaterialIDs/etc
- Returns:
new_selection (GeometryScriptMeshSelection):
- Return type:
- fill_all_mesh_holes(fill_options, debug=None) -> (DynamicMesh, num_filled_holes=int32, num_failed_hole_fills=int32)¶
Fill All Mesh Holes
- Parameters:
fill_options (GeometryScriptFillHolesOptions) –
debug (GeometryScriptDebug) –
- 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:
query_bvh (GeometryScriptDynamicMeshBVH) –
query_point (Vector) –
options (GeometryScriptSpatialQueryOptions) –
debug (GeometryScriptDebug) –
- 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:
query_bvh (GeometryScriptDynamicMeshBVH) –
ray_origin (Vector) –
ray_direction (Vector) –
options (GeometryScriptSpatialQueryOptions) –
debug (GeometryScriptDebug) –
- 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:
- 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:
group_layer (GeometryScriptGroupLayer) –
polygroup_i_ds_out (GeometryScriptIndexList) –
- Returns:
polygroup_i_ds_out (GeometryScriptIndexList):
- Return type:
- 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_triangle_normals() bool ¶
- Returns:
true if the TargetMesh has the Normals Attribute enabled (which allows for storing split normals)
- Return type:
- get_has_vertex_colors() bool ¶
- Returns:
true if the TargetMesh has the Vertex Colors attribute enabled
- Return type:
- 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_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:
vertex_id (int32) – requested vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- 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)¶
Get Material IDs Of Triangles
- Parameters:
triangle_id_list (GeometryScriptIndexList) –
debug (GeometryScriptDebug) –
- Returns:
material_id_list (GeometryScriptIndexList):
- Return type:
- 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:
- 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:
- 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:
uv_set_index (int32) – index of UV Channel to read
debug (GeometryScriptDebug) –
- 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:
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- 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:
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- 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 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)¶
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:
- 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 ¶
UV Queries
- 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:
group_layer (GeometryScriptGroupLayer) –
polygroup_i_ds_out (GeometryScriptIndexList) –
- Returns:
polygroup_i_ds_out (GeometryScriptIndexList):
- Return type:
- 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:
store_to_submesh (DynamicMesh) –
triangle_list (GeometryScriptIndexList) –
debug (GeometryScriptDebug) –
- 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:
- get_triangle_indices(triangle_id) -> (IntVector, is_valid_triangle=bool)¶
Get Triangle Indices
- Parameters:
triangle_id (int32) –
- Returns:
is_valid_triangle (bool):
- Return type:
- 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:
- get_triangle_normal_tangents(triangle_id) -> (DynamicMesh, tri_has_valid_elements=bool, normals=GeometryScriptTriangle, tangents=GeometryScriptTriangle, bi_tangents=GeometryScriptTriangle)¶
For the specified TriangleID of the TargetMesh, get the Normal and Tangent vectors at each vertex of the Triangle. These Normals/Tangents will be taken from the Normal and Tangents Overlays, ie they will potentially be split-normals.
- Parameters:
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 TargetMesh, get the Normal vectors at each vertex of the Triangle. These Normals will be taken from the Normal Overlay, ie they will potentially be split-normals.
- Parameters:
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)¶
Get Triangle Polygroup ID
- Parameters:
group_layer (GeometryScriptGroupLayer) –
triangle_id (int32) –
- Returns:
is_valid_triangle (bool):
- Return type:
- 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_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)¶
Get Triangles by Material ID
- Parameters:
material_id (int32) –
debug (GeometryScriptDebug) –
- Returns:
triangle_id_list (GeometryScriptIndexList):
- Return type:
- 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:
group_layer (GeometryScriptGroupLayer) –
polygroup_id (int32) –
triangle_i_ds_out (GeometryScriptIndexList) –
- Returns:
triangle_i_ds_out (GeometryScriptIndexList):
- Return type:
- 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_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:
vertex_id (int32) – requested vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- 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_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:
- 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:
- is_bvh_valid_for_mesh(test_bvh, debug=None) -> (DynamicMesh, is_valid=bool)¶
Is BVHValid for Mesh
- Parameters:
test_bvh (GeometryScriptDynamicMeshBVH) –
debug (GeometryScriptDebug) –
- Returns:
is_valid (bool):
- Return type:
- is_intersecting_mesh(target_transform, other_mesh, other_transform, debug=None) -> (DynamicMesh, is_intersecting=bool)¶
Is Intersecting Mesh
- Parameters:
target_transform (Transform) –
other_mesh (DynamicMesh) –
other_transform (Transform) –
debug (GeometryScriptDebug) –
- Returns:
is_intersecting (bool):
- Return type:
- is_point_inside_mesh(query_bvh, query_point, options, debug=None) -> (DynamicMesh, is_inside=bool, outcome=GeometryScriptContainmentOutcomePins)¶
Is Point Inside Mesh
- Parameters:
query_bvh (GeometryScriptDynamicMeshBVH) –
query_point (Vector) –
options (GeometryScriptSpatialQueryOptions) –
debug (GeometryScriptDebug) –
- 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:
other_mesh (DynamicMesh) –
options (GeometryScriptIsSameMeshOptions) –
debug (GeometryScriptDebug) –
- Returns:
is_same_mesh (bool):
- Return type:
- is_valid_triangle_id(triangle_id) bool ¶
Is Valid Triangle ID
- Parameters:
triangle_id (int32) –
- Return type:
- is_valid_vertex_id(vertex_id) bool ¶
Is Valid Vertex ID
- Parameters:
vertex_id (int32) –
- Return type:
- 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:
other_mesh (DynamicMesh) –
options (GeometryScriptMeasureMeshDistanceOptions) –
debug (GeometryScriptDebug) –
- 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:
- 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:
- property mesh_modified_bp_event: OnDynamicMeshModifiedBP¶
[Read-Write] Blueprintable event called when mesh is modified, in the same cases as OnMeshChanged
- Type:
- rebuild_bvh_for_mesh(update_bvh, only_if_invalid=True, debug=None) -> (DynamicMesh, update_bvh=GeometryScriptDynamicMeshBVH)¶
Rebuild BVHFor Mesh
- Parameters:
update_bvh (GeometryScriptDynamicMeshBVH) –
only_if_invalid (bool) –
debug (GeometryScriptDebug) –
- Returns:
update_bvh (GeometryScriptDynamicMeshBVH):
- Return type:
- recompute_mesh_u_vs(uv_set_index, options, selection, debug=None) DynamicMesh ¶
Recompute Mesh UVs
- Parameters:
uv_set_index (int32) –
options (GeometryScriptRecomputeUVsOptions) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- recompute_normals(calculate_options, 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:
calculate_options (GeometryScriptCalculateNormalsOptions) –
debug (GeometryScriptDebug) –
- Return type:
- remap_material_i_ds(from_material_id, to_material_id, debug=None) DynamicMesh ¶
Remap Material IDs
- Parameters:
from_material_id (int32) –
to_material_id (int32) –
debug (GeometryScriptDebug) –
- Return type:
Remove Hidden Triangles
- Parameters:
options (GeometryScriptRemoveHiddenTrianglesOptions) –
debug (GeometryScriptDebug) –
- Return type:
- remove_small_components(options, debug=None) DynamicMesh ¶
Remove Small Components
- Parameters:
options (GeometryScriptRemoveSmallComponentOptions) –
debug (GeometryScriptDebug) –
- Return type:
- repack_mesh_u_vs(uv_set_index, repack_options, debug=None) DynamicMesh ¶
Repack Mesh UVs
- Parameters:
uv_set_index (int32) –
repack_options (GeometryScriptRepackUVsOptions) –
debug (GeometryScriptDebug) –
- Return type:
- repair_mesh_degenerate_geometry(options, debug=None) DynamicMesh ¶
Repair Mesh Degenerate Geometry
- Parameters:
options (GeometryScriptDegenerateTriangleOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
- resolve_mesh_t_junctions(resolve_options, debug=None) DynamicMesh ¶
Resolve Mesh TJunctions
- Parameters:
resolve_options (GeometryScriptResolveTJunctionOptions) –
debug (GeometryScriptDebug) –
- Return type:
- rotate_mesh(rotation, rotation_origin=[0.000000, 0.000000, 0.000000], debug=None) DynamicMesh ¶
Rotate Mesh
- Parameters:
rotation (Rotator) –
rotation_origin (Vector) –
debug (GeometryScriptDebug) –
- Return type:
- rotate_mesh_selection(selection, rotation, rotation_origin=[0.000000, 0.000000, 0.000000], debug=None) DynamicMesh ¶
Rotate Mesh Selection
- Parameters:
selection (GeometryScriptMeshSelection) –
rotation (Rotator) –
rotation_origin (Vector) –
debug (GeometryScriptDebug) –
- Return type:
- rotate_mesh_u_vs(uv_set_index, rotation_angle, rotation_origin, selection, debug=None) DynamicMesh ¶
Rotate Mesh UVs
- Parameters:
uv_set_index (int32) –
rotation_angle (float) –
rotation_origin (Vector2D) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
scale (Vector) –
scale_origin (Vector) –
fix_orientation_for_negative_scale (bool) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
selection (GeometryScriptMeshSelection) –
scale (Vector) –
scale_origin (Vector) –
debug (GeometryScriptDebug) –
- Return type:
- scale_mesh_u_vs(uv_set_index, scale, scale_origin, selection, debug=None) DynamicMesh ¶
Scale Mesh UVs
- Parameters:
uv_set_index (int32) –
scale (Vector2D) –
scale_origin (Vector2D) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
- 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:
- 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:
- 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:
- set_all_mesh_vertex_positions(position_list, debug=None) DynamicMesh ¶
Set all vertex positions in the TargetMesh to the specified Positions
- Parameters:
position_list (GeometryScriptVectorList) – new vertex Positions. Size must be less than or equal to the MaxVertexID of TargetMesh (ie gaps are supported)
debug (GeometryScriptDebug) –
- Return type:
- set_all_triangle_material_i_ds(triangle_material_id_list, defer_change_notifications=False, debug=None) DynamicMesh ¶
Set All Triangle Material IDs
- Parameters:
triangle_material_id_list (GeometryScriptIndexList) –
defer_change_notifications (bool) –
debug (GeometryScriptDebug) –
- Return type:
- set_all_vertex_bone_weights(bone_weights, profile=['Default']) DynamicMesh ¶
Set all vertices of the TargetMesh to the given Bone/Skin Weights
- Parameters:
bone_weights (Array[GeometryScriptBoneWeight]) – input array of bone index/weight pairs for the Vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- Return type:
- 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:
selection (GeometryScriptMeshSelection) –
material_id (int32) – new Material ID to set
defer_change_notifications (bool) – if true, the UDynamicMesh does not emit a change event/signal for this modification
debug (GeometryScriptDebug) –
- Return type:
- set_material_id_on_triangles(triangle_id_list, material_id, defer_change_notifications=False, debug=None) DynamicMesh ¶
Set Material IDOn Triangles
- Parameters:
triangle_id_list (GeometryScriptIndexList) –
material_id (int32) –
defer_change_notifications (bool) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
color (LinearColor) – the constant color to set
flags (GeometryScriptColorFlags) – specify which RGBA channels to set (default all channels)
clear_existing (bool) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
vertex_color_list (GeometryScriptColorList) – per-vertex colors. Size must be less than or equal to the MaxVertexID of TargetMesh (ie gaps are supported)
debug (GeometryScriptDebug) –
- Return type:
- 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:
vertex_normal_list (GeometryScriptVectorList) – per-vertex normals. Size must be equal to the MaxVertexID of TargetMesh (ie non-compact TargetMesh is supported)
debug (GeometryScriptDebug) –
- Return type:
- 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
- Parameters:
tangent_x_list (GeometryScriptVectorList) – per-vertex tangent vectors. Size must be equal to the MaxVertexID of TargetMesh (ie non-compact TargetMesh is supported)
tangent_y_list (GeometryScriptVectorList) – per-vertex bitangent/binormal vectors. Size must be equal to TangentXList
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
- 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:
uv_set_index (int32) –
triangle_id (int32) –
u_vs (GeometryScriptUVTriangle) –
defer_change_notifications (bool) –
- Returns:
is_valid_triangle (bool):
- Return type:
- 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:
uv_set_index (int32) –
box_transform (Transform) –
selection (GeometryScriptMeshSelection) –
min_island_tri_count (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
uv_set_index (int32) –
cylinder_transform (Transform) –
selection (GeometryScriptMeshSelection) –
split_angle (float) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
uv_set_index (int32) –
plane_transform (Transform) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- set_num_extended_polygroup_layers(num_layers, debug=None) DynamicMesh ¶
Set Num Extended Polygroup Layers
- Parameters:
num_layers (int32) –
debug (GeometryScriptDebug) –
- Return type:
- set_num_uv_sets(num_uv_sets, debug=None) DynamicMesh ¶
Set Num UVSets
- Parameters:
num_uv_sets (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
- 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:
- set_triangle_material_id(triangle_id, material_id, defer_change_notifications=False) -> (DynamicMesh, is_valid_triangle=bool)¶
Set Triangle Material ID
- 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:
vertex_id (int32) – vertex to update
bone_weights (Array[GeometryScriptBoneWeight]) – input array of bone index/weight pairs for the Vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- Returns:
is_valid_vertex_id (bool): will be returned as true if the vertex ID is valid
- Return type:
- set_vertex_position(vertex_id, new_position, defer_change_notifications=False) -> (DynamicMesh, is_valid_vertex=bool)¶
Set Vertex Position
- split_mesh_bowties(mesh_bowties=True, attribute_bowties=True, debug=None) DynamicMesh ¶
Split Mesh Bowties
- Parameters:
mesh_bowties (bool) –
attribute_bowties (bool) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- 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:
group_layer (GeometryScriptGroupLayer) –
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_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:
transform (Transform) –
fix_orientation_for_negative_scale (bool) –
debug (GeometryScriptDebug) –
- Return type:
- transform_mesh_selection(selection, transform, debug=None) DynamicMesh ¶
Transform Mesh Selection
- Parameters:
selection (GeometryScriptMeshSelection) –
transform (Transform) –
debug (GeometryScriptDebug) –
- Return type:
- translate_mesh(translation, debug=None) DynamicMesh ¶
Translate Mesh
- Parameters:
translation (Vector) –
debug (GeometryScriptDebug) –
- Return type:
- translate_mesh_selection(selection, translation, debug=None) DynamicMesh ¶
Translate Mesh Selection
- Parameters:
selection (GeometryScriptMeshSelection) –
translation (Vector) –
debug (GeometryScriptDebug) –
- Return type:
- translate_mesh_u_vs(uv_set_index, translation, selection, debug=None) DynamicMesh ¶
Translate Mesh UVs
- Parameters:
uv_set_index (int32) –
translation (Vector2D) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
pivot_location (Vector) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
- weld_mesh_edges(weld_options, debug=None) DynamicMesh ¶
Weld Mesh Edges
- Parameters:
weld_options (GeometryScriptWeldEdgesOptions) –
debug (GeometryScriptDebug) –
- Return type: