# EditableMesh

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/EditableMesh/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/EditableMesh

Object which allows for the runtime creation and manipulation of meshes.

## Properties

### EditableMeshDataHolder

```luau
EditableMesh.EditableMeshDataHolder: NetAssetRef
```

- Tags: Hidden, Not scriptable, Roblox engine security, Read capabilities: DynamicGeneration

### FixedSize

```luau
EditableMesh.FixedSize: boolean
```

- Tags: Read only, Write: Roblox engine security, Read capabilities: DynamicGeneration, Save only

Returns `true` if a mesh is fixed-size.

### IsReplicatedCopy

```luau
EditableMesh.IsReplicatedCopy: boolean
```

- Tags: Hidden, Not replicated, Not scriptable, Roblox engine security, Read capabilities: DynamicGeneration

### MeshData

```luau
EditableMesh.MeshData: SharedString
```

- Tags: Hidden, Not scriptable, Roblox engine security, Read capabilities: DynamicGeneration

## Methods

### AddBone

```luau
EditableMesh:AddBone(boneProperties: { [string]: any }): number
```

- Tags: Capabilities: DynamicGeneration

Adds a new bone and returns a bone ID.

Parameters:

- `boneProperties`: Options table containing bone parameters:

- `Name` — A string that specifies the bone name. Note that all bone names in a mesh must be unique, and the maximum length is 100 characters.
- `ParentId` — Optional bone ID of the new bone's parent.
- [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) — Initial [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) of the bone in the bind pose of the mesh, in the mesh's local space.
- `Virtual` — Boolean that specifies whether this bone is virtual. Virtual bones can only be bound to a [`FaceControls`](https://rapi.sleaze.dev/classes/FaceControls.md) instance.

Returns: Bone ID of the new bone.

### AddColor

```luau
EditableMesh:AddColor(color: Color3, alpha: number): number
```

- Tags: Capabilities: DynamicGeneration

Adds a new color to the geometry and returns a color ID.

Parameters:

- `color`: The new color.
- `alpha`: The color alpha (transparency). `0` is fully transparent, and `1` is fully opaque.

Returns: Color ID of the new color.

### AddFace

```luau
EditableMesh:AddFace(vertexIds: { any }): number
```

- Tags: Capabilities: DynamicGeneration

Adds a new triangle or quad face to the mesh and returns a face ID.

Parameters:

- `vertexIds`: Array of the new face's vertex IDs, in order around the face. Provide 3 IDs to create a triangle or 4 IDs to create a quad.

Returns: Face ID of the new face.

### AddNormal

```luau
EditableMesh:AddNormal(normal: Vector3?): number
```

- Tags: Capabilities: DynamicGeneration

Adds a new normal to the geometry and returns a normal ID.

Parameters:

- `normal`: The normal vector. If the normal value isn't specified, the normal will be automatically calculated.

Returns: Normal ID of the new normal.

### AddTriangle

```luau
EditableMesh:AddTriangle(vertexId0: number, vertexId1: number, vertexId2: number): number
```

- Tags: Capabilities: DynamicGeneration

Adds a new triangle to the mesh and returns a face ID.

Parameters:

- `vertexId0`: ID of the first vertex of the triangle.
- `vertexId1`: ID of the second vertex of the triangle.
- `vertexId2`: ID of the third vertex of the triangle.

Returns: Stable face ID of the new face.

### AddUV

```luau
EditableMesh:AddUV(uv: Vector2): number
```

- Tags: Capabilities: DynamicGeneration

Adds a new UV to the geometry and returns a UV ID.

Parameters:

- `uv`: The new UV coordinate.

Returns: UV ID of the new UV.

### AddVertex

```luau
EditableMesh:AddVertex(p: Vector3): number
```

- Tags: Capabilities: DynamicGeneration

Adds a new vertex to the geometry and returns a vertex ID.

Parameters:

- `p`: Position in the mesh's local object space.

Returns: Vertex ID of the new vertex.

### BatchAdd

```luau
EditableMesh:BatchAdd(attr: Enum.MeshAttribute, data: { any }): { any }
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Creates new mesh elements of the given attribute type and returns their IDs.

Parameters:

- `attr`: The `MeshAttribute` type of element to create.
- `data`: Values to initialize the new elements. An array of [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) for `Vertex` or `Normal`; an array of [`Vector2`](https://rapi.sleaze.dev/index/types/Vector2.md) for `UV`; an array of [`Color3`](https://rapi.sleaze.dev/index/types/Color3.md) followed by a matching array of alpha numbers (same length) for `Color`; a 2D array of vertex-ID arrays for `Face`.

Returns: Ordered array of new element IDs matching the input order.

### BatchGetFaceAttributes

```luau
EditableMesh:BatchGetFaceAttributes(attr: Enum.MeshAttribute, faceIds: { any }): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the per-corner attribute IDs for each face in a batch.

Parameters:

- `attr`: The attribute to retrieve for each face's corners. Must be `MeshAttribute.Vertex`, `MeshAttribute.Normal`, `MeshAttribute.Color`, or `MeshAttribute.UV`; `MeshAttribute.Face` is not supported and throws an error.
- `faceIds`: Faces to query.

Returns: 2D array where `result[i]` is the array of attribute IDs at the corners of `faceIds[i]`.

### BatchGetValues

```luau
EditableMesh:BatchGetValues(ids: { any }): ...any
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns attribute values for each ID in a batch.

Parameters:

- `ids`: IDs of the elements to read. All must be the same attribute type — vertex, normal, color, or UV. The attribute is determined by the ID type, so no `MeshAttribute` argument is needed. Mixing types, or passing face or bone IDs, throws an error.

Returns: A tuple of two values. The first is an array of attribute values: [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) for vertex or normal IDs, [`Vector2`](https://rapi.sleaze.dev/index/types/Vector2.md) for UV IDs, [`Color3`](https://rapi.sleaze.dev/index/types/Color3.md) for color IDs. The second is `nil` for all attribute types except color, where it is an array of alpha numbers.

### BatchGetVertexAttributes

```luau
EditableMesh:BatchGetVertexAttributes(attr: Enum.MeshAttribute, vertexIds: { any }): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the attribute IDs associated with each vertex in a batch.

Parameters:

- `attr`: The attribute type to look up. Must be `MeshAttribute.Face` (faces that reference each vertex), `MeshAttribute.Normal`, `MeshAttribute.Color`, or `MeshAttribute.UV`; `MeshAttribute.Vertex` is not supported and throws an error (to read vertex positions, use [`BatchGetValues()`](https://rapi.sleaze.dev/classes/EditableMesh.md)).
- `vertexIds`: Vertices to query.

Returns: 2D array where `result[i]` is the array of attribute IDs associated with `vertexIds[i]`.

### BatchGetVertexFaceAttributes

```luau
EditableMesh:BatchGetVertexFaceAttributes(attr: Enum.MeshAttribute, vertexIds: { any }, faceIds: { any }): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the attribute ID at each specified corner for a batch of vertex–face pairs.

Parameters:

- `attr`: The attribute to retrieve. Must be `MeshAttribute.Normal`, `MeshAttribute.Color`, or `MeshAttribute.UV`; `MeshAttribute.Vertex` and `MeshAttribute.Face` are not supported and throw an error.
- `vertexIds`: Vertices that identify each corner.
- `faceIds`: Faces that identify each corner. Must be the same length as `vertexIds`.

Returns: Array of attribute IDs at each corner, in the same order as the inputs.

### BatchRemove

```luau
EditableMesh:BatchRemove(ids: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Removes a batch of faces.

### BatchSetFaceAttributes

```luau
EditableMesh:BatchSetFaceAttributes(faceIds: { any }, attrIdArrays: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Sets the per-corner attribute IDs for each face in a batch.

Parameters:

- `faceIds`: Face IDs to update. Must be the same length as `attrIdArrays`.
- `attrIdArrays`: 2D array. `attrIdArrays[i]` is the list of attribute IDs for the corners of `faceIds[i]`, in order. Each inner array must have one entry per corner of the face. All IDs must be of the same attribute type — vertex, normal, color, or UV; mixing types (or passing another ID type) throws an error.

### BatchSetValues

```luau
EditableMesh:BatchSetValues(ids: { any }, values: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Writes attribute values to a batch of mesh element IDs.

Parameters:

- `ids`: IDs of the elements to write. All must be the same attribute type — vertex, normal, color, or UV. The attribute is determined by the ID type, so no `MeshAttribute` argument is needed. Mixing types, or passing face or bone IDs, throws an error.
- `values`: Values to assign. Type depends on the ID type: [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) for vertex or normal IDs, [`Vector2`](https://rapi.sleaze.dev/index/types/Vector2.md) for UV IDs, [`Color3`](https://rapi.sleaze.dev/index/types/Color3.md) or a number for color IDs. Pass `nil` for normal IDs to reset each normal to auto-computed values, equivalent to calling [`ResetNormal()`](https://rapi.sleaze.dev/classes/EditableMesh.md) on each.

### BatchSetVertexFaceAttributes

```luau
EditableMesh:BatchSetVertexFaceAttributes(vertexIds: { any }, faceIds: { any }, attrIds: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Sets the attribute at a specific corner for each vertex–face pair in a batch.

Parameters:

- `vertexIds`: Vertex IDs that identify each corner.
- `faceIds`: Face IDs that identify each corner. Must be the same length as `vertexIds`.
- `attrIds`: Attribute IDs to assign, one per pair; must be the same length as `vertexIds`. All must be the same attribute type — normal, color, or UV; passing a vertex or face ID throws an error.

### Clear

```luau
EditableMesh:Clear()
```

- Tags: Capabilities: DynamicGeneration

Clears all of an EditableMesh's geometry.

### Destroy

```luau
EditableMesh:Destroy()
```

- Tags: Capabilities: DynamicGeneration

Destroys the mesh.

### FindClosestPointOnSurface

```luau
EditableMesh:FindClosestPointOnSurface(point: Vector3): ...any
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Finds the closest point on the mesh's surface.

Parameters:

- `point`: Point position in the mesh's local object space.

Returns: Tuple of the face ID, point on the mesh in local object space, the barycentric coordinate of the position within the face, and the 3 vertex IDs that the barycentric coordinate weights.

### FindClosestVertex

```luau
EditableMesh:FindClosestVertex(toThisPoint: Vector3): number
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Finds the closest vertex to a specific point in space.

Parameters:

- `toThisPoint`: Point position in the mesh's local object space.

Returns: Closest vertex ID to the specified point in space.

### FindVerticesWithinSphere

```luau
EditableMesh:FindVerticesWithinSphere(center: Vector3, radius: number): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Finds all vertices within a specific sphere.

Parameters:

- `center`: Center of the sphere in the mesh's local object space.
- `radius`: Radius of the sphere.

Returns: List of vertex IDs within the requested sphere.

### GetAdjacentFaces

```luau
EditableMesh:GetAdjacentFaces(faceId: number): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns a list of faces adjacent to a given face.

Parameters:

- `faceId`: Face ID for which to get adjacent faces.

Returns: List of face IDs adjacent to the given face.

### GetAdjacentVertices

```luau
EditableMesh:GetAdjacentVertices(vertexId: number): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns a list of vertices adjacent to a given vertex.

Parameters:

- `vertexId`: Vertex ID around which to get adjacent vertices.

Returns: List of IDs of adjacent vertices around the given vertex ID.

### GetBoneByName

```luau
EditableMesh:GetBoneByName(boneName: string): number
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Finds the bone ID of the bone with the given name.

Parameters:

- `boneName`: Bone name to search for.

Returns: Bone ID of the bone with the given name.

### GetBoneCFrame

```luau
EditableMesh:GetBoneCFrame(boneId: number): CFrame
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the initial [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) of the bone in the bind pose of the mesh.

Parameters:

- `boneId`: Bone ID for which to get the [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md).

Returns: Initial [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) of the bone in the bind pose of the mesh, in the mesh's local space.

### GetBoneIsVirtual

```luau
EditableMesh:GetBoneIsVirtual(boneId: number): boolean
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns `true` if the bone is virtual.

Parameters:

- `boneId`: Bone ID for which to get whether the bone is virtual.

Returns: Whether the bone with the given bone ID is virtual. Virtual bones can only be bound to a [`FaceControls`](https://rapi.sleaze.dev/classes/FaceControls.md) instance.

### GetBoneName

```luau
EditableMesh:GetBoneName(boneId: number): string
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the bone name.

Parameters:

- `boneId`: Bone ID for which to get the name.

Returns: Name of the bone with the given bone ID.

### GetBoneParent

```luau
EditableMesh:GetBoneParent(boneId: number): number
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the parent bone ID, if any.

Parameters:

- `boneId`: Bone ID for which to get the parent.

Returns: Bone ID for the parent of the bone with the given bone ID. If there is no parent, returns `0`.

### GetBones

```luau
EditableMesh:GetBones(): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns all bones of the mesh.

Returns: List of bone IDs.

### GetCenter

```luau
EditableMesh:GetCenter(): Vector3
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the center of the mesh's axis-aligned bounding box.

Returns: Center of the bounding box of the [`EditableMesh`](https://rapi.sleaze.dev/classes/EditableMesh.md).

### GetColor

```luau
EditableMesh:GetColor(colorId: number): Color3?
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the color for the given color ID.

Parameters:

- `colorId`: Color ID for which to get the color.

Returns: Color for the requested color ID.

### GetColorAlpha

```luau
EditableMesh:GetColorAlpha(colorId: number): number?
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the color alpha (transparency) at the given color ID.

Parameters:

- `colorId`: Color ID for which to get the alpha.

Returns: Color alpha at the request color ID.

### GetColors

```luau
EditableMesh:GetColors(): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns all colors of the mesh.

Returns: List of color IDs.

### GetFaceColors

```luau
EditableMesh:GetFaceColors(faceId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the face's color IDs for the vertices on the face.

Parameters:

- `faceId`: Face ID for which to get the color IDs.

Returns: List of color IDs used for the vertices on the given face.

### GetFaceNormals

```luau
EditableMesh:GetFaceNormals(faceId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the face's normal IDs for the vertices on the face.

Parameters:

- `faceId`: Face ID for which to get the normal IDs.

Returns: List of normal IDs used for the vertices on the given face.

### GetFaces

```luau
EditableMesh:GetFaces(): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns all faces of the mesh.

Returns: List of face IDs.

### GetFacesWithColor

```luau
EditableMesh:GetFacesWithColor(colorId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns an array of face IDs that use the given color ID.

Parameters:

- `colorId`: Color ID to find faces for.

Returns: List of face IDs that use the provided color ID.

### GetFacesWithNormal

```luau
EditableMesh:GetFacesWithNormal(normalId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns an array of face IDs that use the given normal ID.

Parameters:

- `normalId`: Normal ID to find faces for.

Returns: List of face IDs that use the provided normal ID.

### GetFacesWithUV

```luau
EditableMesh:GetFacesWithUV(uvId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns an array of face IDs that use the given UV ID.

Parameters:

- `uvId`: UV ID to find faces for.

Returns: List of face IDs that use the provided UV ID.

### GetFaceUVs

```luau
EditableMesh:GetFaceUVs(faceId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the face's UV IDs for the vertices on the face.

Parameters:

- `faceId`: Face ID for which to get the UV IDs.

Returns: List of UV IDs used for the vertices on the given face.

### GetFaceVertices

```luau
EditableMesh:GetFaceVertices(faceId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the face's vertex IDs.

Parameters:

- `faceId`: Face ID for which to get the vertex IDs.

Returns: List of vertex IDs around the given face.

### GetFacsCorrectivePose

```luau
EditableMesh:GetFacsCorrectivePose(actions: { any }): ...any
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns bone IDs and bone `CFrames` for all bones in a specific FACS corrective pose.

Parameters:

- `actions`: Array or 2 or 3 `FacsActionUnit` values that specify a corrective pose.

Returns: Array of bone IDs and corresponding array of bone `CFrames`.

### GetFacsCorrectivePoses

```luau
EditableMesh:GetFacsCorrectivePoses(): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns all FACS corrective poses that are in use.

Returns: Array of corrective poses. Each corrective pose is specified by a small array of 2 or 3 `FacsActionUnit` values.

### GetFacsPose

```luau
EditableMesh:GetFacsPose(action: Enum.FacsActionUnit): ...any
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns bone IDs and bone `CFrames` for all bones in a specific FACS action unit.

Parameters:

- `action`: FACS action unit for which to get the pose.

Returns: Array of bone IDs and corresponding array of bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md).

### GetFacsPoses

```luau
EditableMesh:GetFacsPoses(): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns all FACS action units that have poses defined.

Returns: Array of `FacsActionUnit`, one for each FACS action unit that has a pose defined.

### GetNormal

```luau
EditableMesh:GetNormal(normalId: number): Vector3?
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the normal vector for the given normal ID.

Parameters:

- `normalId`: Normal ID for which to get the normal vector.

Returns: Normal vector at the requested normal ID.

### GetNormals

```luau
EditableMesh:GetNormals(): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns all normals of the mesh.

Returns: List of normal IDs.

### GetPosition

```luau
EditableMesh:GetPosition(vertexId: number): Vector3
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Gets the position of a vertex.

Parameters:

- `vertexId`: Vertex ID for which to get the position.

Returns: Position of a vertex in the mesh's local object space.

### GetSize

```luau
EditableMesh:GetSize(): Vector3
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the size of the mesh's axis-aligned bounding box.

Returns: Size of the [`EditableMesh`](https://rapi.sleaze.dev/classes/EditableMesh.md).

### GetUV

```luau
EditableMesh:GetUV(uvId: number): Vector2?
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns UV coordinates at the given UV ID.

Parameters:

- `uvId`: UV ID for which to get the UV coordinate.

Returns: UV coordinates at the requested UV ID.

### GetUVs

```luau
EditableMesh:GetUVs(): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns all UVs of the mesh.

Returns: List of UV IDs.

### GetVertexBones

```luau
EditableMesh:GetVertexBones(vertexId: number): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns all bone IDs that are associated with the vertex for skinning.

Parameters:

- `vertexId`: Vertex ID for which to get the associated bones.

Returns: Bone IDs associated with the vertex for skinning.

### GetVertexBoneWeights

```luau
EditableMesh:GetVertexBoneWeights(vertexId: number): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns skinning blend weights for each bone that is associated with the vertex.

Parameters:

- `vertexId`: Vertex ID for which to get the associated bone weights.

Returns: Skinning blend weights for each bone that is associated with the vertex.

### GetVertexColors

```luau
EditableMesh:GetVertexColors(vertexId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the color IDs of the faces attached to the given vertex.

Parameters:

- `vertexId`: Vertex ID to find color IDs.

Returns: Array of color IDs of faces attached to the given vertex.

### GetVertexFaceColor

```luau
EditableMesh:GetVertexFaceColor(vertexId: number, faceId: number): number
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the color ID of a vertex/face pair.

Parameters:

- `vertexId`: Vertex ID.
- `faceId`: Face ID.

Returns: Color ID of the vertex/face pair.

### GetVertexFaceNormal

```luau
EditableMesh:GetVertexFaceNormal(vertexId: number, faceId: number): number
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the normal ID of a vertex/face pair.

Parameters:

- `vertexId`: Vertex ID.
- `faceId`: Face ID.

Returns: Normal ID of the vertex/face pair.

### GetVertexFaces

```luau
EditableMesh:GetVertexFaces(vertexId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the face IDs of the faces attached to the given vertex.

Parameters:

- `vertexId`: Vertex ID to find faces for.

Returns: Array of face IDs attached to the given vertex.

### GetVertexFaceUV

```luau
EditableMesh:GetVertexFaceUV(vertexId: number, faceId: number): number
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns the UV ID of a vertex/face pair.

Parameters:

- `vertexId`: Vertex ID.
- `faceId`: Face ID.

Returns: UV ID of the vertex/face pair.

### GetVertexNormals

```luau
EditableMesh:GetVertexNormals(vertexId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the normal IDs of the faces attached to the given vertex.

Parameters:

- `vertexId`: Vertex ID to find normal IDs.

Returns: Array of normal IDs of faces attached to the given vertex.

### GetVertexUVs

```luau
EditableMesh:GetVertexUVs(vertexId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns the UV IDs of the faces attached to the given vertex.

Parameters:

- `vertexId`: Vertex ID to find UV IDs.

Returns: Array of UV IDs of faces attached to the given vertex.

### GetVertices

```luau
EditableMesh:GetVertices(): { any }
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Returns all vertices as a list of vertex IDs.

Returns: List of vertex IDs.

### GetVerticesWithColor

```luau
EditableMesh:GetVerticesWithColor(colorId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns an array of vertex IDs that use the given color ID.

Parameters:

- `colorId`: Color ID to find faces for.

Returns: List of face IDs that use the provided color ID.

### GetVerticesWithNormal

```luau
EditableMesh:GetVerticesWithNormal(normalId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns an array of vertex IDs that use the given normal ID.

Parameters:

- `normalId`: Normal ID to find vertices for.

Returns: List of vertex IDs that use the provided normal ID.

### GetVerticesWithUV

```luau
EditableMesh:GetVerticesWithUV(uvId: number): { any }
```

- Tags: Custom Lua state, Thread safe, Capabilities: DynamicGeneration

Returns an array of vertex IDs that use the given UV ID.

Parameters:

- `uvId`: UV ID to find vertices for.

Returns: List of vertex IDs that use the provided UV ID.

### IdDebugString

```luau
EditableMesh:IdDebugString(id: number): string
```

- Tags: Capabilities: DynamicGeneration

Returns a string describing an ID, useful for debugging purposes.

Parameters:

- `id`: ID for which to return a debugging information string.

Returns: String that describes the ID in human-readable format.

### MergeVertices

```luau
EditableMesh:MergeVertices(mergeTolerance: number): { [any]: any }
```

- Tags: Capabilities: DynamicGeneration

Merges vertices that touch together.

Parameters:

- `mergeTolerance`: The distance at which the vertices are considered to touch each other.

Returns: A mapping of old vertex ID to new vertex ID for vertices that have been merged.

### RaycastLocal

```luau
EditableMesh:RaycastLocal(origin: Vector3, direction: Vector3): ...any
```

- Tags: Thread safe, Capabilities: DynamicGeneration

Casts a ray and returns the intersection point, face ID, and barycentric coordinates.

Parameters:

- `origin`: Origin of the ray in the mesh's local object space.
- `direction`: Direction of the ray.

Returns: Tuple of the face ID, point of intersection, barycentric coordinates, and the 3 vertex IDs that the barycentric coordinates weight.

### RemoveBone

```luau
EditableMesh:RemoveBone(boneId: number)
```

- Tags: Capabilities: DynamicGeneration

Removes a bone using its bone ID.

Parameters:

- `boneId`: Bone ID of the bone to remove.

### RemoveFace

```luau
EditableMesh:RemoveFace(faceId: number)
```

- Tags: Capabilities: DynamicGeneration

Removes a face using its face ID.

Parameters:

- `faceId`: Face ID of the face to remove.

### RemoveUnused

```luau
EditableMesh:RemoveUnused(): { any }
```

- Tags: Capabilities: DynamicGeneration

Removes all unused vertices, normals, UVs, and colors, and returns the removed IDs.

Returns: All of the removed IDs.

### ResetNormal

```luau
EditableMesh:ResetNormal(normalId: number)
```

- Tags: Capabilities: DynamicGeneration

Reset this normal ID to be automatically calculated.

Parameters:

- `normalId`: Normal ID to reset.

### SetBoneCFrame

```luau
EditableMesh:SetBoneCFrame(boneId: number, cframe: CFrame)
```

- Tags: Capabilities: DynamicGeneration

Set the initial [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for a bone in the mesh's bind pose.

Parameters:

- `boneId`: Bone ID for which to set the initial [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md).
- `cframe`: Initial [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for the bone in the mesh's bind pose, in the mesh's local space.

### SetBoneIsVirtual

```luau
EditableMesh:SetBoneIsVirtual(boneId: number, virtual: boolean)
```

- Tags: Capabilities: DynamicGeneration

Set whether a bone is virtual.

Parameters:

- `boneId`: Bone ID for which to set whether the bone is virtual.
- `virtual`: Whether the bone should be virtual.

### SetBoneName

```luau
EditableMesh:SetBoneName(boneId: number, name: string)
```

- Tags: Capabilities: DynamicGeneration

Sets the name for a bone.

Parameters:

- `boneId`: Bone ID for which to set the name.
- `name`: Bone name to set.

### SetBoneParent

```luau
EditableMesh:SetBoneParent(boneId: number, parentBoneId: number)
```

- Tags: Capabilities: DynamicGeneration

Set a parent for a bone.

Parameters:

- `boneId`: Bone ID for which to set the parent.
- `parentBoneId`: Parent bone ID.

### SetColor

```luau
EditableMesh:SetColor(colorId: number, color: Color3)
```

- Tags: Capabilities: DynamicGeneration

Sets the color for a color ID.

Parameters:

- `colorId`: Color ID for which to set the color.
- `color`: Color to set.

### SetColorAlpha

```luau
EditableMesh:SetColorAlpha(colorId: number, alpha: number)
```

- Tags: Capabilities: DynamicGeneration

Sets the color alpha (transparency) for a color ID.

Parameters:

- `colorId`: Color ID for which to set the color alpha.
- `alpha`: Alpha to set.

### SetFaceColors

```luau
EditableMesh:SetFaceColors(faceId: number, ids: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Sets the face's vertex colors to new color IDs.

Parameters:

- `faceId`: Face ID for which to update the vertex colors.
- `ids`: List of new color IDs to use for the given face's vertices.

### SetFaceNormals

```luau
EditableMesh:SetFaceNormals(faceId: number, ids: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Sets the face's vertex normals to new normal IDs.

Parameters:

- `faceId`: Face ID for which to update the vertex normals.
- `ids`: List of new normal IDs to use for the given face's vertices.

### SetFaceUVs

```luau
EditableMesh:SetFaceUVs(faceId: number, ids: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Sets the face's vertex UVs to new UV IDs.

Parameters:

- `faceId`: Face ID for which to update the vertex UVs.
- `ids`: List of new UV IDs to use for the given face's vertices.

### SetFaceVertices

```luau
EditableMesh:SetFaceVertices(faceId: number, ids: { any })
```

- Tags: Custom Lua state, Capabilities: DynamicGeneration

Sets the face's vertices to new vertex IDs.

Parameters:

- `faceId`: Face ID for which to update the vertices.
- `ids`: List of new vertex IDs to use for the given face.

### SetFacsBonePose

```luau
EditableMesh:SetFacsBonePose(action: Enum.FacsActionUnit, boneId: number, cframe: CFrame)
```

- Tags: Capabilities: DynamicGeneration

Set [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for an individual bone in a specific FACS action unit.

Parameters:

- `action`: FACS action unit for which to set the pose.
- `boneId`: Bone to set a [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for this pose.
- `cframe`: [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) which transforms the bone from the initial bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) in the bind pose of the mesh to the combined bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for this pose. All `CFrames` are in the mesh's local space.

### SetFacsCorrectivePose

```luau
EditableMesh:SetFacsCorrectivePose(actions: { any }, boneIds: { any }, cframes: { any })
```

- Tags: Capabilities: DynamicGeneration

Set pose for all bones in a specific FACS corrective pose.

Parameters:

- `actions`: Array or 2 or 3 `FacsActionUnit` values to apply as a corrective pose.
- `boneIds`: Bones to set a [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for this pose.
- `cframes`: [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) transforms for the bones in this corrective pose. Each bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) transforms the bone from the initial bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) in the bind pose of the mesh to the combined bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for this pose. All `CFrames` are in the mesh's local space.

### SetFacsPose

```luau
EditableMesh:SetFacsPose(action: Enum.FacsActionUnit, boneIds: { any }, cframes: { any })
```

- Tags: Capabilities: DynamicGeneration

Set pose for all bones in a specific FACS action unit.

Parameters:

- `action`: FACS action unit to set the pose for.
- `boneIds`: Bones for which to set a [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for this pose.
- `cframes`: [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) transforms for the bones in this pose. Each bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) transforms the bone from the initial bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) in the bind pose of the mesh to the combined bone [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) for this pose. All `CFrames` are in the mesh's local space.

### SetNormal

```luau
EditableMesh:SetNormal(normalId: number, normal: Vector3)
```

- Tags: Capabilities: DynamicGeneration

Set the normal for a normal ID.

Parameters:

- `normalId`: Normal ID for which to set the normal vector.
- `normal`: Normal vector to set.

### SetPosition

```luau
EditableMesh:SetPosition(vertexId: number, p: Vector3)
```

- Tags: Capabilities: DynamicGeneration

Sets a vertex position in the mesh's local object space.

Parameters:

- `vertexId`: Vertex ID of the vertex to position.
- `p`: Position in the mesh's local object space.

### SetUV

```luau
EditableMesh:SetUV(uvId: number, uv: Vector2)
```

- Tags: Capabilities: DynamicGeneration

Sets UV coordinates for a UV ID.

Parameters:

- `uvId`: UV ID for which to set the UV coordinates.
- `uv`: UV coordinates.

### SetVertexBones

```luau
EditableMesh:SetVertexBones(vertexId: number, boneIDs: { any })
```

- Tags: Capabilities: DynamicGeneration

Assign a list of bones with the vertex for skinning.

Parameters:

- `vertexId`: Vertex ID to set vertex skinning bones.
- `boneIDs`: Bone IDs to use with this vertex for skinning.

### SetVertexBoneWeights

```luau
EditableMesh:SetVertexBoneWeights(vertexId: number, boneWeights: { any })
```

- Tags: Capabilities: DynamicGeneration

Sets skinning blend weights for each bone associated with the vertex.

Parameters:

- `vertexId`: Vertex ID on which to set skinning blend weights.
- `boneWeights`: Skinning blend weights to set on the vertex.

### SetVertexFaceColor

```luau
EditableMesh:SetVertexFaceColor(vertexId: number, faceId: number, colorId: number)
```

- Tags: Capabilities: DynamicGeneration

Sets the color ID of a vertex/face pair.

Parameters:

- `vertexId`: Vertex ID.
- `faceId`: Face ID.
- `colorId`: Color ID to set for the vertex/face pair.

### SetVertexFaceNormal

```luau
EditableMesh:SetVertexFaceNormal(vertexId: number, faceId: number, normalId: number)
```

- Tags: Capabilities: DynamicGeneration

Sets the normal ID of a vertex/face pair.

Parameters:

- `vertexId`: Vertex ID.
- `faceId`: Face ID.
- `normalId`: Normal ID to set for the vertex/face pair.

### SetVertexFaceUV

```luau
EditableMesh:SetVertexFaceUV(vertexId: number, faceId: number, uvId: number)
```

- Tags: Capabilities: DynamicGeneration

Sets the UV ID of a vertex/face pair.

Parameters:

- `vertexId`: Vertex ID.
- `faceId`: Face ID.
- `uvId`: UV ID to set for the vertex/face pair.

### Triangulate

```luau
EditableMesh:Triangulate()
```

- Tags: Capabilities: DynamicGeneration

Splits all faces on the mesh to be triangles.

### GetFacesWithAttribute

```luau
EditableMesh:GetFacesWithAttribute(id: number): { any }
```

- Tags: Deprecated, Thread safe, Capabilities: DynamicGeneration

**Deprecated:** This method is deprecated. Do not use it for new work.

Returns a list of faces that use a given attribute ID.

Parameters:

- `id`: Attribute ID for which to find faces that use it.

Returns: List of face IDs which use the given attribute ID.

### GetVerticesWithAttribute

```luau
EditableMesh:GetVerticesWithAttribute(id: number): { any }
```

- Tags: Deprecated, Thread safe, Capabilities: DynamicGeneration

**Deprecated:** This method is deprecated. Do not use it for new work.

Returns a list of vertices that use a given attribute ID.

Parameters:

- `id`: Attribute ID for which to find vertices that use it.

Returns: List of vertex IDs which use the given attribute ID.

## Inherited members

- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
