Functions and messages for interacting with model components.

See ModelProperties for related properties. See ModelMessages for related messages.

Static methods

staticcancel(url:UrlOrString):Void

Cancel all animation on a model.

Parameters:

url

the model for which to cancel the animation

staticget_go(url:UrlOrString, bone_id:HashOrString):Hash

Retrieve the game object corresponding to a model skeleton bone.

The returned game object can be used for parenting and transform queries. This function has complexity O(n), where n is the number of bones in the model skeleton. Game objects corresponding to a model skeleton bone can not be individually deleted. Only available from .script files.

Parameters:

url

the model to query

bone_id

id of the corresponding bone

Returns:

id of the game object

staticplay_anim(url:UrlOrString, anim_id:HashOrString, playback:GoPlayback, ?play_properties:ModelPlayAnimProperties):Void

Play an animation on a model.

Parameters:

url

the model for which to play the animation

anim_id

id of the animation to play

playback

playback mode of the animation

play_properties

optional table with properties

staticreset_constant(url:UrlOrString, name:HashOrString):Void

Reset a shader constant for a model.

The constant must be defined in the material assigned to the model. Resetting a constant through this function implies that the value defined in the material will be used. Which model to reset a constant for is identified by the URL.

Parameters:

url

the model that should have a constant reset

name

of the constant

staticset_constant(url:UrlOrString, name:HashOrString, value:Vector4):Void

Set a shader constant for a model component.

The constant must be defined in the material assigned to the model. Setting a constant through this function will override the value set for that constant in the material. The value will be overridden until model.reset_constant is called. Which model to set a constant for is identified by the URL.

Parameters:

url

the model that should have a constant set

name

name of the constant

value

value of the constant