Roblox UtilitiesDevlHub Roblox Documentation

Class

FileMesh

Inherits
DataModelMesh › Instance › Object
Memory category
BaseParts
Subclasses
1

The FileMesh object applies a mesh to a BasePart when parented to it. Its properties are inherited by the SpecialMesh object.

The FileMesh object applies a textured mesh to a BasePart when parented to it. Its properties are inherited by the SpecialMesh object.

What is a FileMesh?#

FileMeshes allow user uploaded meshes to be applied to a BasePart. The mesh that is applied is dependent on the FileMesh.MeshId property. A texture can also be applied to this mesh using FileMesh.TextureId.

Although it is not an abstract class, and can be used by developers, all FileMesh properties are inherited by the SpecialMesh object. A SpecialMesh behaves identically to the FileMesh object when its SpecialMesh.MeshType is set to 'FileMesh'. Although both objects are functional, the SpecialMesh object is the official supported class.

For more information on using meshes, please see the SpecialMesh page.

Properties 4#

MeshContentContentThe mesh content applied to the parent BasePart, supporting asset URIs and EditableMesh objects.ReadSafe
MeshIdContentIdThe MeshId is the content ID of the mesh that is to be displayed.ReadSafe
TextureContentContentThe texture content applied to the mesh, supporting asset URIs and EditableImage objects.ReadSafe
TextureIdContentIdThe TextureId is the content ID of the texture that is to be applied to the mesh.ReadSafe

MeshContent: Content#

ReadSafe

The mesh content applied to the parent BasePart. This property accepts Content values including asset URIs and EditableMesh objects.

MeshContent is the underlying storage for FileMesh.MeshId. Setting FileMesh.MeshId writes through to this property, and reading FileMesh.MeshId derives its value from this property. When MeshContent is set to Content.none, no mesh is displayed.

This property is inherited by SpecialMesh.

MeshId: ContentId#

ReadSafe

The MeshId is the content ID of the mesh that is to be displayed.

The content ID for a mesh is generated when a developer uploads a mesh to Roblox.

TextureContent: Content#

ReadSafe

The texture content applied to the mesh. This property accepts Content values including asset URIs and EditableImage objects.

TextureContent is the underlying storage for FileMesh.TextureId. Setting FileMesh.TextureId writes through to this property, and reading FileMesh.TextureId derives its value from this property. When TextureContent is set to Content.none, no texture is applied to the mesh.

When TextureContent references an EditableImage, the texture live-updates with any edits to that object.

This property is inherited by SpecialMesh.

TextureId: ContentId#

ReadSafe

The TextureId is the content ID of the image that is to be applied to used for the meshes texture. When the TextureId property is set to an empty string, no texture will be applied to the mesh.

How can I change the texture of a mesh?#

Using the TextureId property, the texture of a mesh can be changed without having to reupload the mesh. To do this, a new image will need to be uploaded to Roblox with the desired texture. The original texture image file can be obtained by exporting the mesh using the 'Export Selection' option in Roblox Studio. The image file will be saved alongside the exported .obj file.

The new texture can then be re-uploaded to Roblox as a Decal and its content ID can be applied to the mesh using the TextureId property.

How can I make a textured mesh?#

A mesh can only be textured if the mesh has been UV mapped. UV mapping refers to the practice of projecting a texture map onto a mesh. This cannot be done using Roblox Studio and has to be done using an external 3D modelling application such as Blender.

Inherited members#

Inherited from DataModelMesh 3
Properties (3)

Offset, Scale, VertexColor

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed

Subclasses 1#