The Geometry Script Library contains a very broad range of functionality, from low-level mesh construction and queries, such as building a mesh triangle-by-triangle or counting its vertices, to high-level operations like mesh booleans and intersection tests.
For more information on using the Geometry Script Library, see Geometry Script Users Guide.
Most functions are available while working in the editor and at runtime. However, some are only available while working in the editor and have been noted in the tables below.
Asset and Component Read/Write
These functions are used to read and write Dynamic Mesh instances, such as reading and writing to or from an existing or new Asset or Component.
Node Name |
Description |
---|---|
Copy Mesh From Static Mesh |
Extracts a Dynamic Mesh Asset from a Static Mesh Asset. |
Copy Mesh To Static Mesh |
Updates a Static Mesh Asset with new geometry converted from a Dynamic Mesh Asset. |
Copy Mesh From Component |
Extracts a Dynamic Mesh Asset from any supported Component type, in World or Local space. |
Create New Volume From Mesh |
Creates a new Volume Actor (such as a Blocking Volume) from a Dynamic Mesh Asset. Note that this node only works in the Editor. |
Create New Static Mesh Asset From Mesh |
Creates a new Static Mesh Asset from a Dynamic Mesh Asset. Note that this node only works in the Editor. |
Set Static Mesh Collision From Mesh |
Generates Simple Collision shapes for a Static Mesh Asset based on the input Mesh |
Set Dynamic Mesh Collision From Mesh |
Generate Simple Collision shapes for a Dynamic Mesh Component based on the input Mesh |
Primitive Generation
These functions are used to generate and append a primitive mesh to the input Dynamic Mesh
Node Name |
Description |
---|---|
Append Box |
Appends a 3D box to a specified Dynamic Mesh. |
Append Sphere Lat Long |
Appends a 3D Sphere triangulated using latitude/longitude topology to a Dynamic Mesh. |
Append Sphere Box |
Appends a 3D sphere triangulated using box topology to a Dynamic Mesh. |
Append Capsule |
Appends a 3D Capsule to a Dynamic Mesh. |
Append Cylinder |
Appends a 3D Cylinder (with optional end caps) to a Dynamic Mesh. |
Append Cone |
Appends a 3D cone to a Dynamic Mesh. |
Append Torus |
Appends a 3D torus (donut), or partial-torus to a Dynamic Mesh. |
Append Rectangle |
Appends a planar Rectangle to a Dynamic Mesh. |
Append Round Rectangle |
Appends a planar Rectangle with Rounded Corners (RoundRect) to a Dynamic Mesh. |
Append Disc |
Appends a planar disc to a Dynamic Mesh. |
Append Triangulated Polygon |
Appends a Delaunay triangulation of a planar 2D polygon to a Dynamic Mesh. |
Append Revolve Polygon |
Appends the surface-of-revolution of a 2D polygon, full or optionally-capped partial revolution to a Dynamic Mesh. |
Append Spiral Revolve Polygon |
Revolves a 2D polygon on a helical path, like one used to create a vertical spiral. |
Append Revolve Path |
Revolves an open 2D path, with optional top and bottom end caps. |
Append Simple Extrude Polygon |
Extrudes a 2D polygon along a vertical path using a selected Dynamic Mesh. |
Append Simple Swept Polygon |
Sweeps a 2D polygon along an arbitrary 3D path using a selected Dynamic Mesh. |
Append Linear Stairs |
Appends a linear staircase using a selected Dynamic Mesh. |
Append Curved Stairs |
Appends a rising circular staircase using a selected Dynamic Mesh. |
Transform and Deformation
These functions are used to manipulate the Vertex Positions of a Dynamic Mesh. They do not change the mesh topology or connectivity.
Node Name |
Description |
---|---|
Translate Mesh |
Applies a translation to the vertices of a Mesh. |
Scale Mesh |
Applies a scale transformation to the vertices of a Mesh. |
Transform Mesh |
Applies an arbitrary FTransform to the vertices of a Mesh. |
Apply Bend Warp To Mesh |
Applies a bend warp around an axis defined by a Transform. |
Apply Twist Warp To Mesh |
Applies a twist warp around an axis defined by a Transform. |
Apply Flare Warp To Mesh |
Applies a Flare/Bulge warp. |
Apply Math Warp To Mesh |
Applies various simple math-function-based warps, currently a 1D or 2D sine-wave with arbitrary orientation. |
Apply Perlin Noise To Mesh |
Applies 3D perlin noise displacement. |
Apply Iterative Smoothing To Mesh |
Applies a number of iterations to use of simplifying mesh smoothing to a Dynamic Mesh. |
Apply Displace From Texture Map |
Applies a displacement to a Dynamic Mesh based on a Texture2D and a UV channel. |
Composition / Decomposition
These functions are used to combine meshes together, or split them apart.
Node Name |
Description |
---|---|
Copy Mesh To Mesh |
Copies the mesh from one Dynamic Mesh into another. |
Get Sub Mesh From Mesh |
Copies a list of triangles from one Dynamic Mesh to another. |
Split Mesh By Components |
Separates a mesh into parts, one for each connected-component, drawn from a Dynamic MeshPool. |
Split Mesh By Material IDs |
Separates a mesh into parts, one for each Material ID, drawn from a Dynamic MeshPool. |
Append Mesh |
Appends the geometry from one mesh to another, with optional Transform. |
Append Mesh Repeated |
Appends the geometry from one mesh to another based on the number of times it should repeat, accumulating a transform each time. This operation is useful for making patterns. |
Mesh Modeling
These functions provide standard high-level modeling operations, but are generally calling the low-level mesh processing code that the similarly-named Tool in Modeling Mode would call.
Node Name |
Description |
---|---|
Apply Mesh Boolean |
Applies a Boolean operation (such as, Union, Intersect, and Subtract) to a Dynamic Mesh based on a second mesh. |
Apply Mesh Plane Cut |
Applies a plane cut to a mesh, optionally filling any holes created. |
Apply Mesh Plane Slice |
Slices a mesh into two halves, with optional hole filling. |
Apply Mesh Mirror |
Mirrors a mesh across a plane, with optional cutting and welding of triangles. |
Apply Mesh Offset |
Moves the vertices of a mesh to an offset surface. |
Apply Mesh Shell |
Moves a copy of the mesh's triangles to an offset surface, and stitches them to the original triangles. For example, to create a thickened shell. |
Apply Mesh Extrude |
Extrudes the triangles of a mesh along a constant direction. For example, it creates a solid from an open triangulated polygon. |
Apply Mesh Solidify |
Replaces the mesh with a voxelized-and-meshed approximation (VoxWrap operation). |
Apply Mesh Morphology |
Replaces the mesh with an SDF-based offset mesh approximation. |
Apply Mesh Self Union |
Mesh-Boolean-Union an object with itself to repair self-intersections, remove floating geometry, etc. |
Apply Mesh Polygroup Bevel |
Applies Mesh Bevel operation to all PolyGroup Edges. |
Subdivision Functions
These functions apply various mesh subdivision strategies to a Dynamic Mesh Asset.
Node Name |
Description |
---|---|
Apply Recursive PNTessellation |
Node is deprecated. |
Apply Polygroup Catmull Clark SubD |
Apply Catmull Clark Subdivision to the Polygroup Topology of the Mesh (discards input triangulation). Note that this node only works in the Editor. |
Apply Triangle Loop SubD |
Apply Loop Subdivision to the input mesh. Note that this node only works in the Editor. |
Simplification Functions
These functions simplify a mesh using various strategies.
Node Name |
Description |
---|---|
Apply Simplify To Triangle Count |
Simplifies the mesh until a target triangle count is reached. |
Apply Simplify To Vertex Count |
Simplifies the mesh until a target vertex count is reached. |
Apply Simplify To Tolerance |
Simplifies the mesh to a target geometric tolerance. For example, any further simplification would result in a deviation from the input mesh larger than the tolerance. |
Apply Simplify To Planar |
Simplifies planar areas of the mesh that have more triangles than necessary. Note that it does not change the 3D shape of the mesh. |
Apply Simplify To Polygroup Topology |
Simplifies the mesh down to the Polygroup Topology. For example, the high-level faces of the mesh polygroups. Another example would be on a default Box-Sphere where simplifying to polygroup topology produces a box. |
Normals Functions
These functions recompute the Normals of a mesh.
Node Name |
Description |
---|---|
Flip Normals |
Flips the mesh normals by reversing the orientation of each face. |
Set Per Vertex Normals |
Sets the mesh normals to per-vertex normals. For example, no split normals at any vertex. |
Set Per Face Normals |
Sets the mesh normals to per-face/triangle normals. For example, split normals along every edge of the mesh. |
Compute Split Normals |
Computes split-normals for the mesh based on an angle tolerance and/or other factors such as polygroup topology. |
Recompute Normals |
Recomputes the existing mesh normals. Preserves existing split normals. For use after mesh deformations, for example. |
Compute Tangents |
Recomputes tangents for the mesh (various methods). |
Cleanup/Repair Functions
These functions are used to fix issues in a mesh, or to apply other standard repairs.
Node Name |
Description |
---|---|
Compact Mesh |
Compacts the mesh's vertices and triangles to remove any "holes" in the Vertex ID or Triangle ID lists (see discussion in Low-Level Mesh Queries section). |
Discard Mesh Attributes |
Removes the Attribute Set from a Dynamic Mesh, such as all UVs, Normals, Material IDs, Vertex Colors, and extended Polygroup Layers. Note that this may prevent many functions from working. |
Auto Repair Normals |
This function tries to automatically reorient the Normals of a mesh so that they are consistent, such as fixing flipped normals. |
Weld Mesh Edges |
Welds any open boundary edges of the mesh together if possible in order to remove "cracks." |
Fill All Mesh Holes |
Tries to fill all open boundary loops (such as holes in the geometry surface) of a mesh. |
Remove Small Components |
Removes connected components of the mesh that have a volume, area, or triangle count below a threshold. |
Remove Hidden Triangles |
Removes any triangles in the mesh that are not visible from the exterior view, under various definitions of "visible" and "outside." |
Low-Level Mesh Queries
These functions provide low-level information about the elements of a mesh. In this context, VertexID and TriangleID are integers.
In a Dynamic Mesh, there may be gaps in VertexID or TriangleID range — after vertices/triangles are deleted — and some operations (like Simplification) may return a mesh with gaps present. Gaps in the ID ranges are cleaned up using the Compact Mesh function.
Node Name |
Description |
---|---|
Get Vertex Count |
Gets the number of vertices in the mesh. |
Get Num Vertex IDs |
Gets the number of Vertex IDs in the mesh, which may be larger than the Vertex Count, if the mesh is not dense. For example, after deleting vertices. |
Is Valid Vertex ID |
Returns true if a Vertex ID refers to a valid vertex. |
Get All Vertex IDs |
Returns an IndexList of all Vertex IDs in mesh. |
Get Vertex Position |
Gets the 3D position of a mesh vertex, by Vertex ID. |
Get All Vertex Positions |
Returns a Vector List of all the mesh vertex positions (possibly large!). |
Get Triangle Count ()** |
Returns the number of triangles in the mesh. Note that this is a function on Dynamic Mesh directly. |
Get Num Triangle IDs |
Gets the number of Triangle IDs in the mesh. This may be larger than the Triangle Count if the mesh is not dense, even after deleting triangles. |
Is Valid Triangle ID |
Returns true if a TriangleID refers to a valid Triangle. |
Get All Triangle IDs |
Returns an Index List of all Triangle IDs in a mesh. |
Get Triangle Indices |
Returns the vertex indices triplet for a Triangle. |
Get All Triangle Indices |
Returns a TriangleList of all Triangle indices triplets in a mesh. |
Get TrianglePositions |
Returns the three corner positions for a Triangle. |
Get TriangleFace Normal |
Returns the face/facet normal of a Triangle. |
Get TriangleUVs |
Returns the three corner UVs for a Triangle. |
Get Triangle Material ID |
Returns the current Material ID for a Triangle. |
Get All Triangle Material IDs |
Returns an Index List of all triangle Material IDs. |
Get Triangle Polygroup ID |
Returns the current Polygroup ID for a Triangle, in a given Polygroup layer. |
Get Has Vertex ID Gaps |
Returns true if there are gaps in the Vertex ID list. For example, Get Number of Vertex IDs is greater than Get Vertex Count. |
Get Has Triangle ID Gaps |
Returns true if there are gaps in the Triangle ID list, such that Get Num Triangle IDs is greater than Get Triangle Count. |
Get Is Dense Mesh |
Returns true if the mesh is dense. For example, no gaps in Vertex IDs or Triangle IDs. |
Get Mesh Has Attribute Set |
Returns true if the mesh has an Attribute Set enabled to store UVs, Normals, Material IDs, and Vertex Colors (This generally enabled by default.). |
Low-Level Mesh Building
These functions are used to construct a mesh triangle-by-triangle, and perform other low-level mesh editing operations.
Using these functions in situations that involve looping over the elements of meshes with many thousands of triangles can be quite slow in Blueprint or Python scripting.
Node Name |
Description |
---|---|
Set Vertex Position |
Sets the 3D position of a mesh vertex. |
Add Vertex To Mesh |
Adds a new vertex to the mesh and returns a new Vertex ID. |
Add Vertices To Mesh |
Adds a list of vertices to the mesh. |
Delete Vertex From Mesh |
Removes a vertex from the mesh. |
Delete Vertices From Mesh |
Removes a list of vertices from the mesh. |
Add Triangle To Mesh |
Adds a triangle (3-element Vertex ID tuple) to the mesh. |
Add Triangles To Mesh |
Adds a list of triangles to the mesh. |
Delete Triangle From Mesh |
Removes a triangle from the mesh. |
Delete Triangles From Mesh |
Removes a list of triangles from the mesh. |
Delete Triangles In Polygroup |
Deletes all triangles from the mesh that have a particular polygroup, in a specific Polygroup layer. |
Append Buffers To Mesh |
Adds a set of vertices/triangles to the mesh, with Normals, UVs, and so on. Similar to Create Mesh Section in Proc Mesh Component. |
Set Mesh Triangle Normals |
Sets the Normals of a mesh triangle. |
Set Mesh Triangle UVs |
Sets the UVs of a mesh triangle. |
Set Triangle Material ID |
Sets the Material ID of a mesh triangle. |
MaterialID Functions
These functions are used for manipulating Material IDs of a mesh. A Material ID is a per-triangle integer and is not directly connected to any specific Material. Each Material ID is associated with a Mesh Section when converting to or from a Static Mesh.
Node Name |
Description |
---|---|
Get Has Material IDs |
Returns true if the mesh has Material IDs available/enabled. |
Enable Material IDs |
Enables Material IDs on a mesh, initialize to 0. |
Clear Material IDs |
Resets all Material IDs on a mesh to 0. |
Get Max Material ID |
Returns the maximum Material ID currently set on a mesh. |
Remap Material IDs |
For all triangles with a Material ID matching a given value, and sets the Material ID to a new value. |
Set All Triangle Material IDs |
Sets the Material ID of all triangles in a mesh to the values in an input Index List. |
Set Polygroup Material ID |
Sets the Material ID of all triangles in a mesh that have a specified Polygroup ID (in a given Polygroup layer) to the specified Material ID. |
Vertex Colors
These functions are used to manipulate Vertex Colors of a mesh.
Node Name |
Description |
---|---|
Set Mesh Constant Vertex Color |
Sets all vertex colors to a specific color. |
Set Mesh Per Vertex Colors |
Sets the color for every vertex using a Color List. |
UV Functions
These functions are used to manipulate UVs of a mesh.
Node Name |
Description |
---|---|
Get Num UV Sets |
Gets the number of UV Sets/Layers on a Mesh. |
Set Num UV Sets |
Sets the number of UV Sets/Layers on a Mesh. |
Get UV Set Bounding Box |
Gets the 2D bounding box of all UVs in a UV Set. |
CopyUVSet |
Replaces target UV set with values from source UV set. |
Translate Mesh UVs |
Applies 2D Translation to UVs in a UV Set. |
Scale Mesh UVs |
Applies 2D Scale to UVs in a UV Set. |
Rotate Mesh UVs |
Applies 2D Rotation to UVs in a UV Set. |
Recompute Mesh UVs |
Recomputes UVs for a Mesh based on different types of well-defined UV islands, such as existing UV islands, polygroups, and so on). |
Repack Mesh UVs |
Packs the existing UV islands into standard UV space. |
Set Mesh UVs From Planar Projection |
Sets UVs for a mesh using a Planar projection. |
Set Mesh UVs From Box Projection |
Sets UVs for a mesh using Box Projection. |
Set Mesh UVs From Cylinder Projection |
Sets UVs for a mesh using Cylinder projection. |
Auto Generate Patch Builder Mesh UVs |
Computes new UVs using PatchBuilder method, and optionally pack. |
Auto Generate X Atlas Mesh UVs |
Computes new UVs using XAtlas, and optionally packs. |
PolyGroup Functions
These functions are used to manipulate PolyGroups of a mesh. PolyGroups are per-triangle integers which, in Modeling Tools and some Geometry Script operations, are used to implicitly define regions and patches of triangles. Note however that a PolyGroup layer is ultimately just a per-triangle number, and so can be used for any other user-defined purpose.
Node Name |
Description |
---|---|
Get Has Polygroups |
Returns true if the mesh has a standard Polygroup Layer. |
Enable Polygroups |
Enables standard Polygroup Layer on a Mesh. |
GetNum Extended Polygroup Layers |
Returns the count of extended Polygroup Layers. Note that extended Polygroup Layers are not yet fully supported by all operations or modeling tools. |
Set Num Extended Polygroup Layers |
Sets the number of extended Polygroup Layers on a Mesh. |
Clear Polygroups |
Resets the triangle Polygroup assignments to a constant value for a given Polygroup Layer. |
Copy Polygroups Layer |
Copies Polygroups from one layer to another. |
Convert UV Islands To Polygroups |
Creates and assigns a new Polygroup for each disconnected UV island of a Mesh. |
Convert Components To Polygroups |
Creates and assigns a new Polygroup for each disconnected component of a Mesh. |
Compute Polygroups From Angle Threshold |
Sets Polygroups by partitioning the mesh based on an edge crease/opening-angle. |
Mesh Geometric Queries
These functions allow for high-level geometric queries of a mesh.
Node Name |
Description |
---|---|
Get Mesh Bounding Box |
Computes the bounding box of the mesh vertices. |
Get Mesh Volume Area |
Computes the volume and area of the mesh. |
Get Is Closed Mesh |
Returns true if the mesh is closed, such as no topological boundary edges. |
Get Num Open Border Loops |
Returns the number of open border loops, such as "holes" in the mesh. |
Get Num Open Border Edges |
Returns the number of topological boundary edges in the mesh. |
Get Num Connected Components |
Returns the number of separate connected-components in the mesh, such as "triangle patches" connected by shared edges. |
Compute Mesh Convex Hull |
Computes and returns the convex hull of the input mesh and returns in a separate mesh. |
Compute Mesh Swept Hull |
Computes a 2D swept-hull of the input mesh and returns in a separate mesh. |
Mesh Comparisons
These functions enable comparisons between two meshes. These nodes do not modify either mesh through their usage.
Node Name |
Description |
---|---|
Is Same Mesh As |
Returns true if the two input meshes are equivalent under the comparisons defined by the input options. |
Measure Distances Between Meshes |
Measures the min/max and average closest-point distances between two meshes. |
Is Intersecting Mesh |
Returns true if the two input meshes (with optional transforms) are geometrically intersecting. |
BVH/AABBTree & Spatial Queries
These functions are used to create and query a AABBTree object for a mesh.
Node Name |
Description |
---|---|
Build BVH For Mesh |
Builds a Bounding Volume Hierarchy (BVH) object for a mesh that can be used with the queries below. The function returns a Geometry Script Dynamic Mesh BVH struct. |
Is BVH Valid For Mesh |
Checks if the BVH object can still be used with the Mesh — it generally returns false if the mesh has been changed. |
Rebuild BVH For Mesh |
Rebuilds the BVH object for the mesh in-place, which can reduce memory allocations, compared to building a new BVH. |
Find Nearest Point On Mesh |
Finds the nearest point on the mesh/BVH to a given 3D point. |
Find Nearest Ray Intersection With Mesh |
Finds the nearest intersection of a 3D ray with the mesh/BVH. |
Is Point Inside Mesh |
Tests if a point is inside the mesh/BVH using the Fast Winding Number query. |
Utilities
These helper functions are useful in Geometry Script mesh processing and procedural generators.
Node Name |
Description |
---|---|
Create Dynamic Mesh Pool |
Creates a new Dynamic Mesh Pool object. |
Create Unique New Asset Path Name |
Create a new unique asset name given a base path and base asset name, which is useful with functions like Create New Static Mesh Asset From Mesh. Note that this node only works in the Editor. |