ModelData
EditA 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.newModelData | Create a new ModelData. |
Methods
| ModelData:getAnimationChannelCount | Get the number of channels in an animation. |
| ModelData:getAnimationCount | Get the number of animations in the model. |
| ModelData:getAnimationDuration | Get the duration of an animation, in seconds. |
| ModelData:getAnimationKeyframe | Get a keyframe in a channel of an animation. |
| ModelData:getAnimationKeyframeCount | Get the number of keyframes in a channel of an animation. |
| ModelData:getAnimationName | Get the name of an animation. |
| ModelData:getAnimationNode | Get the node targeted by the channel of an animation. |
| ModelData:getAnimationProperty | Get the property targeted by a channel of an animation. |
| ModelData:getAnimationSmoothMode | Get the smooth mode of a channel in an animation. |
| ModelData:getBlendShapeCount | Get the total number of blend shapes in the model. |
| ModelData:getBlendShapeName | Get the name of a blend shape. |
| ModelData:getBoundingBox | Get the bounding box of the model. |
| ModelData:getCenter | Get the center of the model's bounding box. |
| ModelData:getDepth | Get the depth of the model. |
| ModelData:getDimensions | Get the dimensions of the model. |
| ModelData:getHeight | Get the height of the model. |
| ModelData:getImage | Get an Image in the model. |
| ModelData:getImageCount | Get the number of Images stored in the model. |
| ModelData:getMaterial | Get the material properties for a material in the model. |
| ModelData:getMaterialCount | Get the number of materials in the model. |
| ModelData:getMaterialName | Get the name of a material in the model. |
| ModelData:getMeshBlendShapeCount | Get the number of blend shapes in one of the model's meshes. |
| ModelData:getMeshBlendShapeName | Get the name of a blend shape. |
| ModelData:getMeshBlendVertex | Get the data for a single vertex in a blend shape. |
| ModelData:getMeshCount | Get the number of meshes in the model. |
| ModelData:getMeshDrawMode | Get the draw mode of a mesh part. |
| ModelData:getMeshDrawRange | Get the vertex range of a mesh part. |
| ModelData:getMeshIndex | Get one of the vertex indices in a mesh. |
| ModelData:getMeshIndexCount | Get the number of vertex indices in a mesh. |
| ModelData:getMeshMaterial | Get the index of the material used by a mesh part. |
| ModelData:getMeshPartCount | Get the number of parts in a mesh. |
| ModelData:getMeshVertex | Get the data for a single vertex in a mesh. |
| ModelData:getMeshVertexCount | Get the number of vertices in a mesh. |
| ModelData:getMetadata | Get extra information from the model file. |
| ModelData:getNodeChild | Get the first child of a node. |
| ModelData:getNodeChildren | Get the children of a node. |
| ModelData:getNodeCount | Get the number of nodes in the model. |
| ModelData:getNodeMesh | Get the index of the mesh attached to a node. |
| ModelData:getNodeName | Get the name of a node. |
| ModelData:getNodeOrientation | Get the local orientation of a node. |
| ModelData:getNodeParent | Get the parent of a node. |
| ModelData:getNodePose | Get the local pose of a node. |
| ModelData:getNodePosition | Get the local position of a node. |
| ModelData:getNodeScale | Get the local scale of a node. |
| ModelData:getNodeSibling | Get the next sibling of a node. |
| ModelData:getNodeSkin | Get the index of the skin used by a node. |
| ModelData:getNodeTransform | Get the local transform of a node. |
| ModelData:getRootNode | Get the index of the root node. |
| ModelData:getSkinCount | Get the number of skins in the model. |
| ModelData:getSkinInverseBindMatrix | Get the inverse bind matrix for a joint in the skin. |
| ModelData:getSkinJoints | Get the joints in a skin. |
| ModelData:getWidth | Get the width of the model. |
| Object:release | Immediately release the Lua reference to an object. |
| Object:type | Get the type name of the object. |