Skip to content
Roblox API Reference

EditableMesh

Object which allows for the runtime creation and manipulation of meshes.
  • Not creatable
Memory category
Instances
Own members
99
Inherited members
6
Subclasses
0
Siblings
30

Properties6

Inherited fromObject2

Property categoryData

Defined byEditableMesh4

Property categoryData

  • EditableMesh.EditableMeshDataHolder: NetAssetRef
    • Hidden
    • Not scriptable
    • Roblox engine security
    • Read capabilities: DynamicGeneration
  • EditableMesh.FixedSize: boolean
    Returns true if a mesh is fixed-size.
    • Read only
    • Write: Roblox engine security
    • Read capabilities: DynamicGeneration
    • Save only
  • EditableMesh.IsReplicatedCopy: boolean
    • Hidden
    • Not replicated
    • Not scriptable
    • Roblox engine security
    • Read capabilities: DynamicGeneration
  • EditableMesh.MeshData: SharedString
    • Hidden
    • Not scriptable
    • Roblox engine security
    • Read capabilities: DynamicGeneration

Methods98

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Defined byEditableMesh95
  • EditableMesh:AddBone(boneProperties: { [string]: any }): number
    Adds a new bone and returns a bone ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneProperties: { [string]: any }
    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 — Initial CFrame 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 instance.
    Returns
    TypeDescription
    number
    Bone ID of the new bone.
  • EditableMesh:AddColor(color: Color3, alpha: number): number
    Adds a new color to the geometry and returns a color ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    color: Color3
    The new color.
    alpha: number
    The color alpha (transparency). 0 is fully transparent, and 1 is fully opaque.
    Returns
    TypeDescription
    number
    Color ID of the new color.
  • EditableMesh:AddFace(vertexIds: { any }): number
    Adds a new triangle or quad face to the mesh and returns a face ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexIds: { any }
    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
    TypeDescription
    number
    Face ID of the new face.
  • EditableMesh:AddNormal(normal: Vector3?): number
    Adds a new normal to the geometry and returns a normal ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    normal: Vector3?
    The normal vector. If the normal value isn't specified, the normal will be automatically calculated.
    Returns
    TypeDescription
    number
    Normal ID of the new normal.
  • EditableMesh:AddTriangle(vertexId0: number,vertexId1: number,vertexId2: number,): number
    Adds a new triangle to the mesh and returns a face ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId0: number
    ID of the first vertex of the triangle.
    vertexId1: number
    ID of the second vertex of the triangle.
    vertexId2: number
    ID of the third vertex of the triangle.
    Returns
    TypeDescription
    number
    Stable face ID of the new face.
  • EditableMesh:AddUV(uv: Vector2): number
    Adds a new UV to the geometry and returns a UV ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    uv: Vector2
    The new UV coordinate.
    Returns
    TypeDescription
    number
    UV ID of the new UV.
  • EditableMesh:AddVertex(p: Vector3): number
    Adds a new vertex to the geometry and returns a vertex ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    p: Vector3
    Position in the mesh's local object space.
    Returns
    TypeDescription
    number
    Vertex ID of the new vertex.
  • EditableMesh:BatchAdd(attr: Enum.MeshAttribute, data: { any }): { any }
    Creates new mesh elements of the given attribute type and returns their IDs.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    attr: Enum.MeshAttribute
    The MeshAttribute type of element to create.
    data: { any }
    Values to initialize the new elements. An array of Vector3 for Vertex or Normal; an array of Vector2 for UV; an array of Color3 followed by a matching array of alpha numbers (same length) for Color; a 2D array of vertex-ID arrays for Face.
    Returns
    TypeDescription
    { any }
    Ordered array of new element IDs matching the input order.
  • EditableMesh:BatchGetFaceAttributes(attr: Enum.MeshAttribute,faceIds: { any },): { any }
    Returns the per-corner attribute IDs for each face in a batch.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    attr: Enum.MeshAttribute
    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: { any }
    Faces to query.
    Returns
    TypeDescription
    { any }
    2D array where result[i] is the array of attribute IDs at the corners of faceIds[i].
  • EditableMesh:BatchGetValues(ids: { any }): ...any
    Returns attribute values for each ID in a batch.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    ids: { any }
    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
    TypeDescription
    ...any
    A tuple of two values. The first is an array of attribute values: Vector3 for vertex or normal IDs, Vector2 for UV IDs, Color3 for color IDs. The second is nil for all attribute types except color, where it is an array of alpha numbers.
  • EditableMesh:BatchGetVertexAttributes(attr: Enum.MeshAttribute,vertexIds: { any },): { any }
    Returns the attribute IDs associated with each vertex in a batch.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    attr: Enum.MeshAttribute
    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()).
    vertexIds: { any }
    Vertices to query.
    Returns
    TypeDescription
    { any }
    2D array where result[i] is the array of attribute IDs associated with vertexIds[i].
  • EditableMesh:BatchGetVertexFaceAttributes(attr: Enum.MeshAttribute,vertexIds: { any },faceIds: { any },): { any }
    Returns the attribute ID at each specified corner for a batch of vertex–face pairs.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    attr: Enum.MeshAttribute
    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: { any }
    Vertices that identify each corner.
    faceIds: { any }
    Faces that identify each corner. Must be the same length as vertexIds.
    Returns
    TypeDescription
    { any }
    Array of attribute IDs at each corner, in the same order as the inputs.
  • EditableMesh:BatchRemove(ids: { any })
    Removes a batch of faces.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    Parameter
    ids: { any }
  • EditableMesh:BatchSetFaceAttributes(faceIds: { any }, attrIdArrays: { any })
    Sets the per-corner attribute IDs for each face in a batch.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceIds: { any }
    Face IDs to update. Must be the same length as attrIdArrays.
    attrIdArrays: { any }
    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.
  • EditableMesh:BatchSetValues(ids: { any }, values: { any })
    Writes attribute values to a batch of mesh element IDs.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    ids: { any }
    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: { any }
    Values to assign. Type depends on the ID type: Vector3 for vertex or normal IDs, Vector2 for UV IDs, Color3 or a number for color IDs. Pass nil for normal IDs to reset each normal to auto-computed values, equivalent to calling ResetNormal() on each.
  • EditableMesh:BatchSetVertexFaceAttributes(vertexIds: { any },faceIds: { any },attrIds: { any },)
    Sets the attribute at a specific corner for each vertex–face pair in a batch.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexIds: { any }
    Vertex IDs that identify each corner.
    faceIds: { any }
    Face IDs that identify each corner. Must be the same length as vertexIds.
    attrIds: { any }
    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.
  • EditableMesh:Clear()
    Clears all of an EditableMesh's geometry.
    • Capabilities: DynamicGeneration
  • EditableMesh:Destroy()
    Destroys the mesh.
    • Capabilities: DynamicGeneration
  • EditableMesh:FindClosestPointOnSurface(point: Vector3): ...any
    Finds the closest point on the mesh's surface.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    point: Vector3
    Point position in the mesh's local object space.
    Returns
    TypeDescription
    ...any
    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.
  • EditableMesh:FindClosestVertex(toThisPoint: Vector3): number
    Finds the closest vertex to a specific point in space.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    toThisPoint: Vector3
    Point position in the mesh's local object space.
    Returns
    TypeDescription
    number
    Closest vertex ID to the specified point in space.
  • EditableMesh:FindVerticesWithinSphere(center: Vector3, radius: number): { any }
    Finds all vertices within a specific sphere.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    center: Vector3
    Center of the sphere in the mesh's local object space.
    radius: number
    Radius of the sphere.
    Returns
    TypeDescription
    { any }
    List of vertex IDs within the requested sphere.
  • EditableMesh:GetAdjacentFaces(faceId: number): { any }
    Returns a list of faces adjacent to a given face.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to get adjacent faces.
    Returns
    TypeDescription
    { any }
    List of face IDs adjacent to the given face.
  • EditableMesh:GetAdjacentVertices(vertexId: number): { any }
    Returns a list of vertices adjacent to a given vertex.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID around which to get adjacent vertices.
    Returns
    TypeDescription
    { any }
    List of IDs of adjacent vertices around the given vertex ID.
  • EditableMesh:GetBoneByName(boneName: string): number
    Finds the bone ID of the bone with the given name.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneName: string
    Bone name to search for.
    Returns
    TypeDescription
    number
    Bone ID of the bone with the given name.
  • EditableMesh:GetBoneCFrame(boneId: number): CFrame
    Returns the initial CFrame of the bone in the bind pose of the mesh.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to get the CFrame.
    Returns
    TypeDescription
    CFrame
    Initial CFrame of the bone in the bind pose of the mesh, in the mesh's local space.
  • EditableMesh:GetBoneIsVirtual(boneId: number): boolean
    Returns true if the bone is virtual.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to get whether the bone is virtual.
    Returns
    TypeDescription
    boolean
    Whether the bone with the given bone ID is virtual. Virtual bones can only be bound to a FaceControls instance.
  • EditableMesh:GetBoneName(boneId: number): string
    Returns the bone name.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to get the name.
    Returns
    TypeDescription
    string
    Name of the bone with the given bone ID.
  • EditableMesh:GetBoneParent(boneId: number): number
    Returns the parent bone ID, if any.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to get the parent.
    Returns
    TypeDescription
    number
    Bone ID for the parent of the bone with the given bone ID. If there is no parent, returns 0.
  • EditableMesh:GetBones(): { any }
    Returns all bones of the mesh.
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    List of bone IDs.
  • EditableMesh:GetCenter(): Vector3
    Returns the center of the mesh's axis-aligned bounding box.
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    Vector3
    Center of the bounding box of the EditableMesh.
  • EditableMesh:GetColor(colorId: number): Color3?
    Returns the color for the given color ID.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    colorId: number
    Color ID for which to get the color.
    Returns
    TypeDescription
    Color3?
    Color for the requested color ID.
  • EditableMesh:GetColorAlpha(colorId: number): number?
    Returns the color alpha (transparency) at the given color ID.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    colorId: number
    Color ID for which to get the alpha.
    Returns
    TypeDescription
    number?
    Color alpha at the request color ID.
  • EditableMesh:GetColors(): { any }
    Returns all colors of the mesh.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    List of color IDs.
  • EditableMesh:GetFaceColors(faceId: number): { any }
    Returns the face's color IDs for the vertices on the face.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to get the color IDs.
    Returns
    TypeDescription
    { any }
    List of color IDs used for the vertices on the given face.
  • EditableMesh:GetFaceNormals(faceId: number): { any }
    Returns the face's normal IDs for the vertices on the face.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to get the normal IDs.
    Returns
    TypeDescription
    { any }
    List of normal IDs used for the vertices on the given face.
  • EditableMesh:GetFaces(): { any }
    Returns all faces of the mesh.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    List of face IDs.
  • EditableMesh:GetFacesWithColor(colorId: number): { any }
    Returns an array of face IDs that use the given color ID.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    colorId: number
    Color ID to find faces for.
    Returns
    TypeDescription
    { any }
    List of face IDs that use the provided color ID.
  • EditableMesh:GetFacesWithNormal(normalId: number): { any }
    Returns an array of face IDs that use the given normal ID.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    normalId: number
    Normal ID to find faces for.
    Returns
    TypeDescription
    { any }
    List of face IDs that use the provided normal ID.
  • EditableMesh:GetFacesWithUV(uvId: number): { any }
    Returns an array of face IDs that use the given UV ID.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    uvId: number
    UV ID to find faces for.
    Returns
    TypeDescription
    { any }
    List of face IDs that use the provided UV ID.
  • EditableMesh:GetFaceUVs(faceId: number): { any }
    Returns the face's UV IDs for the vertices on the face.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to get the UV IDs.
    Returns
    TypeDescription
    { any }
    List of UV IDs used for the vertices on the given face.
  • EditableMesh:GetFaceVertices(faceId: number): { any }
    Returns the face's vertex IDs.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to get the vertex IDs.
    Returns
    TypeDescription
    { any }
    List of vertex IDs around the given face.
  • EditableMesh:GetFacsCorrectivePose(actions: { any }): ...any
    Returns bone IDs and bone CFrames for all bones in a specific FACS corrective pose.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    actions: { any }
    Array or 2 or 3 FacsActionUnit values that specify a corrective pose.
    Returns
    TypeDescription
    ...any
    Array of bone IDs and corresponding array of bone CFrames.
  • EditableMesh:GetFacsCorrectivePoses(): { any }
    Returns all FACS corrective poses that are in use.
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    Array of corrective poses. Each corrective pose is specified by a small array of 2 or 3 FacsActionUnit values.
  • EditableMesh:GetFacsPose(action: Enum.FacsActionUnit): ...any
    Returns bone IDs and bone CFrames for all bones in a specific FACS action unit.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    action: Enum.FacsActionUnit
    FACS action unit for which to get the pose.
    Returns
    TypeDescription
    ...any
    Array of bone IDs and corresponding array of bone CFrame.
  • EditableMesh:GetFacsPoses(): { any }
    Returns all FACS action units that have poses defined.
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    Array of FacsActionUnit, one for each FACS action unit that has a pose defined.
  • EditableMesh:GetNormal(normalId: number): Vector3?
    Returns the normal vector for the given normal ID.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    normalId: number
    Normal ID for which to get the normal vector.
    Returns
    TypeDescription
    Vector3?
    Normal vector at the requested normal ID.
  • EditableMesh:GetNormals(): { any }
    Returns all normals of the mesh.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    List of normal IDs.
  • EditableMesh:GetPosition(vertexId: number): Vector3
    Gets the position of a vertex.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID for which to get the position.
    Returns
    TypeDescription
    Vector3
    Position of a vertex in the mesh's local object space.
  • EditableMesh:GetSize(): Vector3
    Returns the size of the mesh's axis-aligned bounding box.
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    Vector3
    Size of the EditableMesh.
  • EditableMesh:GetUV(uvId: number): Vector2?
    Returns UV coordinates at the given UV ID.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    uvId: number
    UV ID for which to get the UV coordinate.
    Returns
    TypeDescription
    Vector2?
    UV coordinates at the requested UV ID.
  • EditableMesh:GetUVs(): { any }
    Returns all UVs of the mesh.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    List of UV IDs.
  • EditableMesh:GetVertexBones(vertexId: number): { any }
    Returns all bone IDs that are associated with the vertex for skinning.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID for which to get the associated bones.
    Returns
    TypeDescription
    { any }
    Bone IDs associated with the vertex for skinning.
  • EditableMesh:GetVertexBoneWeights(vertexId: number): { any }
    Returns skinning blend weights for each bone that is associated with the vertex.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID for which to get the associated bone weights.
    Returns
    TypeDescription
    { any }
    Skinning blend weights for each bone that is associated with the vertex.
  • EditableMesh:GetVertexColors(vertexId: number): { any }
    Returns the color IDs of the faces attached to the given vertex.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID to find color IDs.
    Returns
    TypeDescription
    { any }
    Array of color IDs of faces attached to the given vertex.
  • EditableMesh:GetVertexFaceColor(vertexId: number, faceId: number): number
    Returns the color ID of a vertex/face pair.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID.
    faceId: number
    Face ID.
    Returns
    TypeDescription
    number
    Color ID of the vertex/face pair.
  • EditableMesh:GetVertexFaceNormal(vertexId: number, faceId: number): number
    Returns the normal ID of a vertex/face pair.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID.
    faceId: number
    Face ID.
    Returns
    TypeDescription
    number
    Normal ID of the vertex/face pair.
  • EditableMesh:GetVertexFaces(vertexId: number): { any }
    Returns the face IDs of the faces attached to the given vertex.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID to find faces for.
    Returns
    TypeDescription
    { any }
    Array of face IDs attached to the given vertex.
  • EditableMesh:GetVertexFaceUV(vertexId: number, faceId: number): number
    Returns the UV ID of a vertex/face pair.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID.
    faceId: number
    Face ID.
    Returns
    TypeDescription
    number
    UV ID of the vertex/face pair.
  • EditableMesh:GetVertexNormals(vertexId: number): { any }
    Returns the normal IDs of the faces attached to the given vertex.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID to find normal IDs.
    Returns
    TypeDescription
    { any }
    Array of normal IDs of faces attached to the given vertex.
  • EditableMesh:GetVertexUVs(vertexId: number): { any }
    Returns the UV IDs of the faces attached to the given vertex.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID to find UV IDs.
    Returns
    TypeDescription
    { any }
    Array of UV IDs of faces attached to the given vertex.
  • EditableMesh:GetVertices(): { any }
    Returns all vertices as a list of vertex IDs.
    • Thread safe
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    List of vertex IDs.
  • EditableMesh:GetVerticesWithColor(colorId: number): { any }
    Returns an array of vertex IDs that use the given color ID.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    colorId: number
    Color ID to find faces for.
    Returns
    TypeDescription
    { any }
    List of face IDs that use the provided color ID.
  • EditableMesh:GetVerticesWithNormal(normalId: number): { any }
    Returns an array of vertex IDs that use the given normal ID.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    normalId: number
    Normal ID to find vertices for.
    Returns
    TypeDescription
    { any }
    List of vertex IDs that use the provided normal ID.
  • EditableMesh:GetVerticesWithUV(uvId: number): { any }
    Returns an array of vertex IDs that use the given UV ID.
    • Custom Lua state
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    uvId: number
    UV ID to find vertices for.
    Returns
    TypeDescription
    { any }
    List of vertex IDs that use the provided UV ID.
  • EditableMesh:IdDebugString(id: number): string
    Returns a string describing an ID, useful for debugging purposes.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    id: number
    ID for which to return a debugging information string.
    Returns
    TypeDescription
    string
    String that describes the ID in human-readable format.
  • EditableMesh:MergeVertices(mergeTolerance: number): { [any]: any }
    Merges vertices that touch together.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    mergeTolerance: number
    The distance at which the vertices are considered to touch each other.
    Returns
    TypeDescription
    { [any]: any }
    A mapping of old vertex ID to new vertex ID for vertices that have been merged.
  • EditableMesh:RaycastLocal(origin: Vector3, direction: Vector3): ...any
    Casts a ray and returns the intersection point, face ID, and barycentric coordinates.
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    origin: Vector3
    Origin of the ray in the mesh's local object space.
    direction: Vector3
    Direction of the ray.
    Returns
    TypeDescription
    ...any
    Tuple of the face ID, point of intersection, barycentric coordinates, and the 3 vertex IDs that the barycentric coordinates weight.
  • EditableMesh:RemoveBone(boneId: number)
    Removes a bone using its bone ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID of the bone to remove.
  • EditableMesh:RemoveFace(faceId: number)
    Removes a face using its face ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID of the face to remove.
  • EditableMesh:RemoveUnused(): { any }
    Removes all unused vertices, normals, UVs, and colors, and returns the removed IDs.
    • Capabilities: DynamicGeneration
    Returns
    TypeDescription
    { any }
    All of the removed IDs.
  • EditableMesh:ResetNormal(normalId: number)
    Reset this normal ID to be automatically calculated.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    normalId: number
    Normal ID to reset.
  • EditableMesh:SetBoneCFrame(boneId: number, cframe: CFrame)
    Set the initial CFrame for a bone in the mesh's bind pose.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to set the initial CFrame.
    cframe: CFrame
    Initial CFrame for the bone in the mesh's bind pose, in the mesh's local space.
  • EditableMesh:SetBoneIsVirtual(boneId: number, virtual: boolean)
    Set whether a bone is virtual.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to set whether the bone is virtual.
    virtual: boolean
    Whether the bone should be virtual.
  • EditableMesh:SetBoneName(boneId: number, name: string)
    Sets the name for a bone.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to set the name.
    name: string
    Bone name to set.
  • EditableMesh:SetBoneParent(boneId: number, parentBoneId: number)
    Set a parent for a bone.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    boneId: number
    Bone ID for which to set the parent.
    parentBoneId: number
    Parent bone ID.
  • EditableMesh:SetColor(colorId: number, color: Color3)
    Sets the color for a color ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    colorId: number
    Color ID for which to set the color.
    color: Color3
    Color to set.
  • EditableMesh:SetColorAlpha(colorId: number, alpha: number)
    Sets the color alpha (transparency) for a color ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    colorId: number
    Color ID for which to set the color alpha.
    alpha: number
    Alpha to set.
  • EditableMesh:SetFaceColors(faceId: number, ids: { any })
    Sets the face's vertex colors to new color IDs.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to update the vertex colors.
    ids: { any }
    List of new color IDs to use for the given face's vertices.
  • EditableMesh:SetFaceNormals(faceId: number, ids: { any })
    Sets the face's vertex normals to new normal IDs.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to update the vertex normals.
    ids: { any }
    List of new normal IDs to use for the given face's vertices.
  • EditableMesh:SetFaceUVs(faceId: number, ids: { any })
    Sets the face's vertex UVs to new UV IDs.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to update the vertex UVs.
    ids: { any }
    List of new UV IDs to use for the given face's vertices.
  • EditableMesh:SetFaceVertices(faceId: number, ids: { any })
    Sets the face's vertices to new vertex IDs.
    • Custom Lua state
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    faceId: number
    Face ID for which to update the vertices.
    ids: { any }
    List of new vertex IDs to use for the given face.
  • EditableMesh:SetFacsBonePose(action: Enum.FacsActionUnit,boneId: number,cframe: CFrame,)
    Set CFrame for an individual bone in a specific FACS action unit.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    action: Enum.FacsActionUnit
    FACS action unit for which to set the pose.
    boneId: number
    Bone to set a CFrame for this pose.
    cframe: CFrame
    CFrame which transforms the bone from the initial bone CFrame in the bind pose of the mesh to the combined bone CFrame for this pose. All CFrames are in the mesh's local space.
  • EditableMesh:SetFacsCorrectivePose(actions: { any },boneIds: { any },cframes: { any },)
    Set pose for all bones in a specific FACS corrective pose.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    actions: { any }
    Array or 2 or 3 FacsActionUnit values to apply as a corrective pose.
    boneIds: { any }
    Bones to set a CFrame for this pose.
    cframes: { any }
    CFrame transforms for the bones in this corrective pose. Each bone CFrame transforms the bone from the initial bone CFrame in the bind pose of the mesh to the combined bone CFrame for this pose. All CFrames are in the mesh's local space.
  • EditableMesh:SetFacsPose(action: Enum.FacsActionUnit,boneIds: { any },cframes: { any },)
    Set pose for all bones in a specific FACS action unit.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    action: Enum.FacsActionUnit
    FACS action unit to set the pose for.
    boneIds: { any }
    Bones for which to set a CFrame for this pose.
    cframes: { any }
    CFrame transforms for the bones in this pose. Each bone CFrame transforms the bone from the initial bone CFrame in the bind pose of the mesh to the combined bone CFrame for this pose. All CFrames are in the mesh's local space.
  • EditableMesh:SetNormal(normalId: number, normal: Vector3)
    Set the normal for a normal ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    normalId: number
    Normal ID for which to set the normal vector.
    normal: Vector3
    Normal vector to set.
  • EditableMesh:SetPosition(vertexId: number, p: Vector3)
    Sets a vertex position in the mesh's local object space.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID of the vertex to position.
    p: Vector3
    Position in the mesh's local object space.
  • EditableMesh:SetUV(uvId: number, uv: Vector2)
    Sets UV coordinates for a UV ID.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    uvId: number
    UV ID for which to set the UV coordinates.
    uv: Vector2
    UV coordinates.
  • EditableMesh:SetVertexBones(vertexId: number, boneIDs: { any })
    Assign a list of bones with the vertex for skinning.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID to set vertex skinning bones.
    boneIDs: { any }
    Bone IDs to use with this vertex for skinning.
  • EditableMesh:SetVertexBoneWeights(vertexId: number, boneWeights: { any })
    Sets skinning blend weights for each bone associated with the vertex.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID on which to set skinning blend weights.
    boneWeights: { any }
    Skinning blend weights to set on the vertex.
  • EditableMesh:SetVertexFaceColor(vertexId: number,faceId: number,colorId: number,)
    Sets the color ID of a vertex/face pair.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID.
    faceId: number
    Face ID.
    colorId: number
    Color ID to set for the vertex/face pair.
  • EditableMesh:SetVertexFaceNormal(vertexId: number,faceId: number,normalId: number,)
    Sets the normal ID of a vertex/face pair.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID.
    faceId: number
    Face ID.
    normalId: number
    Normal ID to set for the vertex/face pair.
  • EditableMesh:SetVertexFaceUV(vertexId: number, faceId: number, uvId: number)
    Sets the UV ID of a vertex/face pair.
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    vertexId: number
    Vertex ID.
    faceId: number
    Face ID.
    uvId: number
    UV ID to set for the vertex/face pair.
  • EditableMesh:Triangulate()
    Splits all faces on the mesh to be triangles.
    • Capabilities: DynamicGeneration
  • EditableMesh:GetFacesWithAttribute(id: number): { any }
    Deprecated: This method is deprecated. Do not use it for new work.
    Returns a list of faces that use a given attribute ID.
    • Deprecated
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    id: number
    Attribute ID for which to find faces that use it.
    Returns
    TypeDescription
    { any }
    List of face IDs which use the given attribute ID.
  • EditableMesh:GetVerticesWithAttribute(id: number): { any }
    Deprecated: This method is deprecated. Do not use it for new work.
    Returns a list of vertices that use a given attribute ID.
    • Deprecated
    • Thread safe
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    id: number
    Attribute ID for which to find vertices that use it.
    Returns
    TypeDescription
    { any }
    List of vertex IDs which use the given attribute ID.

Events1

Inherited fromObject1