ModelData

Edit

A ModelData is a container object that loads and holds data contained in 3D model files. This can include a variety of things like the node structure of the asset, the vertex data it contains, contains, the Image and Material properties, and any included animations.

The current supported formats are OBJ, glTF, and STL.

Usually you can just load a Model directly, but using a ModelData can be helpful if you want to load models in a thread or access more low-level information about the Model.

Constructor

lovr.data.newModelDataCreate a new ModelData.

Methods

ModelData:getAnimationChannelCountGet the number of channels in an animation.
ModelData:getAnimationCountGet the number of animations in the model.
ModelData:getAnimationDurationGet the duration of an animation.
ModelData:getAnimationKeyframeGet a keyframe in a channel of an animation.
ModelData:getAnimationKeyframeCountGet the number of keyframes in a channel of an animation.
ModelData:getAnimationNameGet the name of an animation.
ModelData:getAnimationNodeGet the node targeted by the channel of an animation.
ModelData:getAnimationPropertyGet the property targeted by the channel of an animation.
ModelData:getAnimationSmoothModeGet the smooth mode of a channel in an animation.
ModelData:getBlendShapeCountGet the number of blend shapes in the model.
ModelData:getBlendShapeNameGet the name of a blend shape in the model.
ModelData:getBlobGet a Blob in the model.
ModelData:getBlobCountGet the number of Blobs stored in the model.
ModelData:getBoundingBoxGet the bounding box of the model.
ModelData:getBoundingSphereGet the bounding sphere of the model.
ModelData:getCenterGet the center of the model's bounding box.
ModelData:getDepthGet the depth of the model.
ModelData:getDimensionsGet the dimensions of the model.
ModelData:getHeightGet the height of the model.
ModelData:getImageGet an Image in the model.
ModelData:getImageCountGet the number of Images stored in the model.
ModelData:getMaterialGet the material properties for a material in the model.
ModelData:getMaterialCountGet the number of materials in the model.
ModelData:getMaterialNameGet the name of a material in the model.
ModelData:getMeshCountGet the number of meshes in the model.
ModelData:getMeshDrawModeGet the draw mode of a mesh.
ModelData:getMeshIndexGet one of the vertex indices in a mesh.
ModelData:getMeshIndexCountGet the number of vertex indices in a mesh.
ModelData:getMeshIndexFormatGet the data format of vertex indices in a mesh.
ModelData:getMeshMaterialGet the index of the material applied to a mesh.
ModelData:getMeshVertexGet the data for a single vertex in a mesh.
ModelData:getMeshVertexCountGet the number of vertices in a mesh.
ModelData:getMeshVertexFormatGet the vertex format of a mesh.
ModelData:getMetadataGet extra information from the model file.
ModelData:getNodeChildrenGet the children of a node.
ModelData:getNodeCountGet the number of nodes in the model.
ModelData:getNodeMeshesGet the indices of meshes attached to a node.
ModelData:getNodeNameGet the name of a node.
ModelData:getNodeOrientationGet the local orientation of a node.
ModelData:getNodeParentGet the parent of a node.
ModelData:getNodePoseGet the local pose of a node.
ModelData:getNodePositionGet the local position of a node.
ModelData:getNodeScaleGet the local scale of a node.
ModelData:getNodeSkinGet the index of the skin used by a node.
ModelData:getNodeTransformGet the local transform of a node.
ModelData:getRootNodeGet the index of the root node.
ModelData:getSkinCountGet the number of skins in the model.
ModelData:getSkinInverseBindMatrixGet the inverse bind matrix for a joint in the skin.
ModelData:getSkinJointsGet the joints in a skin.
ModelData:getTriangleCountGet the total number of triangles in the model.
ModelData:getTrianglesGet all the triangles in the model.
ModelData:getVertexCountGet the total vertex count of the model.
ModelData:getWidthGet the width of the model.

See also