Skip to main content

Model

Derived from Spatial#

A graphical model. It will only show when enabled.

Properties#

setVisible(bool visible)#

Enables/disables visibility.

setOrigin(Vector3 origin)#

Sets the origin to origin.

setOrientation(Quat orientation)#

Sets the orientation to orientation.

destroy()#

Destroys the model instance. Resources like the mesh and material and textures may be in memory still, but the resource manager will clean it up if needed.

setMaterialProperty(uint32 submeshIndex, string propertyName, float value)#

setMaterialProperty(uint32 submeshIndex, string propertyName, Color value)#

setMaterialProperty(uint32 submeshIndex, string propertyName, string value)#

Sets the material property propertyName on this model's submesh at submeshIndex to value. Valid material names are:

NameTypeDescription
colorColorTint/multiply the shader's output color by this amount. (default is opaque white)
roughnessfloatScale the metal texture's roughness by this amount
metallicfloatScale the metal texture's metalness by this amount
tex_scalefloatScale the UV coordinates of all textures by this amount
diffusestringPath to the diffuse texture of the material (if it has one).
emissionstringPath to the emission texture of the material (if it has one).
metalstringPath to the metalness texture of the material (if it has one).
normalstringPath to the normal map texture of the material (if it has one).
occlusionstringPath to the occlusion map texture of the material (if it has one).