EditableMesh

Show Deprecated
Not Creatable

EditableMesh changes the applied visual mesh when linked to a MeshPart, allowing for querying and modification of the mesh both in Studio and in experience.

Enabling for Published Experiences

For security purposes, using EditableMesh fails by default for published experiences. To enable usage of EditableMesh, you must be 13+ age verified and ID verified. After you are verified, open Studio's Game Settings, select Security, and enable the Allow Mesh & Image APIs toggle. Remember to review the Terms of Use before enabling the toggle.

Permissions

To prevent misuse, AssetService:CreateEditableMeshAsync() will only allow you to load and edit mesh assets:

  • That are owned by the creator of the experience (if the experience is owned by an individual).
  • That are owned by a group (if the experience is owned by the group).
  • That are owned by the logged in Studio user (if the place file has not yet been saved or published to Roblox).

Memory Limits

Editable assets are currently expensive for memory usage. To minimize its impact on client performance, EditableMesh has strict client-side memory budgets, although the server, Studio, and plugins operate with unlimited memory. Using FixedSize may help you stay within the memory budget and, in some scenarios, linking one EditableMesh to multiple MeshParts (multi-referencing) can help with memory optimization.

Creation and Display

An EditableMesh can be created from an existing Content of a MeshPart or a mesh ID using AssetService:CreateEditableMeshAsync(), or a blank EditableMesh can be created with AssetService:CreateEditableMesh(). It can then be displayed, modified, and its collision model updated. Not all of the steps are necessary; for example, you might want to create an EditableMesh just to raycast without ever displaying it.


local AssetService = game:GetService("AssetService")
-- Create empty EditableMesh
local editableMesh = AssetService:CreateEditableMesh()
-- Create EditableMesh from asset ID
local editableMeshFromAsset = nil
local success, errorMessage = pcall(function()
editableMeshFromAsset = AssetService:CreateEditableMeshAsync(Content.fromAssetId(ASSET_ID))
end)
-- Create EditableMesh from another EditableMesh
local editableMeshFromAnother = nil
local success, errorMessage = pcall(function()
editableMeshFromAnother = AssetService:CreateEditableMeshAsync(Content.fromObject(OTHER_EDITABLE_MESH))
end)
-- Create EditableMesh from MeshPart
local editableMeshFromMeshPart = nil
local success, errorMessage = pcall(function()
editableMeshFromMeshPart = AssetService:CreateEditableMeshAsync(MESH_PART.MeshContent)
end)

An EditableMesh is displayed when it's linked to a new MeshPart, through AssetService:CreateMeshPartAsync(). You can create more MeshPart instances that reference the same EditableMesh Content, or link to an existing MeshPart through MeshPart:ApplyMesh().


local AssetService = game:GetService("AssetService")
local Workspace = game:GetService("Workspace")
-- Create EditableMesh from asset ID
local editableMeshFromAsset = nil
local success, errorMessage = pcall(function()
editableMeshFromAsset = AssetService:CreateEditableMeshAsync(Content.fromAssetId(ASSET_ID))
end)
-- Create new MeshPart linked to the EditableMesh
local newMeshPart = nil
local success, errorMessage = pcall(function()
newMeshPart = AssetService:CreateMeshPartAsync(Content.fromObject(editableMeshFromAsset))
end)
-- Alternatively, link the new MeshPart created above to an existing MeshPart
local existingMeshPart = Workspace:FindFirstChild("EXISTING_MESH_PART")
existingMeshPart:ApplyMesh(newMeshPart)

To recalculate collision and fluid geometry after editing, you can again call AssetService:CreateMeshPartAsync() and MeshPart:ApplyMesh() to update an existing MeshPart. It's generally recommended to do this at the end of a conceptual edit, not after individual calls to methods that manipulate geometry. Visual changes to the mesh will always be immediately reflected by the engine, without the need to call AssetService:CreateMeshPartAsync().

Fixed-Size Meshes

When creating an EditableMesh from an existing mesh asset (via AssetService:CreateEditableMeshAsync()), the resulting editable mesh is fixed-size by default. Fixed-size meshes are more efficient in terms of memory but you cannot change the number of vertices, faces, or attributes. Only the values of vertex attributes and positions can be edited.


local AssetService = game:GetService("AssetService")
-- Create EditableMesh without fixed-size default
local editableMeshFromAsset = nil
local success, errorMessage = pcall(function()
editableMeshFromAsset = AssetService:CreateEditableMeshAsync(Content.fromAssetId(ASSET_ID), {FixedSize = false})
end)

Stable Vertex/Face IDs

Many EditableMesh methods take vertex, normal, UV, color and face IDs. These are represented as integers in Luau but they require some special handling. The main difference is that IDs are stable and they remain the same even if other parts of the mesh change. For example, if an EditableMesh has five vertices {1, 2, 3, 4, 5} and you remove vertex 4, the new vertices will be {1, 2, 3, 5}.

Note that the IDs are not guaranteed to be in order and there may be holes in the numbering, so when iterating through vertices or faces, you should iterate through the table returned by GetVertices() or GetFaces().

Split Vertex Attributes

A vertex is a corner of a face, and topologically connects faces together. Vertices can have several attributes: position, normal, UV coordinate, color, and transparency.

Sometimes it's useful for all faces that touch a vertex to use the same attribute values, but sometimes you'll want different faces to use different attribute values on the same vertex. For example, on a smooth sphere, each vertex will only have a single normal. In contrast, at the corner of a cube, the vertex will have 3 different normals (one for each adjacent face). You can also have seams in the UV coordinates or sharp changes in the vertex colors.

When creating faces, every vertex will by default have one of each attribute: one normal, one UV coordinate, and one color/transparency. If you want to create a seam, you should create new attributes and set them on the face. For example, this code will create a sharp cube:


local AssetService = game:GetService("AssetService")
-- Given 4 vertex IDs, adds a new normal and 2 triangles, making a sharp quad
local function addSharpQuad(editableMesh, vid0, vid1, vid2, vid3)
local nid = editableMesh:AddNormal() -- This creates a normal ID which is automatically computed
local fid1 = editableMesh:AddTriangle(vid0, vid1, vid2)
editableMesh:SetFaceNormals(fid1, {nid, nid, nid})
local fid2 = editableMesh:AddTriangle(vid0, vid2, vid3)
editableMesh:SetFaceNormals(fid2, {nid, nid, nid})
end
-- Makes a cube with creased edges between the 6 sides
local function makeSharpCube()
local editableMesh = AssetService:CreateEditableMesh()
local v1 = editableMesh:AddVertex(Vector3.new(0, 0, 0))
local v2 = editableMesh:AddVertex(Vector3.new(1, 0, 0))
local v3 = editableMesh:AddVertex(Vector3.new(0, 1, 0))
local v4 = editableMesh:AddVertex(Vector3.new(1, 1, 0))
local v5 = editableMesh:AddVertex(Vector3.new(0, 0, 1))
local v6 = editableMesh:AddVertex(Vector3.new(1, 0, 1))
local v7 = editableMesh:AddVertex(Vector3.new(0, 1, 1))
local v8 = editableMesh:AddVertex(Vector3.new(1, 1, 1))
addSharpQuad(editableMesh, v5, v6, v8, v7) -- Front
addSharpQuad(editableMesh, v1, v3, v4, v2) -- Back
addSharpQuad(editableMesh, v1, v5, v7, v3) -- Left
addSharpQuad(editableMesh, v2, v4, v8, v6) -- Right
addSharpQuad(editableMesh, v1, v2, v6, v5) -- Bottom
addSharpQuad(editableMesh, v3, v7, v8, v4) -- Top
editableMesh:RemoveUnused()
return editableMesh
end

Winding

Mesh faces have a front side and a back side. When drawing meshes, only the front of the faces are drawn by default, although you can change this by setting the mesh' DoubleSided property to true.

The order of the vertices around the face determines whether you are looking at the front or the back. The front of the face is visible when the vertices go counterclockwise around it.

Order of the vertices around the face

FACS Poses

Animatable heads use the Facial Action Coding System (FACS). See the FACS poses reference for helpful information when using GetFacsPoses() and similar methods.

Each FACS pose is specified by an Enum.FacsActionUnit value. For the FACS pose, virtual bones can each have a CFrame that transforms the bones' initial CFrame in the bind pose of the mesh into the CFrame for that FACS action unit's pose. All bone CFrames are in the mesh's local space.

These FACS poses are blended together during animation. Sometimes, the blending of the base poses produces poor results. In those cases, you can override the blending of specific combinations of base poses with a corrective pose that is more pleasing. A corrective pose is specified by 2 or 3 Enum.FacsActionUnit values. Like a base FACS pose, for a corrective pose, virtual bones can each have a CFrame that transforms the bones' initial CFrame in the bind pose of the mesh into the CFrame for that FACS corrective.

Limitations

EditableMesh currently has a limit of 60,000 vertices and 20,000 triangles. Attempting to add too many vertices or triangles will cause an error.

Summary

Properties

  • Read Only
    Not Replicated
    Roblox Security
    Read Parallel

    Returns true if a mesh is fixed-size.

Methods

Properties

FixedSize

Read Only
Not Replicated
Roblox Security
Read Parallel

Fixed-sized meshes allow changing the values of vertex attributes but do not allow vertices and triangles to be added or deleted.

Methods

AddBone

Adds a new bone and returns a stable bone ID.

Parameters

boneProperties: Dictionary

Options table containing bone parameters:

  • Name — A string that specifies the bone name. Note that all bone names in a mesh must be unique.
  • 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.
Default Value: ""

Returns

Stable bone ID of the new bone.

AddColor

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

Parameters

color: Color3

The new color.

Default Value: ""
alpha: number

The color alpha (transparency).

Default Value: ""

Returns

Stable color ID of the new color.

AddNormal

Adds a new normal to the geometry and returns a stable normal ID. If the normal value isn't specified, the normal will be automatically calculated.

Parameters

normal: Vector3

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

Default Value: ""

Returns

Stable normal ID of the new normal.

AddTriangle

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

Parameters

vertexId0: number

ID of the first vertex of the triangle.

Default Value: ""
vertexId1: number

ID of the second vertex of the triangle.

Default Value: ""
vertexId2: number

ID of the third vertex of the triangle.

Default Value: ""

Returns

Stable face ID of the new face.

AddUV

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

Parameters

The new UV coordinate.

Default Value: ""

Returns

Stable UV ID of the new UV.

AddVertex

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

Parameters

Position in the mesh's local object space.

Default Value: ""

Returns

Stable vertex ID of the new vertex.

Destroy

()

Destroys the contents of the mesh, immediately reclaiming used memory.


Returns

()

FindClosestPointOnSurface

Finds the closest point on the mesh's surface. Returns the face ID, point on the mesh in local object space, and the barycentric coordinate of the position within the face. See RaycastLocal() for more information on barycentric coordinates.

Parameters

point: Vector3

Point position in the mesh's local object space.

Default Value: ""

Returns

Tuple of the face ID, point on the mesh in local object space, and the barycentric coordinate of the position within the face.

FindClosestVertex

Finds the closest vertex to a specific point in space and returns a stable vertex ID.

Parameters

toThisPoint: Vector3

Point position in the mesh's local object space.

Default Value: ""

Returns

Closest stable vertex ID to the specified point in space.

FindVerticesWithinSphere

Finds all vertices within a specific sphere and returns a list of stable vertex IDs.

Parameters

center: Vector3

Center of the sphere in the mesh's local object space.

Default Value: ""
radius: number

Radius of the sphere.

Default Value: ""

Returns

List of stable vertex IDs within the requested sphere.

GetAdjacentFaces

Given a stable face ID, returns a list of adjacent faces.

Adjacent faces indicated around requested face

Parameters

faceId: number
Default Value: ""

Returns

List of face IDs adjacent to the given face.

GetAdjacentVertices

Given a stable vertex ID, returns a list of adjacent vertices.

Adjacent vertices indicated around requested vertex

Parameters

vertexId: number

Vertex ID around which to get adjacent vertices.

Default Value: ""

Returns

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

GetBoneByName

Finds the bone ID of the bone with the given name. Errors if no bone with that name exists.

Parameters

boneName: string

Bone name to search for.

Default Value: ""

Returns

Bone ID of the bone with the given name.

GetBoneCFrame

Returns the initial CFrame of the bone in the bind pose of the mesh, in the mesh's local space.

Parameters

boneId: number

Bone ID for which to get the CFrame.

Default Value: ""

Returns

Initial CFrame of the bone in the bind pose of the mesh, in the mesh's local space.

GetBoneIsVirtual

Returns true if the bone is virtual. Virtual bones can only be bound to a FaceControls instance.

Parameters

boneId: number

Bone ID for which to get whether the bone is virtual.

Default Value: ""

Returns

Whether the bone with the given bone ID is virtual. Virtual bones can only be bound to a FaceControls instance.

GetBoneName

Returns the bone name.

Parameters

boneId: number

Bone ID for which to get the name.

Default Value: ""

Returns

Name of the bone with the given bone ID.

GetBoneParent

Returns the parent bone ID, if any.

Parameters

boneId: number

Bone ID for which to get the parent.

Default Value: ""

Returns

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

GetBones

Returns all bones of the mesh as a list of stable bone IDs.


Returns

List of stable bone IDs.

GetCenter


Returns

Center of the bounding box of the EditableMesh.

GetColor

Returns the color for the given color ID.

Parameters

colorId: number

Color ID for which to get the color.

Default Value: ""

Returns

Color for the requested stable color ID.

GetColorAlpha

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

Parameters

colorId: number

Color ID for which to get the alpha.

Default Value: ""

Returns

Color alpha at the request stable color ID.

GetColors

Returns all colors of the mesh as a list of stable color IDs.


Returns

List of stable color IDs.

GetFaceColors

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

Parameters

faceId: number

Face ID for which to get the color IDs.

Default Value: ""

Returns

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

GetFaceNormals

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

Parameters

faceId: number

Face ID for which to get the normal IDs.

Default Value: ""

Returns

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

GetFaceUVs

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

Parameters

faceId: number

Face ID for which to get the UV IDs.

Default Value: ""

Returns

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

GetFaceVertices

Returns the face's vertex IDs.

Parameters

faceId: number
Default Value: ""

Returns

List of vertex IDs around the given face.

GetFaces

Returns all faces of the mesh as a list of stable face IDs.


Returns

List of stable face IDs.

GetFacsCorrectivePose

Returns bone IDs and bone CFrames for all bones in a specific FACS 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.

Parameters

actions: Array

Array or 2 or 3 Enum.FacsActionUnit values that specify a corrective pose.

Default Value: ""

Returns

Array of bone IDs and corresponding array of bone CFrames.

GetFacsCorrectivePoses

Returns all FACS corrective poses that are in use. Each corrective pose is specified by 2 or 3 Enum.FacsActionUnit values.


Returns

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

GetFacsPose

Returns bone IDs and bone CFrames for all bones in a specific FACS action unit. 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.

Parameters

FACS action unit for which to get the pose.

Default Value: ""

Returns

Array of bone IDs and corresponding array of bone CFrame.

GetFacsPoses

Returns all FACS action units that have poses defined.


Returns

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

GetNormal

Returns the normal vector for the given normal ID.

Parameters

normalId: number

Normal ID for which to get the normal vector.

Default Value: ""

Returns

Normal vector at the requested normal ID.

GetNormals

Returns all normals of the mesh as a list of stable normal IDs.


Returns

List of stable normal IDs.

GetPosition

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

Parameters

vertexId: number

Stable vertex ID for which to get the position.

Default Value: ""

Returns

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

GetSize


Returns

Size of the EditableMesh.

GetUV

Returns UV coordinates at the given UV ID.

Parameters

uvId: number

UV ID for which to get the UV coordinate.

Default Value: ""

Returns

UV coordinates at the requested UV ID.

GetUVs

Returns all UVs of the mesh as a list of stable UV IDs.


Returns

List of stable UV IDs.

GetVertexBoneWeights

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

Parameters

vertexId: number

Vertex ID for which to get the associated bone weights.

Default Value: ""

Returns

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

GetVertexBones

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

Parameters

vertexId: number

Vertex ID for which to get the associated bones.

Default Value: ""

Returns

Bone IDs associated with the vertex for skinning.

GetVertices

Returns all vertices as a list of stable vertex IDs.


Returns

List of stable vertex IDs.

IdDebugString

Returns a string describing a stable ID, useful for debugging purposes, like f17 or v12, containing the type, ID number, and version.

Parameters

id: number

ID for which to return a debugging information string.

Default Value: ""

Returns

String that describes the ID in human-readable format.

MergeVertices

Map

Merges vertices that touch together, to use a single vertex ID but keep the other original attribute IDs.

Parameters

mergeTolerance: number

The distance at which the vertices are considered to touch each other.

Default Value: ""

Returns

Map

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

RaycastLocal

Casts a ray and returns a point of intersection, face ID, and barycentric coordinates. The inputs and outputs of this method are in the mesh's local object space.

A barycentric coordinate is a way of specifying a point within a face as a weighted combination of the 3 vertices of the face. This is useful as a general way of blending vertex attributes. See this method's code sample as an illustration.

Parameters

origin: Vector3

Origin of the ray in the mesh's local object space.

Default Value: ""
direction: Vector3

Direction of the ray.

Default Value: ""

Returns

Tuple of the point of intersection, face ID, and barycentric coordinates.

Code Samples

This code finds the position and UV coordinates of the closest point on an EditableMesh to the input point.

EditableMesh:RaycastLocal()

local AssetService = game:GetService("AssetService")
-- Initialize EditableMesh in space
local editableMesh = nil
local success, errorMsg = pcall(function()
editableMesh = AssetService:CreateEditableMeshAsync(Content.fromUri("rbxassetid://ASSET_ID"))
end)
local meshPart = nil
if success and editableMesh then
meshPart = AssetService:CreateMeshPartAsync(
Content.fromObject(editableMesh),
{ CollisionFidelity = Enum.CollisionFidelity.Hull }
)
meshPart.Parent = workspace
else
print(errorMsg)
end
local function castRayFromCamera(position)
if not meshPart then
return
end
-- Create ray from camera along the direction of a clicked point
local camera = workspace.CurrentCamera
local ray = camera:ScreenPointToRay(position.X, position.Y)
-- Convert to object space to use with RaycastLocal()
local relativeOrigin = meshPart.CFrame:PointToObjectSpace(ray.Origin)
local relativeDirection = meshPart.CFrame:VectorToObjectSpace(ray.Direction)
local triangleId, point, barycentricCoordinate
triangleId, point, barycentricCoordinate = editableMesh:RaycastLocal(relativeOrigin, relativeDirection * 100)
if not triangleId then
-- Didn't hit any triangles
return
end
-- Interpolate UVs within the triangle
local vert1, vert2, vert3 = editableMesh:GetTriangleVertices(triangleId)
local uv0 = editableMesh:GetUV(vert1)
local uv1 = editableMesh:GetUV(vert2)
local uv2 = editableMesh:GetUV(vert3)
local u = (barycentricCoordinate.x * uv0.x) + (barycentricCoordinate.y * uv1.x) + (barycentricCoordinate.z * uv2.x)
local v = (barycentricCoordinate.x * uv0.y) + (barycentricCoordinate.y * uv1.y) + (barycentricCoordinate.z * uv2.y)
return Vector2.new(u, v)
end

RemoveBone

()

Removes a bone using its stable bone ID.

Parameters

boneId: number
Default Value: ""

Returns

()

RemoveFace

()

Removes a face using its stable face ID.

Parameters

faceId: number
Default Value: ""

Returns

()

RemoveUnused

Removes all vertices, normals, UVs, and colors which are not used in any face, and returns the removed IDs.


Returns

All of the removed stable IDs.

ResetNormal

()

Reset this normal ID to be automatically calculated based on the shape of the mesh, instead of manually set.

Parameters

normalId: number

Stable normal ID to reset.

Default Value: ""

Returns

()

SetBoneCFrame

()

Set the initial CFrame for a bone in the mesh's bind pose, in the mesh's local space.

Parameters

boneId: number

Bone ID for which to set the initial CFrame.

Default Value: ""
cframe: CFrame

Initial CFrame for the bone in the mesh's bind pose, in the mesh's local space.

Default Value: ""

Returns

()

SetBoneIsVirtual

()

Set whether a bone is virtual. Virtual bones can only be bound to a FaceControls instance.

Parameters

boneId: number

Bone ID for which to set whether the bone is virtual.

Default Value: ""
virtual: boolean

Whether the bone should be virtual.

Default Value: ""

Returns

()

SetBoneName

()

Sets the name for a bone. Bone names can be 100 characters long and must be unique in the mesh.

Parameters

boneId: number

Bone ID for which to set the name.

Default Value: ""
name: string

Bone name to set.

Default Value: ""

Returns

()

SetBoneParent

()

Set a parent for a bone.

Parameters

boneId: number

Bone ID for which to set the parent.

Default Value: ""
parentBoneId: number

Parent bone ID.

Default Value: ""

Returns

()

SetColor

()

Sets the color for a color ID.

Parameters

colorId: number

Stable color ID for which to set the color.

Default Value: ""
color: Color3

Color to set.

Default Value: ""

Returns

()

SetColorAlpha

()

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

Parameters

colorId: number

Stable color ID for which to set the color alpha.

Default Value: ""
alpha: number

Alpha to set.

Default Value: ""

Returns

()

SetFaceColors

()

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

Parameters

faceId: number

Face ID for which to update the vertex colors.

Default Value: ""
ids: Array

List of new stable color IDs to use for the given face's vertices.

Default Value: ""

Returns

()

SetFaceNormals

()

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

Parameters

faceId: number

Face ID for which to update the vertex normals.

Default Value: ""
ids: Array

List of new stable normal IDs to use for the given face's vertices.

Default Value: ""

Returns

()

SetFaceUVs

()

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

Parameters

faceId: number

Face ID for which to update the vertex UVs.

Default Value: ""
ids: Array

List of new stable UV IDs to use for the given face's vertices.

Default Value: ""

Returns

()

SetFaceVertices

()

Sets the face's vertices to new vertex IDs.

Parameters

faceId: number

Face ID for which to update the vertices.

Default Value: ""
ids: Array

List of new stable vertex IDs to use for the given face.

Default Value: ""

Returns

()

SetFacsBonePose

()

Set CFrame for an individual bone in a specific FACS action unit.

Parameters

FACS action unit for which to set the pose.

Default Value: ""
boneId: number

Bone to set a CFrame for this pose.

Default Value: ""
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.

Default Value: ""

Returns

()

SetFacsCorrectivePose

()

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

Parameters

actions: Array

Array or 2 or 3 Enum.FacsActionUnit values to apply as a corrective pose.

Default Value: ""
boneIds: Array

Bones to set a CFrame for this pose.

Default Value: ""
cframes: Array

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.

Default Value: ""

Returns

()

SetFacsPose

()

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

Parameters

FACS action unit to set the pose for.

Default Value: ""
boneIds: Array

Bones for which to set a CFrame for this pose.

Default Value: ""
cframes: Array

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.

Default Value: ""

Returns

()

SetNormal

()

Set the normal for a normal ID. This will change the normal value for every face vertex which is using the normal ID.

Parameters

normalId: number

Stable normal ID for which to set the normal vector.

Default Value: ""
normal: Vector3

Normal vector to set.

Default Value: ""

Returns

()

SetPosition

()

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

Parameters

vertexId: number

Stable vertex ID of the vertex to position.

Default Value: ""

Position in the mesh's local object space.

Default Value: ""

Returns

()

SetUV

()

Sets UV coordinates for a UV ID.

Parameters

uvId: number

UV ID for which to set the UV coordinates.

Default Value: ""

UV coordinates.

Default Value: ""

Returns

()

SetVertexBoneWeights

()

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

Corresponds with the bone IDs used in SetVertexBones(). In other words, GetVertexBoneWeights(vertexId)[i] is the weight on this vertex for GetVertexBones(vertexId)[i].

This method should be called after calling SetVertexBones().

Parameters

vertexId: number

Vertex ID on which to set skinning blend weights.

Default Value: ""
boneWeights: Array

Skinning blend weights to set on the vertex.

Default Value: ""

Returns

()

SetVertexBones

()

Assign a list of bones with the vertex for skinning.

Corresponds with the skinning blend weights used in SetVertexBoneWeights(). In other words, GetVertexBoneWeights(vertexId)[i] is the weight on this vertex for GetVertexBones(vertexId)[i].

This method should be called before calling SetVertexBoneWeights().

Parameters

vertexId: number

Vertex ID to set vertex skinning bones.

Default Value: ""
boneIDs: Array

Bone IDs to use with this vertex for skinning.

Default Value: ""

Returns

()

Triangulate

()

Splits all faces on the mesh to be triangles. Currently this does nothing since only triangles can be created, but if your code relies on triangles, it's recommended that you call this method after calling AssetService:CreateEditableMeshAsync().


Returns

()

Events