# This file is automatically generated. Please don't edit it manually. # To submit a bug report on the content, see # https://devforum.roblox.com/c/bug-reports/documentation-issues/72 name: MeshPart type: class memory_category: BaseParts summary: | A form of `Class.BasePart` that includes a physically simulated custom mesh. description: | `Class.MeshPart` is a form of `Class.BasePart` that includes a physically simulated custom mesh. Unlike with other mesh classes, such as `Class.SpecialMesh` and `Class.BlockMesh`, they are not parented to a `Class.BasePart` but rather behave as a `Class.BasePart` in their own right. The mesh and texture of a `Class.MeshPart` are determined by the `Class.MeshPart.MeshId|MeshId` and `Class.MeshPart.TextureID|TextureID` properties. For more information, see [Meshes](../../../parts/meshes.md). code_samples: [] inherits: - TriangleMeshPart descendants: [] tags: [] deprecation_message: '' properties: - name: MeshPart.DoubleSided summary: | Determines whether to render both faces of polygons in the mesh. description: | This property determines whether to render both faces of polygons in the mesh. It is only changeable in Studio. This is useful for meshes that are typically modeled as "cards" such as a leaf, hair, or cloth. code_samples: [] type: boolean tags: [] deprecation_message: '' security: read: None write: PluginSecurity thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.HasJointOffset summary: '' description: '' code_samples: [] type: boolean tags: - Hidden - Deprecated deprecation_message: '' security: read: None write: NotAccessibleSecurity thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.HasSkinnedMesh summary: '' description: '' code_samples: [] type: boolean tags: - Hidden deprecation_message: '' security: read: None write: NotAccessibleSecurity thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.JointOffset summary: '' description: '' code_samples: [] type: Vector3 tags: - Hidden - Deprecated deprecation_message: '' security: read: None write: NotAccessibleSecurity thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.MeshContent summary: | The mesh that is displayed on the `Class.MeshPart`. Supports [asset URIs](../../../projects/assets/index.md#asset-uris) and `Class.EditableMesh` objects. description: | The mesh that is displayed on the `Class.MeshPart`. Supports [asset URIs](../../../projects/assets/index.md#asset-uris) and `Class.EditableMesh` objects. Note that this property cannot be changed directly by scripts, as the collision geometry of the mesh cannot be recomputed in real time. See `Class.AssetService:CreateMeshPartAsync()` as a method to create a new `Class.MeshPart` from a given `Datatype.Content` with a specified `Class.MeshPart.CollisionFidelity|CollisionFidelity`. `Class.MeshPart:ApplyMesh()` can be used to overwrite the `Class.MeshPart.MeshContent|MeshContent`, `Class.MeshPart.TextureContent|TextureContent`, and collision geometry of an existing `Class.MeshPart`. code_samples: [] type: Content tags: [] deprecation_message: '' security: read: None write: NotAccessibleSecurity thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.MeshId summary: | The [asset URIs](../../../projects/assets/index.md#asset-uris) of the mesh that is displayed on the `Class.MeshPart`. Reads and writes to `Class.MeshPart.MeshContent|MeshContent`. description: | The [asset URIs](../../../projects/assets/index.md#asset-uris) of the mesh that is displayed on the `Class.MeshPart`. Reads and writes to `Class.MeshPart.MeshContent|MeshContent`. Note that this property cannot be changed directly by scripts, as the collision geometry of the mesh cannot be recomputed in real time. See `Class.AssetService:CreateMeshPartAsync()` as a method to create a new `Class.MeshPart` from a given `Datatype.Content` with a specified `Class.MeshPart.CollisionFidelity|CollisionFidelity`. `Class.MeshPart:ApplyMesh()` can be used to overwrite the `Class.MeshPart.MeshContent|MeshContent`, `Class.MeshPart.TextureContent|TextureContent`, and collision geometry of an existing `Class.MeshPart`. code_samples: [] type: ContentId tags: [] deprecation_message: '' security: read: None write: NotAccessibleSecurity thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.RenderFidelity summary: | The level of detail used to render the `Class.MeshPart`. description: | This property determines the level of detail that the `Class.MeshPart` will be shown in. It can be set to the possible values of the `Enum.RenderFidelity` enum. The default value is `Enum.RenderFidelity.Automatic|Automatic`, meaning the mesh's detail is based on its distance from the camera as outlined in the following table.
Distance From Camera Render Fidelity Example
Less than 250 studs Highest
250-500 studs Medium
500 or more studs Lowest
code_samples: [] type: RenderFidelity tags: - NotReplicated deprecation_message: '' security: read: None write: PluginSecurity thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.TextureContent summary: | The texture applied to the `Class.MeshPart`. Supports [asset URIs](../../../projects/assets/index.md#asset-uris) and `Class.EditableImage` objects. description: | The texture applied to the `Class.MeshPart`. Supports [asset URIs](../../../projects/assets/index.md#asset-uris) and `Class.EditableImage` objects. When this property is set to `Datatype.Content.none`, no texture will be applied to the mesh. ``` local Workspace = game:GetService("Workspace") local meshPart = Workspace.MeshPart meshPart.TextureContent = Content.none -- No texture ``` Note that the `Class.MeshPart.MeshContent|MeshContent` property cannot be directly changed during runtime but the texture can. ##### Changing a Mesh Texture Using the `Class.MeshPart.TextureContent|TextureContent` property, the texture of a mesh can be changed without having to re-upload the mesh. To do this, a new image can 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 Studio. The image file will be saved alongside the exported `.obj` file. The new texture can then be uploaded to Roblox as a decal and its [asset URI](../../../projects/assets/index.md#asset-uris) can be applied to the mesh using the `Class.MeshPart.TextureContent|TextureContent` or `Class.MeshPart.TextureID|TextureID` property. `Class.MeshPart.TextureContent|TextureContent` can also be set to reference an `Class.EditableImage` that has not been published yet. ``` local AssetService = game:GetService("AssetService") local Workspace = game:GetService("Workspace") local meshPart = Workspace.MeshPart local editableImage = AssetService:CreateEditableImageAsync(meshPart.TextureContent) meshPart.TextureContent = Content.fromObject(editableImage) -- Live updates ``` When `Class.MeshPart.TextureContent|TextureContent` references an `Class.EditableImage`, the texture will live update with any edits to the `Class.EditableImage` object. ##### Making a Textured Mesh A mesh can only be textured if the mesh has been UV mapped, referring to the practice of projecting a texture map onto a mesh. This cannot be done using Roblox Studio and must be done using an external 3D modeling application such as [Blender](https://www.blender.org/). code_samples: [] type: Content tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic - name: MeshPart.TextureID summary: | The texture applied to the `Class.MeshPart`. Reads and writes to `Class.MeshPart.TextureContent|TextureContent`. description: | The texture applied to the `Class.MeshPart`. Reads and writes to `Class.MeshPart.TextureContent|TextureContent`. When this property is set to an empty string, no texture will be applied to the mesh. ``` local Workspace = game:GetService("Workspace") local meshPart = Workspace.MeshPart meshPart.TextureID = "" -- No texture ``` Note that the `Class.MeshPart.MeshId` property cannot be changed during runtime but the texture can. See `Class.MeshPart.TextureContent|TextureContent` for details. code_samples: [] type: ContentId tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Appearance serialization: can_load: true can_save: true capabilities: - Basic methods: - name: MeshPart:ApplyMesh summary: | Overwrites the `Class.MeshPart.MeshContent|MeshContent`, `Class.MeshPart.TextureContent|TextureContent`, and collision geometry properties of this `Class.MeshPart` from the given source `meshPart`. description: | Overwrites the `Class.MeshPart.MeshContent|MeshContent`, `Class.MeshPart.TextureContent|TextureContent`, and collision geometry properties of this `Class.MeshPart` from the given source `meshPart`. Most of these properties are read-only and cannot be changed during runtime on their own directly. To keep `Class.MeshPart.MeshContent|MeshContent` and physics data in sync, they must be updated together. Copies the following properties: - `Class.MeshPart.MeshContent` (implicitly updates `Class.MeshPart.MeshId|MeshId`) - `Class.MeshPart.TextureContent` (implicitly updates `Class.MeshPart.TextureID|TextureID`) - `Class.MeshPart.RenderFidelity` - `Class.MeshPart.CollisionFidelity` (with any internal collision geometry) - `Class.MeshPart.FluidFidelity` (with any internal aero geometry) - `Class.MeshPart.MeshSize` code_samples: [] parameters: - name: meshPart type: Instance default: summary: '' returns: - type: () summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - Basic events: [] callbacks: []