ColladaModel

ColladaModel objects are used to display custom 3D graphics in a simulation model.  The COLLADA file format (.DAE) is an interchange file format used for 3D graphics.  Any 3D object such as a DisplayEntity and most of its sub-classes can accept a ColladaModel as its DisplayModel.

A number of other 3D formats can be used in addition to Collada.  At the present time, JaamSim supports DAE, OBJ, and JSB formats as well as zipped versions of these files (ZIP).  The JSB format is specific to JaamSim:

The JSB format is a binary format that allows complex 3D objects to be loaded much faster than is possible with the DAE and OBJ formats.  A JSB file can be exported by right clicking on a ColladaModel in the Object Selector and selecting "Export 3D Binary File (*.jsb)".  Note that the exported JSB will look for the same textures as the DAE file and that these should be located in the same relative position to the JSB file as they were to the DAE file.

Managing 3D assets can be complicated because of the large file sizes and the need to provide separate files for the textures.  It is recommended that the user place each 3D asset and its texture files in its own ZIP file.  This approach greatly reduces the number and size of the files being handled, and ensures that the files can be moved between computers without breaking the file paths.  Note that it is often necessary to edit the DAE file with a text editor, such as Notepad++, to convert any absolute file paths for texture files to relative ones.

The Actions keyword allows 3D animations included in the imported 3D file (.DAE, .JSB, etc.) to be reproduced by any DisplayEntity (or sub-class) that uses this ColladaModel.  The animations imported with the 3D file are listed by the Actions output for ColladaModel.  The input to the Actions keyword consists of a list of action name / output name pairs, with each pair enclosed by braces, e.g.

{ ActionName1  OutputName1 } { ActionName2  OutputName2 }

In this example, ActionName1 is the name of one of the animations listed in the Actions output for the ColladaModel, and OutputName1 is the name of an output provided by the DisplayEntity (or sub-class) that uses this ColladaModel as the input to its DisplayModel keyword.  The output must return a dimensionless number which is interpreted by the ColladaModel as the number of seconds that have elapsed in the animation.  This value can be related to the simulation time in the model (after a suitable offset) or it can vary arbitrarily to move the animation forward or backward as required.  The same ColladaModel can be shared by more than one DisplayEntity with each DisplayEntity showing a different point in the same animation.

The '3D Animation Example' provided under Help > Examples demonstrates how to use animations in a JaamSim model.

ColladaModel Inputs

Keyword

Description

Key Inputs

 

Description

A free-form string describing the object.

ColladaFile

A file path to the DAE, OBJ, or JSB file to be used for this DisplayModel.  A ZIP file containing one of these files and its related texture files can also be used, and is the recommended option for this input.  The file path must be enclosed in single quotes if it contains spaces.

Actions

Entity outputs that drive the animated actions for the ColladaModel.  The actions for a ColladaModel are defined as part of its ColladaFile input.  They are listed in the 'Actions' output for the ColladaModel.

ColladaModel Outputs

Output Name

Description

Entity

 

Name, ObjectType, SimTime, Parent

See Section 11.1.

ColladaModel

 

Actions

Names of the animations contained in the 3D model.

Vertices

Number of vertices contained in the 3D model.

Triangles

Number of triangles contained in the 3D model.

VertexShareRatio

Number of triangles divided by one-third of the number of vertices.  A value > 1 indicates that vertices were shared between multiple triangles.

NumSubInstances

Number of sub-instances contained in the 3D model.

NumSubMeshes

Number of sub-meshes contained in the 3D model.