User Guide

318 Chapter 15: The 3D Cast Member, 3D Text, and 3D Behaviors
Models
The models in a cast member are the actual visible objects that are seen in the 3D cast member.
Models move according to the motions you assign to them in your 3D modeling software, and
according to animation scripts that you write. Their movement results from repositioning and
reorienting their geometries in 3D space.
The following cast member methods and properties can be used to perform basic
model operations:
Method Function Returns
model.count
Returns the number of model objects
included in the cast member.
Integer.
model(name)
Returns the model named name.Returns the model object
named
name if it exists.
Returns
void if the object
does not exist.
model[index]
Returns the model at the designated index
position. The index number can change if
models lower in the list are deleted.
Returns the model object at
that index number if it exists.
Returns
void if the object
does not exist at that index
number.
newModel(name,
modelResource)
Creates a new model named name and adds it
to the world. Fails if a model by that name
already exists. The
modelResource argument
is optional and can be set at a later time. If
supplied, this second argument must be an
existing model resource object.
Returns a new model with a
unique name. If the name isn’t
unique, returns an error.
deleteModel
(name)
Deletes the model named name. Script
references to this model persist but can do
nothing. Children of the model aren’t deleted
but are re-parented to the world group.
TRUE (1) if the model named
name exists. FALSE (0) if the
model named
name doesn’t
exist.
deleteModel
(index)
Deletes the model with the given index
number. Script references to this model
persist but can do nothing.
TRUE (1) if the model with this
index number exists.
FALSE
(0)
if the model with this index
number doesn’t exist.
model(name1).clone(n
ame2)
Creates a copy of the model named name1
and assigns it the name
name2. The new
model uses the same model resource and
shader as the original model; changes to the
model resource and shader of the original
model appear in the new model as well.
Returns the model named
name2.