Skip to content

createMesh#material

Summary

createMesh#material is the material currently used to shade a mesh. Inspect or edit the returned material in place, or use setMaterial to replace it. Any other mesh sharing the material sees edits to the same object.

Syntax

readonly Mesh.material: Material
const current = mesh.material;

Returns

Material - The currently assigned material object, borrowed from the mesh. Acquire an ownership reference with retain() if another owner needs it past material replacement or mesh destruction.

See Also