3D Lingo Dictionary > C-D > count |  |

count

Syntax

    member(whichCastmember).light.count
    member(whichCastmember).camera.count
    member(whichCastmember).modelResource(whichModelResource).bone.count
    member(whichCastmember).model.count
    member(whichCastmember).group.count
    member(whichCastmember).shader.count
    member(whichCastmember).texture.count
    member(whichCastmember).modelResource.count
    member(whichCastmember).motion.count
    member(whichCastmember).light.child.count
    member(whichCastmember).camera.child.count
    member(whichCastmember).model.child.count
    member(whichCastmember).group.child.count
    sprite(whichSprite).camera{(index)}.backdrop.count
    member(whichCastmember).camera(whichCamera).backdrop.count
    sprite(whichSprite).camera{(index)}.overlay.count
    member(whichCastmember).camera(whichCamera).overlay.count
    member(whichCastmember).model(whichModel).modifier.count
    member(whichCastmember).model(whichModel).keyframePlayer.playlist.count
    member(whichCastmember).model(whichModel).bonesPlayer.playlist.count
    member(whichCastmember).modelResource(whichModelResource).face.count
    member(whichCastmember).model(whichModel).meshDeform.mesh[index].textureLayer.count
    member(whichCastmember).model(whichModel).meshDeform.mesh.count
    member(whichCastmember).model(whichModel).meshDeform.mesh[index].face.count

Description

3D property; returns the number of items in the given list that is associated with the given 3D object. Can be used with any type of object.

The `face.count` property allows you to get the number of triangles in the mesh for a model resource whose type is `#mesh`.

This property can be tested but not set.

Examples

These examples determine the number of various types of objects within a 3D cast member called 3D World.

    numberOfCameras = member("3D World").camera.count
    put member("3D World").light.count
    -- 3
    numberOfModels = member("3D World").model.count
    numberOfTextures = member("3D World").texture.count
    put member("3D World").modelResource("mesh2").face.count
    -- 4

This statement shows that the first mesh of the model named Ear is composed of 58 faces.

    put member("Scene").model("Ear").meshdeform.mesh[1].face.count
    -- 58

This statement shows that the model named Ear is composed of three meshes.

    put member("Scene").model("Ear").meshdeform.mesh.count
    -- 3

This statement shows that the first mesh of the model named Ear has two texture layers.

    put member("Scene").model("Ear").meshdeform.mesh[1].textureLayer.count
    -- 2

See also

`cameraCount()`