GraphicsModel

Description

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts

A handle to in-memory model data such as may be used in displaying avatars, 3D entities, or 3D overlays in the rendered scene. Changes made to the model are visible only to yourself; they are not persisted.

Note: The model may be used for more than one instance of an item displayed in the scene. Modifying the model updates all instances displayed.

Create using the Graphics API or GraphicsModel.cloneModel.

Properties

Name Type Summary
objectID Uuid

The ID of the entity or avatar that the model is associated with, if any; null if the model is not associated with an entity or avatar. Read-only.

numMeshes number

The number of meshes in the model. Read-only.

meshes Array.<GraphicsMesh>

The meshes in the model. Each mesh may have more than one mesh part. Read-only.

materialNames Array.<string>

The names of the materials used by each mesh part in the model. The names are in the order of the meshes and their mesh parts. Read-only.

materialLayers Object.<string, Array.<Graphics.MaterialLayer>>

The mapping from mesh parts and material names to material layers. The mesh parts are numbered from "0" per the array indexes of materialNames. The material names are those used in materialNames. (You can look up a material layer by mesh part number or by material name.) Read-only.

Methods

Name Return Value Summary
cloneModel GraphicsModel

Makes a copy of the model.

toString string

Gets a string description of the model.

Method Details

(static) cloneModel( optionsopt ) → {GraphicsModel}
Returns: A copy of the model.

Makes a copy of the model.

Parameters

Name Type Attributes Description
options object <optional>

Not used.

(static) toString( ) → {string}
Returns: A string description of the model.

Gets a string description of the model.

Example

Report the string description of your avatar's model.

var model = Graphics.getModel(MyAvatar.sessionUUID);
print("Avatar model info:", model.toString());