This article relates to the game "Half-Life: Alyx". Click here for more information.
This article relates to the workshop tools for "Half-Life: Alyx". Click here for more information.
This article's documentation is for Source 2. Click here for more information.

Model Troubleshooting

From Valve Developer Community
Jump to: navigation, search
English (en)中文 (zh)
Edit

ModelDoc is a very powerful, but incredibly mysterious beast. And it has some weird quirks that probably make a lot of sense for how Valve's models work, but maybe aren't normal to us modders. So here's some quick troubleshooting steps if you're having issues with certain features.

Basic ModelDoc Function

The ModelDoc Editor, with a blank scene.

As a refresher, ModelDoc uses a node-based system for putting together models, but maybe not in the way you'd think. Nodes are stored in the Outliner, which is organized by Categories, each with their own unique settings and properties that are worth taking a once over.

Note.pngNote:You can view all the available nodes for models and their settings by selecting "Show Empty Categories."

To preview your model as you're working on it, you have to manually compile it, using the HLVR-ModelDoc-NeedsCompiling.png button.

To add a mesh to your model, you will need to right click the Outliner, and add a Mesh Node to your model. This can be done by either finding the desired mesh node (usually RenderMeshFile) or more easily, clicking the "Add Meshes..." button which does the same thing.

Now, click the "Compile Model" button and your model should render! Usually though, your model won't spawn with its textures, as it'll look for materials that aren't there. To override your materials from the FBX file, add a new node called "DefaultMaterialGroup" which will override your default materials.

Making Morphs/Flexes Work

Basic Setup for Morphs in ModelDoc

By default, morphs (or shapekeys) will not appear to work in the ModelDoc editor. Morphs can be imported using .FBX or .DMX, ideally the latter if you can because .DMX retains more data. For models with morphs, Valve requires three things:

  • A Mesh with Morphs
  • A Material with "Morphs Supported" ticked on
  • An Animation

To accomplish this, the best way to go about it is to set up your model with a DefaultMaterialGroup node, directed to a material with morphs enabled. Then, give it an EmptyAnim node, so it has some animation. Now, morphs will work.

You can technically preview your morphs using the Morph Explorer in ModelDoc, but it requires you to recompile every time you adjust them. This seems to be a glitch, as the ol' Model Editor didn't have this requirement.

Missing Bones/Joints on Import

Easy way to disable bone culling

If you're missing bones on import, don't fret. Valve has a weird default setting on ModelDoc that will aggressively cull bones that have no skinning. You can disable this by, in the outliner, selecting "Show Empty Categories" then selecting BoneMarkupList near the bottom. Select "Bone Cull Type" to be "None", or "Leaf" if you prefer and your favorite modeling software exports them against your wishes.

See also