Reference model: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 27: Line 27:


== Reference.smd ==
== Reference.smd ==
The Reference.smd is traditionally named <code>"modelname_ref.smd"</code>.  
* The Reference.smd is traditionally named <code>"modelname_ref.smd"</code>.  
The Physics.smd is traditionally named <code>"modelname_phys.smd"</code>.
* It defines the model's Reference Skeleton and its "default" 3D Rendering Geometry:
Each Animation.smd is traditionally named <code>"sequencename.smd"</code>.
** <!--smd|nodes & skeleton-->The '''Reference Skeleton''' is the key for all of the model's geometry: vertex data for the render mesh, sub meshes, collisionmodel, hitboxset, attachments, animations, gibs, etc. all ''reference'' the skeleton. <!--so be careful with [[$lod]] bone modification!-->
 
<!--The '''Default Pose''' is used when no animation or vphysics is applied to the skeleton.-->
 
** <!--smd|triangles-->The '''Reference Mesh''' is the "main body" (as opposed to [[$bodygroup]] sub-meshes) of the Render Model. <!--unless replaced by an [[$lod]] configuration.--> The Reference Mesh's [[UV map|Skinning data]] also defines the filename(s) of the model's '''Default Skin(s)'''.
 
* Notably, the reference.smd ''does not contain'' the model's
The Reference.smd basically contains the model's "default" Rig and Rendering data for animation files to manipulate.
** Physics geometry (collision & hitboxes)
* The '''Default Skeleton''' <!--nodes block--> is used by animations or ragdoll physics to manipulate the mesh, collisionmodel, hitboxset, etc. unless modified by [[$lod]] configuration.
** Skin files
* The '''Default Pose''' <!--skeleton block--> is used when no animation or vphysics is applied to the skeleton.
** LOD meshes & skins
* The '''Default Mesh''' <!--triangles block--> is the Mesh that will be Rendered unless replaced by an [[$lod]] configuration or modified by [[$bodygroup]]s.
** Optional meshes & skins
* The '''Default Skinname''' is only the ''filename'' of the VMT whose VTFs will be used on the Mesh unless overridden by [[$texturegroup]] skinfamilies options and/or [[$lod]] configuration.
** Animations
 
** Game settings (QC /StudioMDL parameters)
{{tip|See [[SMD file format]] for exactly how this data is stored in each "Studio Model Data" file.}}
{{tip|See [[SMD file format]] for exactly how this data is stored in each "Studio Model Data" file.}}


==Submesh.smd==
* <code>"submeshname_sub1.smd"</code>, <code>"modelname_ref_sub1.smd"</code> or <code>"modelname_hat_ref.smd"</code>.
* defines a rendered submesh which may be added to the default mesh via $bodygroups. Submeshes cannot be included in the reference.smd.
* includes: ref-skeleton, defines: mesh (ie: skinname, uvmap, envelope & weightmap data)
* submesh.smd must be enveloped to the ref-skeleton ...


==LOD...smd==
==LOD.smd==
see [[LOD Models]] ... compiled into VVD/VTX of main model
* <code>"lod1_modelname_ref.smd"</code>, <code>"lod1_modelname_sub1.smd"</code>.
* [[LOD Models]] are simplified versions of renderable meshes. each requires its own smd, and are compiled into VVD/VTX of main model via the $lod configuration.
* the convention is to prefix the modelname "lod#_". The ref and sub.smds are effectively lod0_modelname_ref.smd, lod0_modelname_sub.smd,
* includes: ref-skeleton, defines: mesh geometry (ie: coords, smoothing, skinname, uvmap, envelope & weightmap data)


==Physics.smd==
==Physics.smd==
* The Physics.smd is traditionally named <code>"bodymeshname_phy.smd"</code>. _physmodel.smd or _physbox.smd
* defines the hull geometry, envelope and smoothing group data for the collisionmodel. incl ref-skeleton.
* includes the ref-skeleton and defines: hull geometry(s) (ie: vertex coords, normals, & envelope data)
** Because hulls are rigid and not rendered, they don't use any UVmap or weightmap data.
** Each hull must be a convex shape ie somewhere between a sphere and a box. Overlapping/intersecting multiple hulls are used to create ($concave) models.
** Rigid collisionmodels ($collisionmodel) envelope all hulls to the same bone.
** Jointed collisionmodels ($collisionjoints) envelope some hulls to different bones.


==Hitbox.smd==
==Hitbox.smd==
{{confirm|not compiled by StudioMDL, but opened in text editor for hitbox vertex coordinates?}}
* {{confirm|not compiled by StudioMDL, but opened in text editor for hitbox vertex coordinates?}}
* not rendered, simple collision = simple box geometry


==Animation.smd==
==Animation.smd==
* Each Animation.smd is traditionally named <code>"sequencename.smd"</code>.
* includes the ref-skeleton and defines a keyframed sequence of skeletal poses.
* $sequence "idle" "modelname_idle.smd"
* $sequence "idle" "modelname_idle.smd"
* $sequence "ragdoll" "ragdoll.smd" ACT_DIERAGDOLL 1 fps 30.00
* $sequence "ragdoll" "ragdoll.smd" ACT_DIERAGDOLL 1 fps 30.00

Revision as of 05:44, 3 May 2008

Under construction.png
This page is actively undergoing a major edit.
As a courtesy, please do not edit this while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.

The person who added this notice will be listed in its edit history should you wish to contact them.

The plan is to break out this stuff when it's finished. --Beeswax 19:08, 1 May 2008 (PDT)

Compiling a Model

probable destination for this section is an introduction to Compiling models for Source. 3rd party MDL compilers often provide a different GUI to the QC file than StudioMDL, so a checklist of "things you should already have done" would be relevant to all MDL compiler docs. It includes model anatomy/glossary definitions for #REDIRECTs ?

Reference.smd

  • The Reference.smd is traditionally named "modelname_ref.smd".
  • It defines the model's Reference Skeleton and its "default" 3D Rendering Geometry:
    • The Reference Skeleton is the key for all of the model's geometry: vertex data for the render mesh, sub meshes, collisionmodel, hitboxset, attachments, animations, gibs, etc. all reference the skeleton.
    • The Reference Mesh is the "main body" (as opposed to $bodygroup sub-meshes) of the Render Model. The Reference Mesh's Skinning data also defines the filename(s) of the model's Default Skin(s).
  • Notably, the reference.smd does not contain the model's
    • Physics geometry (collision & hitboxes)
    • Skin files
    • LOD meshes & skins
    • Optional meshes & skins
    • Animations
    • Game settings (QC /StudioMDL parameters)
Tip.pngTip:See SMD file format for exactly how this data is stored in each "Studio Model Data" file.

Submesh.smd

  • "submeshname_sub1.smd", "modelname_ref_sub1.smd" or "modelname_hat_ref.smd".
  • defines a rendered submesh which may be added to the default mesh via $bodygroups. Submeshes cannot be included in the reference.smd.
  • includes: ref-skeleton, defines: mesh (ie: skinname, uvmap, envelope & weightmap data)
  • submesh.smd must be enveloped to the ref-skeleton ...

LOD.smd

  • "lod1_modelname_ref.smd", "lod1_modelname_sub1.smd".
  • LOD Models are simplified versions of renderable meshes. each requires its own smd, and are compiled into VVD/VTX of main model via the $lod configuration.
  • the convention is to prefix the modelname "lod#_". The ref and sub.smds are effectively lod0_modelname_ref.smd, lod0_modelname_sub.smd,
  • includes: ref-skeleton, defines: mesh geometry (ie: coords, smoothing, skinname, uvmap, envelope & weightmap data)

Physics.smd

  • The Physics.smd is traditionally named "bodymeshname_phy.smd". _physmodel.smd or _physbox.smd
  • defines the hull geometry, envelope and smoothing group data for the collisionmodel. incl ref-skeleton.
  • includes the ref-skeleton and defines: hull geometry(s) (ie: vertex coords, normals, & envelope data)
    • Because hulls are rigid and not rendered, they don't use any UVmap or weightmap data.
    • Each hull must be a convex shape ie somewhere between a sphere and a box. Overlapping/intersecting multiple hulls are used to create ($concave) models.
    • Rigid collisionmodels ($collisionmodel) envelope all hulls to the same bone.
    • Jointed collisionmodels ($collisionjoints) envelope some hulls to different bones.

Hitbox.smd

  • Confirm:not compiled by StudioMDL, but opened in text editor for hitbox vertex coordinates?
  • not rendered, simple collision = simple box geometry

Animation.smd

  • Each Animation.smd is traditionally named "sequencename.smd".
  • includes the ref-skeleton and defines a keyframed sequence of skeletal poses.
  • $sequence "idle" "modelname_idle.smd"
  • $sequence "ragdoll" "ragdoll.smd" ACT_DIERAGDOLL 1 fps 30.00
  • $includemodel includes an AnimationLibrary.mdl