rojo/.cursor/rules/roblox/reference/engine/classes/DataModelMesh.yaml
2026-02-02 12:08:47 -06:00

172 lines
6.4 KiB
YAML

# 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: DataModelMesh
type: class
memory_category: Instances
summary: |
The DataModelMesh is an abstract class from which mesh classes descend.
description: |
The DataModelMesh is an abstract class from which mesh classes descend.
Mesh classes are objects that, when parented to `Class.BasePart|BaseParts`
alter the appearance of the part to that of a predefined mesh. Note, they only
alter the appearance of the part and not the physics/collision boundaries of
the part. Developers looking to apply a mesh to a part that alters the part's
collision should use `Class.MeshPart|MeshParts`.
Note the `Class.MeshPart` and `Class.CharacterMesh` classes do not descend
from DataModelMesh.
code_samples: []
inherits:
- Instance
descendants:
- BevelMesh
- FileMesh
tags:
- NotCreatable
- NotBrowsable
deprecation_message: ''
properties:
- name: DataModelMesh.Offset
summary: |
The Offset of a mesh determines the relative position from the
`Class.BasePart.Position` of a `Class.BasePart` that the mesh will be
displayed at.
description: |
The Offset of a mesh determines the distance from the
`Class.BasePart.Position` of a `Class.BasePart` that the mesh will be
displayed.
#### How to use mesh offset
The Offset property changes the relative position the mesh will be
rendered at. For example, an offset of 0, 5, 0 will cause the mesh to be
displayed 5 studs above the position of the `Class.BasePart`.
The position of the `Class.BasePart` remains unchanged, meaning the
physics collision box of the part will remain in the same location. This
is demonstrated in the image below where the green outline (a
`Class.SelectionBox`) shows the extents of the `Class.BasePart`.
#### Other uses for mesh offset
There are a number of interesting uses for the mesh offset property.
- Offset and `Class.DataModelMesh.Scale` can be animated using
`Class.TweenService` relatively inexpensively as the engine does not
need to make any physics/collision calculations as the `Class.BasePart`
is not moved.
- Changing the relationship between the mesh and its collision extents
(determined by the `Class.BasePart`)
code_samples:
- Mesh-Offset-and-Scale
type: Vector3
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Data
serialization:
can_load: true
can_save: true
capabilities: []
- name: DataModelMesh.Scale
summary: |
The Scale of a mesh determines the size of the mesh relative to its
original dimensions.
description: |
The Scale of a mesh determines the size of the mesh relative to its
original dimensions.
#### How to use mesh scale
The scale property works slightly differently depending on the type of
mesh being used. Note the size of the `Class.BasePart` remains unchanged,
meaning the physics collision box of the part will remain the same.
- `Class.SpecialMesh` objects with `Class.SpecialMesh.FileType` set to
'FileMesh' scale relative to the original dimensions of the mesh when it
was uploaded to Roblox
- `Class.BlockMesh` objects or `Class.SpecialMesh` objects with
`Class.SpecialMesh.FileType` set to 'Brick', 'Wedge' or 'Sphere' scale
uniformly relative to the `Class.BasePart.Size` of their parent
- `Class.CylinderMesh` objects or `Class.SpecialMesh` objects with
`Class.SpecialMesh.FileType` set to 'Cylinder' scale relative to the
`Class.BasePart.Size` of their parent. Uniformly for the cylinders
height axis and maintaining a 1:1 ratio for the length and width of the
cylinder, using the lowest value.
- `Class.SpecialMesh` objects with `Class.SpecialMesh.FileType` set to
'Head' currently scale in a non standard manner. Developers should not
rely on this as there are plans to change this behavior.
- `Class.SpecialMesh` objects with `Class.SpecialMesh.FileType` set to
'Torso' scale in a non standard manner. Developers should not rely on
this as there are plans to deprecate this mesh type.
#### Mesh scale demonstration
The above behavior can be seen in the following demonstration images.
Linear scaling relative to part size for 'Brick', 'Wedge' and 'Sphere'
meshes.
Linear scaling relative to original uploaded mesh for 'FileMesh' meshes
Non-uniform constrained scaling for 'Cylinder' meshes
#### Other uses for mesh scale
There are a number of interesting uses for the mesh offset property.
- `Class.DataModelMesh.Offset` and Scale can be animated using
`Class.TweenService` relatively inexpensively as the engine does not
need to make any physics/collision calculations as the `Class.BasePart`
is not changed.
- Changing the relationship between the mesh and its collision extents
(determined by the `Class.BasePart`)
code_samples:
- Mesh-Offset-and-Scale
type: Vector3
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Data
serialization:
can_load: true
can_save: true
capabilities: []
- name: DataModelMesh.VertexColor
summary: |
Changes the hue of a mesh's texture, used with `Class.FileMesh.TextureId`.
description: |
**VertexColor** determines the hue change of the
`Class.FileMesh.TextureId|Texture` of a `Class.FileMesh`. Note that this
property is a `Datatype.Vector3` rather than a `Datatype.Color3`; to
convert, use the `Datatype.Color3.R`, `Datatype.Color3.G`, and
`Datatype.Color3.B` properties.
Although this property allows basic modification of a texture, changing a
texture entirely provides more control. See `Class.MeshPart` for more
details.
code_samples: []
type: Vector3
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Data
serialization:
can_load: true
can_save: true
capabilities: []
methods: []
events: []
callbacks: []