util.GetModelMeshes
Description
Returns a table of visual meshes of given model.
This does not work on brush models (
*number
models)See also ENTITY:GetRenderMesh.
Arguments
2 number lod = 0
Which LOD to retrieve. 0 is the best quality, increasing the number lowers the model quaility.
3 number bodygroupMask = 0
Bodygroup combination for the model. This can be in format of
"000000"
where each number represents a bodygroup option.Returns
1 table
A table of tables with the following format:
- string material - The material of the specific mesh
- table triangles - A table of MeshVertex structurees ready to be fed into IMesh:BuildFromTriangles
- table verticies - A table of MeshVertex structurees representing all the vertices of the mesh. This table is used internally to generate the "triangles" table.
Each MeshVertex structure returned also has an extra table of tables field called "weights" with the following data:
Example
Simple example usage on a Scripted Entity.