Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
TheGraphics API enables you to access and manipulate avatar, entity, and overlay models in the rendered scene.
This includes getting mesh and material information for applying Material
entities.Methods
| Name | Return Value | Summary |
|---|---|---|
canUpdateModel
|
boolean |
Checks whether the model for an avatar, entity, or overlay can be updated in the rendered scene. Only avatars,
|
exportModelToOBJ
|
string |
Exports a model to OBJ format. |
getModel
|
GraphicsModel |
Gets a handle to the model data used for displaying an avatar, 3D entity, or 3D overlay. Note: The model data may be used for more than one instance of the item displayed in the scene. |
newMesh
|
GraphicsMesh |
Creates a new graphics mesh. |
newModel
|
GraphicsModel |
Creates a new graphics model from meshes. |
updateModel
|
boolean |
Updates the model for an avatar, 3D entity, or 3D overlay in the rendered scene. |
Type Definitions
|
BufferElementFormat Type: object |
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Details of a buffer element's format. Properties
|
|
BufferFormat Type: object |
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Details of buffer's format. Properties
|
|
BufferType Type: Vec4 | Vec3 | Vec2 |
||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The type of a graphics buffer value as accessed by JavaScript.
|
|
BufferTypeName Type: string |
||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The type name of a graphics buffer.
|
|
IFSData Type: object |
||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
IFS (Indexed-Face Set) data defining a mesh. Properties
|
|
Material Type: object |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
A material in a GraphicsModel. Properties
|
|
MaterialLayer Type: object |
|||||||||
|---|---|---|---|---|---|---|---|---|---|
|
A material layer. Properties
|
|
MeshExtents Type: object |
|||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The extents of a mesh. Properties
|
|
MeshTopology Type: string |
||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The interpretation of mesh elements.
|
Method Details
|
(static) canUpdateModel( id, meshIndexopt, partNumberopt ) → {boolean}
Returns: true if the model can be updated, false if it can't.
|
||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Checks whether the model for an avatar, entity, or overlay can be updated in the rendered scene. Only avatars,
Parameters
ExampleTest whether different types of items can be updated.
|
|
(static) exportModelToOBJ( model ) → {string}
Returns: The OBJ format representation of the model. |
||||||
|---|---|---|---|---|---|---|
|
Exports a model to OBJ format. Parameters
|
|
(static) getModel( id ) → {GraphicsModel}
Returns: The model data for the avatar, entity, or overlay, as displayed. This includes the results of applying any Material entities to the item. |
||||||
|---|---|---|---|---|---|---|
|
Gets a handle to the model data used for displaying an avatar, 3D entity, or 3D overlay. Note: The model data may be used for more than one instance of the item displayed in the scene. Parameters
ExampleReport some details of your avatar's model.
|
|
(static) newMesh( ifsMeshData ) → {GraphicsMesh}
Returns: The new graphics mesh. |
||||||
|---|---|---|---|---|---|---|
|
Creates a new graphics mesh. Parameters
|
|
(static) newModel( meshes ) → {GraphicsModel}
Returns: The new graphics model. |
||||||
|---|---|---|---|---|---|---|
|
Creates a new graphics model from meshes. Parameters
|
|
(static) updateModel( id, model ) → {boolean}
Returns: true if the update was completed successfully, false if it wasn't.
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Updates the model for an avatar, 3D entity, or 3D overlay in the rendered scene. Parameters
|
