The "Model Editor", also known as "ModelDoc", is where you can create and edit model (VMDL) files. This is the modern equivalent of Source 1's .QC files. You can find it under the "Tools" menu.
Instead of text commands, everything uses nodes. They can be nested.
We ship some of our own model sources so you can take a look at them, modify them, and see how everything works. For example, you can find citizen.vmdl at sbox\game\addons\citizen\Assets\models\citizen\citizen.vmdl
.
When downloading cloud assets from the editor, some of their authors may have chosen to include their source files; this is the case for our first-person weapons.
All nodes are organized into categories. You can click "show empty categories" to display them all.
Nearly every node will automatically sort itself into a category, and won't work outside of them.
Right-clicking a category will show the nodes relevant to that category.
ModelDoc supports:
What's NOT supported:
Use the "Add Simple Animations" feature. You can access this by clicking on the little star icon next to "➕ Add" or by right-clicking AnimationList.
You need to create a character model, with its own animgraph that will respond properly to the inputs of the Animation Controller. This involves all steps of model creation, along with animating and creating the graph yourself.
If you can't or don't want to do all this for your new character, you can work "on top of" the Citizen, or extend it, using the "Base Model" feature, or by "forking" the VMDL by reusing part of it (through referencing its prefabs, for example)
Ideally, you shouldn't decompile a model. You're likely to get something that's not usable without some (if not lots of) work. If you want to modify something someone else made, you should ask them first!
The cleanest way to generate source files back out of an existing VMDL is to open it in ModelDoc, and use the Export As... function. It can export any meshes (including skinned ones) as FBX or OBJ. It will also attempt to export the maps used by the model's materials.
You may also try to use the Valve Resource Format explorer to attempt to export individual animations, though they will need some clean-up.
It is recommended you modify location and rotation manually in a separate modelling program. Alternatively, for scale you can use the ScaleAndMirror node for scaling your model. If your mesh is static (not skinned to any bones), you can change its position, orientation, and, scale in the same RenderMeshFile node you used to import the model:
Because animation nodes don't have individual scaling settings, scaling a mesh without its animations would effectively break the animations. Therefore, for animated models, using the ScaleAndMirror global modifier node is preferred.
By default, bones that are not skinning anything will be transparently discarded. You can prevent this behaviour in two ways:
Keep in mind that fewer bones are best for performance.
You can check the compiled hierarchy in the "Compiled Preview Outliner", under "Skeleton"; this lets you know what may have been discarded, changed, or otherwise modified.
Think of it as an equivalent of Source 1's $includemodel which was used by your "main" model to reference animation-only models.
However, in s&box, it works the other way around! For example, if you want to extend the Citizen character with new animations, your new VMDL (e.g. "citizen_my_custom_version.vmdl") would be referencing "citizen.vmdl" as its "Base Model".
Your new VMDL should only hold new animations, and nothing else.