Что такое meshes roblox
The SpecialMesh is an object that allows developers to provide a standard template or user uploaded mesh to a BasePart .
Что такое meshes roblox
A mesh is a 3D object, such as a hat (catalog item), gear (catalog item) or Part. Every hat, gear, and package (except for the Mysterious Object) is made up of one or more meshes.
There are SpecialMesh, which contain BlockMesh and CylinderMesh, among other mesh variations.
Contents
BlockMesh
BlockMeshes can be used as a replacement for a Part. The main difference is that a BlockMesh has pointy edges and is smooth instead of studded, welded, yielded, or glued.
CylinderMesh
CylinderMeshes, like BlockMeshes, replace what a Part looks like. A CylinderMesh is similar to but distinct from the SpecialMesh MeshType Cylinder, although they look identical.
This is now deprecated, as the cylinder mesh from SpecialMeshes is favored.
SpecialMesh or MeshPart?
There are currently two ways of using a developer created mesh. They are using a SpecialMesh with the SpecialMesh/FileType set to ‘FileMesh’, or by using a MeshPart. Although, on the whole, the MeshPart object has superseded the SpecialMesh there are some differences developers should be aware of.
- BasePart/Material displays correctly on the mesh when using a MeshPart and not when using a SpecialMesh
- MeshParts include the MeshPart/CollisionFidelity property, meaning the collision model of a MeshPart can be set to resemble the geometry of the mesh. The SpecialMesh object by contrast, uses the parent BasePart s collision model
- The mesh of a MeshPart scales on all axis depending on the BasePart/Size property of the MeshPart, the mesh of a SpecialMesh does not
- The SpecialMesh object includes the DataModelMesh/Offset and DataModelMesh/Scale properties whereas MeshParts do not
- The DataModelMesh/MeshId property of a SpecialMesh can be changed by a Script or LocalScript during runtime. The MeshPart/MeshId property of a MeshPart can not
In most, but not all cases, using a MeshPart is more suitable. As MeshParts are a relatively new feature however, developers should expect some of the above behaviour to change.
What does a SpecialMesh do?
The SpecialMesh object applies a mesh to a BasePart depending on the the SpecialMesh/MeshType property. A number of options are available.
- Brick - A block shape, equivalent to a BlockMesh
- Cylinder - A cylinder, identical to a Part with a Part/Shape of ‘Cylinder’
- FileMesh - A user uploaded Mesh, equivalent to FileMesh that a texture can be applied to using the FileMesh/TextureId property
- Head - A character head shape
- Sphere - A sphere shape, similar to a Part with a Part/Shape of ‘Ball’ but can be freely resized on all axis
- Wedge - A wedge shape, identical to a WedgePart
- Torso - A block with sloped sides, due to be deprecated
Note, each SpecialMesh/MeshType will scale differently when using DataModelMesh/Scale , for more information on this please see the page on DataModelMesh/Scale . The SpecialMesh object also exposes the DataModelMesh/Offset property.
It is important to remember that when using a SpecialMesh, only the appearance of a part changes. The collision model of the part remains the same. For example, a character will not be able to walk correctly over a mesh as the mesh geometry is not taken into account.
Functions
Inherited from Instance: Show Hide
ClearAllChildren ( )
This function destroys all of an Instance ’s children.
Clone ( )
Create a copy of an object and all its descendants, ignoring objects that are not Instance/Archivable|Archivable
Destroy ( )
Sets the Instance/Parent property to nil, locks the Instance/Parent property, disconnects all connections and calls Destroy on all children.
FindFirstAncestor ( string name )
Returns the first ancestor of the Instance whose Instance/Name is equal to the given name.
FindFirstAncestorOfClass ( string className )
Returns the first ancestor of the Instance whose Instance/ClassName is equal to the given className.
FindFirstAncestorWhichIsA ( string className )
Returns the first ancestor of the Instance for whom Instance/IsA returns true for the given className.
FindFirstChild ( string name , bool recursive )
Returns the first child of the Instance found with the given name.
FindFirstChildOfClass ( string className )
Returns the first child of the Instance whose Instance/ClassName|ClassName is equal to the given className.
FindFirstChildWhichIsA ( string className , bool recursive )
Returns the first child of the Instance for whom Instance/IsA returns true for the given className.
FindFirstDescendant ( string name )
GetActor ( )
GetAttribute ( string attribute )
Returns the attribute which has been assigned to the given name
GetAttributeChangedSignal ( string attribute )
Returns an event that fires when the given attribute changes
GetAttributes ( )
Returns a dictionary of string → variant pairs for each of the Instance|Instance’s attributes
GetChildren ( )
Returns an array containing all of the Instance ’s children.
GetDebugId ( int scopeLength )
Returns a coded string of the Instance s DebugId used internally by Roblox.
GetDescendants ( )
Returns an array containing all of the descendants of the instance
GetFullName ( )
Returns a string describing the Instance ’s ancestry.
GetPropertyChangedSignal ( string property )
Get an event that fires when a given property of an object changes.
IsA ( string className )
Returns true if an Instance ’s class matches or inherits from a given class
IsAncestorOf ( Instance descendant )
Returns true if an Instance is an ancestor of the given descendant.
IsDescendantOf ( Instance ancestor )
Returns true if an Instance is a descendant of the given ancestor.
Remove ( )
Sets the object’s Parent to nil, and does the same for all its descendants.
SetAttribute ( string attribute , Variant value )
Sets the attribute with the given name to the given value
WaitForChild ( string childName , double timeOut )
Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.
MeshPart
MeshParts are a form of BasePart that includes a physically simulated custom mesh. Unlike with other mesh classes, such as SpecialMesh and BlockMesh , they are not parented to a BasePart but rather behave as a BasePart in their own right.
User meshes
In 2014, a user named hunte922 was able to upload meshes, with some being of Sonic heads, Portal meshes, Halo meshes and even the famous SCP-173 from the SCP wiki, which was the first SCP ever made. This was later removed by an Administrator named tobotrobot.
An example of a custom mesh.
An example of forced meshing in 2014.
Multi-mesh model imported as single mesh, compared to the same model imported in bulk
Properties
MeshType
Determines the type of mesh that will be applied to the BasePart the SpecialMesh is parented to.
Inherited from FileMesh: Show Hide
MeshId
The MeshId is the content ID of the mesh that is to be displayed.
TextureId
The TextureId is the content ID of the texture that is to be applied to the mesh.
Offset
The Offset of a mesh determines the relative position from the BasePart/Position of a BasePart that the mesh will be displayed at.
Scale
The Scale of a mesh determines the size of the mesh relative to its original dimensions.
VertexColor
Changes the hue of a mesh’s texture, used with FileMesh/TextureId .
Inherited from Instance: Show Hide
Archivable
Determines if an Instance can be cloned using /Instance/Clone or saved to file.
ClassName
A read-only string representing the class this Instance belongs to
DataCost
The cost of saving the instance using data persistence.
A non-unique identifier of the Instance
Parent
Determines the hierarchical parent of the Instance
RobloxLocked
A deprecated property that used to protect CoreGui objects
archivable
className
ROBLOX — создание аксессуаров Mesh-ами.
Второй вариант придания индивидуальности персонажам. Ну и всей игре тоже. Рассматривать их создание тут не буду. Только как добавить в игру.
В Roblox создаём MeshPart.
Который создаст нам обычный, не текстурированный кирпич.
И.. в нашем мире появился наш объект во всей красе, но без окраски.
Осталось самая малость. Так как это у нас элемент одежды (шлем), значит мы должны его
- привести к нужным размерам
- отцентрировать на модели
- запаковать в аксессуар
- выставить положение и направление точки привязки
После примерки, запаковываем в аксессуар. Создаём его и перетаскиваем в него наш Mesh.
Сам меш переименовываем в Handle и добавляем к нему Attachment. Добавленный аттач переименовываем согласно точке привязки на модели к которой мы собираемся прикрепить наш объект. Названия точек привязки можно найти в самой модели персонажа.
Просто копируем название и переименовываем наш аттач. Ну и добавим ещё ClickDetector со скриптом одевания.
Но это ещё не всё! Посмотрим на результат после запуска игры и кликанью по нашему объекту.
Все перемещения и вращения должны производится в противоположную сторону от того, как это выглядит во время запуска.
Uploading a custom mesh
Although a developer uploaded mesh can be used on a SpecialMesh , meshes can currently only be be uploaded using MeshPart s or the game explorer. For more information on how to do this please see Articles/Mesh Parts|this tutorial .
Trivia
This section is a trivia section. Please relocate any relevant information into other sections of the article.
SpecialMesh or MeshPart?
There are currently two ways of using a developer created mesh. They are using a SpecialMesh with the SpecialMesh/FileType set to ‘FileMesh’, or by using a MeshPart . Although, on the whole, the MeshPart object has superseded the SpecialMesh there are some differences developers should be aware of.
- BasePart/Material displays correctly on the mesh when using a MeshPart and not when using a SpecialMesh
- MeshPart s include the MeshPart/CollisionFidelity property, meaning the collision model of a MeshPart can be set to resemble the geometry of the mesh. The SpecialMesh object by contrast, uses the parent BasePart s collision model
- The mesh of a MeshPart scales on all axis depending on the BasePart/Size|Size property of the MeshPart , the mesh of a SpecialMesh does not
- The SpecialMesh object includes the DataModelMesh/Offset|Offset and DataModelMesh/Scale|Scale properties whereas MeshPart s do not
- The FileMesh/MeshId|MeshId property of a SpecialMesh can be changed by a Script or LocalScript during runtime. The MeshPart/MeshId|MeshId property of a MeshPart can not.
In most, but not all cases, using a MeshPart is more suitable. As MeshPart s are a relatively new feature however, developers should expect some of the above behaviour to change.
How do I use MeshParts
The mesh and texture of a MeshPart are determined by the MeshPart/MeshId and MeshPart/TextureID properties. For more information on how to use MeshParts please see Articles/Mesh Parts|here .
Читайте также: