What's New in Director 8.5 > Working with Models and Model Resources > Models > Model properties

 

Model properties

The properties of a model determine its particular appearance and relationship to the rest of the 3D world.

Property

Access

Description

Value

name

Get

Unique string name.

Any string.

parent

Get and set

This model's parent; either another object or the 3D cast member itself.

An object or cast member.

child.count

Get

Number of children (but not grandchildren) of a given model.

An integer.

transform

Get and set

Lingo transform object representing this model's position and orientation relative to its parent's position and orientation:

transform.position gives the relative position.

transform.rotation gives the relative rotation.

Set: a transform object.

Get: reference to a transform object.

userData

Get and set

A property list containing all properties assigned to the model. Users can add, remove, get, and set properties on this list.

The default list includes the properties assigned in the 3D modeling tool. Additional properties may also be added.

resource

Get and set

Model resource object defining model's geometry.

Model resource object.

shaderList

Get and set

List of all shaders used by the model. Setting this property to a single shader sets every element of the shaderList to that shader.

List.

shaderList.count

Get

Number of shaders the model uses.

Positive integer.

shaderList.[index]

Get and set

Provides access to a particular shader used in a specific region of the model.

List.

shader

Get and set

Provides access to the first shader in the shader list.

Shader object.

boundingSphere

Get

A list containing a vector and a floating-point value. The vector represents the world position and the value represents the radius of a bounding sphere surrounding the model and all its children.

[vector (0,0,0), 0.0]

worldPosition

Get and set

Position of the model in world coordinates. Shortcut for the command node.getWorldTransform()position.

Vector object.

visibility

Get and set

The way in which the sides of the model's resource are drawn. The choices are as follows:

#none, in which no polygons are drawn and the model is invisible.

#front, in which only polygons on the outer surface of the model are drawn, so that, if the camera were inside the model, the model wouldn't be seen. Also known as "back face culling," this option optimizes performance.

#back, in which only polygons on the inside of the object are drawn, so that if the camera were outside the model, the model wouldn't be seen.

#both, in which all polygons are drawn and the model is visible regardless of orientation. This may solve drawing problems, but it can also affect performance because twice as many polygons must be drawn.

The default is #front.

#none:

#front

#back

#both

debug

Get and set

Value indicating whether debug information is drawn for this model. If the value is TRUE (1), lines from the X, Y, and Z axes are drawn sprouting up from the model to indicate its orientation, and a bounding sphere is drawn around the model.

TRUE (1) or FALSE (0). The default is FALSE (0).

boundingSphere

Get

A list containing a vector and a floating-point value. The vector represents the position of the model in world space, and the floating-point value represents the radius of the bounding sphere that contains the model and its children.

boundingSphere

worldPosition

Get

Position of the model in world coordinates. A quick shortcut for model.getWorldTransform().position.

worldPosition

pointAtOrientation

Get and set

A list of two orthogonal vectors, [objectRelativeDirecton, objectRelativeUp], that control how the model's pointAt() method works.

pointAtOrientation