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, in seconds.
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 a channel of an animation.
ModelData:getAnimationSmoothModeGet the smooth mode of a channel in an animation.
ModelData:getBlendShapeCountGet the total number of blend shapes in the model.
ModelData:getBlendShapeNameGet the name of a blend shape.
ModelData:getBoundingBoxGet the bounding box 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:getMeshBlendShapeCountGet the number of blend shapes in one of the model's meshes.
ModelData:getMeshBlendShapeNameGet the name of a blend shape.
ModelData:getMeshBlendVertexGet the data for a single vertex in a blend shape.
ModelData:getMeshCountGet the number of meshes in the model.
ModelData:getMeshDrawModeGet the draw mode of a mesh part.
ModelData:getMeshDrawRangeGet the vertex range of a mesh part.
ModelData:getMeshIndexGet one of the vertex indices in a mesh.
ModelData:getMeshIndexCountGet the number of vertex indices in a mesh.
ModelData:getMeshMaterialGet the index of the material used by a mesh part.
ModelData:getMeshPartCountGet the number of parts in a mesh.
ModelData:getMeshVertexGet the data for a single vertex in a mesh.
ModelData:getMeshVertexCountGet the number of vertices in a mesh.
ModelData:getMetadataGet extra information from the model file.
ModelData:getNodeChildGet the first child of a node.
ModelData:getNodeChildrenGet the children of a node.
ModelData:getNodeCountGet the number of nodes in the model.
ModelData:getNodeMeshGet the index of the mesh 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:getNodeSiblingGet the next sibling 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:getWidthGet the width of the model.
Object:releaseImmediately release the Lua reference to an object.
Object:typeGet the type name of the object.

See also