Reference API Roblox

Engine API

Website

Related

Reference API Roblox

DataModelMesh

The DataModelMesh is an abstract class from which mesh classes descend.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is not browsable. It is not visible in Studio's object browser.
Tags: [NotCreatable, NotBrowsable]

Member index 3

HistoryMember
553Offset: Vector3
553Scale: Vector3
553VertexColor: Vector3
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 2

HistoryMember

Description

The DataModelMesh is an abstract class from which mesh classes descend.

Mesh classes are objects that, when parented to 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 MeshParts.

Note the MeshPart and CharacterMesh classes do not descend from DataModelMesh.

History 20

Members 3

Offset

TypeDefault
Vector3

The Offset of a mesh determines the distance from the BasePart.Position of a 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 BasePart.

The position of the 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 SelectionBox) shows the extents of the BasePart.

Other uses for mesh offset

There are a number of interesting uses for the mesh offset property.

  • Offset and DataModelMesh.Scale can be animated using TweenService relatively inexpensively as the engine does not need to make any physics/collision calculations as the BasePart is not moved.
  • Changing the relationship between the mesh and its collision extents (determined by the BasePart)

History 4

Scale

TypeDefault
Vector3

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 BasePart remains unchanged, meaning the physics collision box of the part will remain the same.

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.

  • DataModelMesh.Offset and Scale can be animated using TweenService relatively inexpensively as the engine does not need to make any physics/collision calculations as the BasePart is not changed.
  • Changing the relationship between the mesh and its collision extents (determined by the BasePart)

History 4

  • 553 Change Default of Scale from to
  • 486 Change ThreadSafety of Scale from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of Scale from to ReadOnly
  • 47 Add Scale

VertexColor

TypeDefault
Vector3

VertexColor determines the hue change of the Texture of a FileMesh. Note that this property is a Vector3 rather than a Color3; to convert, use the Color3.R, Color3.G, and Color3.B properties.

Although this property allows basic modification of a texture, changing a texture entirely provides more control. See MeshPart for more details.

History 4

Removed members 2

Settings