Garry's Mod Wiki

ModelInfo

Description

Table returned by util.GetModelInfo.

Members

string KeyValues
Valve key-value formatted info about the model's physics (Constraint Info, etc). This is limited to 4096 characters.

This data can be parsed into a Lua table via util.KeyValuesToTablePreserveOrder

string ModelKeyValues
Valve key-value formatted info about the model ($keyvalues command in the .qc of the model), if present.

Can describe things like health of a prop, flammability, etc.

number MeshCount
Number of meshes the model has. This could be 0 for animation only models.
number BoneCount
Number of bones the model has.
number Flags
Model flags. See this page on Valve Developer Wiki for explanation of each one.
boolean StaticProp
Whether the model is meant to be a static prop (checks a specific model flag)
number MaterialCount
Number of materials used by this model.
number SequenceCount
Number of sequences the model has.
number AttachmentCount
Number of attachments the model has.
string ModelName
Name of the model, as embedded in the model file itself. This may be different from the model path of the model on disk.
number Version
Model version. This should be 48 most of the time, but can be different from mountable games.
number Checksum
Checksum (CRC32) of the model. This value should be identical across all files for the same model. (.vtx, .mdl, .vvd, etc.)
string SurfacePropName
Name of the surface property for this model. See util.GetSurfaceData for more details about what they are.
Vector EyePosition
If present, position of the eyes of the model, for NPCs.
Vector IllumPosition
Illumination position for the model, for cases where the model root would be potentially outside of the world.
Vector HullMin
Mins of the model's bounding box.
Vector HullMax
Maxs of the model's bounding box.
sequential table<table> Attachments
A list of attachments the model has.

Each attachment is a table with the following info:

  • Name
  • Bone
  • Offset
sequential table<table> Bones
A list of bones the model has. Please node that the keys of this table are not bone IDs, it's just a list, <validate>but it might be safe to assume the keys are (BoneID-1) due to Lua table indexes starting at 1.</validate>.

Each bone in the list has the following fields:

  • Name
  • Parent
  • Flags
  • PhysObj
  • SurfacePropName
  • Position
  • Angle
sequential table<table> Sequences
A list of sequences the model has, including the ones from $includemodels.

Each sequence is a table with the following info:

Events table is a list of tables with following memebers:

sequential table<string> Materials
A list of materials the model uses, across all its meshes.
sequential table<string> MaterialDirectories
A list of folders the game will look in for the Materials.
number IncludeModelCount
Number of other models this model includes for their animations.
This was recently added in version (2025.05.19). It might only be available on the Dev Branch right now.
sequential table<string> IncludeModels
The list of models this model includes for their animations.
This was recently added in version (2025.05.19). It might only be available on the Dev Branch right now.
sequential table<table> HitBoxSets
A list of hitbox sets this model has. Each hitbox set has the following structure:
  • Name
  • Count
  • HitBoxes - a table of hitboxes within this set

Each hitbox has the following format:

  • Mins
  • Maxs
  • Bone
This was recently added in version (2025.05.19). It might only be available on the Dev Branch right now.