Divine Skins
Divine Skins Wiki

Hero swap part 1: rig your model in Blender

Fit your character to a Deadlock hero's skeleton in Blender, transfer and fix the weights, and export DMX files for ModelDoc.

Advanced

Part 1 of 4. You start with your own character model. You finish with DMX files in your CSDK 12 addon, rigged to the hero's own skeleton. Read Hero model swap: overview first.

The four parts of a hero model swap, with part 1, rig in Blender, highlighted

What you need

Source 2 Viewer exports the hero. Make an addon for this skin in CSDK 12, named in lowercase with no spaces. The BlenderSource2Tools add-on (Fuji fork) exports DMX files for ModelDoc. Mesh Data Transfer is a free Blender add-on to copy weights. The soul container swap teaches the same tools on a much smaller model. Make the character mesh yourself, or get the artist's permission.

Want hair or a coat that moves? Read Add cloth to a model before you start. Cloth work may need an older Blender.

Watch the walkthrough

Pugzilla's video covers the Blender setup from 3:38 and the DMX export from 20:37.

This video uses an older interface

It was recorded in March 2026, before Source 2 Viewer 20.0. Read the video description: it lists fixes found after recording. Where this page differs, follow this page.

Rig and export

Export the hero

Use the hero you picked in the overview. This guide uses Vyper, whose model sits at models/heroes_staging/viper/viper.vmdl_c. Other heroes are in Hero names and file paths.

You need the hero twice: as a model file for ModelDoc, and as a glTF for Blender.

  1. Open Source 2 Viewer and open Deadlock/game/citadel/pak01_dir.vpk.
  2. Go to models/heroes_staging/viper/.
  3. Right-click viper.vmdl_c and choose Decompile & export.
  4. Pick the model format (.vmdl). Save it into your addon at the same path: content/citadel_addons/<addon>/models/heroes_staging/viper/.
  5. Export the glTF as Import a Deadlock model into Blender shows. Save it in a work folder outside your addon.

The decompile writes a .vmdl file plus DMX files for the hero's meshes. Part 2 opens that .vmdl.

Load the hero in Blender

  1. Import and clean the glTF with the same Blender import guide. Follow route 1 up to and including Fix size and facing.
  2. Check the result. The hero faces +X, has no animations and no $cloth bones, and the armature is in rest pose.
  3. Scale the hero to Source 2 size. Select the armature and every mesh, press S, type 39.37, and press Enter.
  4. Press Ctrl+A and choose All Transforms.
  5. Save the .blend file.

The 39.37 scale turns meters into inches, the unit the Source 2 tools use. Do it once, here. Then you fit your character at the final size.

Doing the dry run? The overview suggests one full run with the unchanged hero first. Skip to Sort meshes into collections, export the hero's own meshes, and follow parts 2 to 4. Come back here once the plain hero works in game.

Fit your model to the hero

Keep the hero's size and shape

Do not make the hero smaller, thinner, or harder to see. You also see your skin on enemies who play this hero. Its size changes how easy they are to see and aim at. Players treat that as an unfair mod. See What's allowed and how to stay safe.

  1. Import your character into the same Blender file.
  2. Delete your character's own armature. Your mesh uses the hero's skeleton from now on.
  3. Move and scale your mesh until it lines up with the hero's body: head, shoulders, elbows, hips, and knees.
  4. Keep the overall height and width close to the hero's.
  5. Select your mesh, press Ctrl+A, and choose All Transforms.

Never edit the hero's bones. Do not move, rename, or delete them. The game plays the hero's animations on those exact bones. You may add new bones for cloth chains, such as a tail or long hair.

Rig your mesh to the skeleton

  1. Select your mesh, then Shift-click the hero's armature.
  2. Press Ctrl+P and choose Armature Deform.
  3. Copy the weights from the hero's body mesh to your mesh. Use Blender's Data Transfer modifier, or the Mesh Data Transfer add-on.
  4. Switch to Pose Mode and rotate a few bones. Your mesh should follow them.
  5. Fix the bad spots with weight painting. Strange bending in game almost always comes from weights.
  6. Move the hero's original meshes into a separate collection. You do not export them.

Rigid parts, such as a helmet or an armor plate, should follow one bone only. In Edit Mode, select the part's vertices, pick that bone's vertex group, and click Assign. Weight small accessories to the nearest bone.

Limit weights to 4 per vertex

Keep each vertex at four bone weights or fewer. The exporter warns you when a vertex has more.

  1. Select your mesh.
  2. Switch to Weight Paint mode.
  3. Choose Weights, then Limit Total. Check that the limit is 4.

Sort meshes into collections

The exporter writes one DMX file per collection. In ModelDoc, each DMX file becomes one mesh.

  1. Make one collection for each mesh the original hero has. Vyper has a body and a gun, so make viper and gun.
  2. Put your meshes into the matching collection.
  3. Put the armature in the body collection.
  4. Move everything else out of these collections: the hero's old meshes, reference objects, and lights.

Keep these names the same on every export. ModelDoc finds each DMX file by its name.

Diagram: the Blender collections viper and gun export as viper.dmx and gun.dmx, which become ModelDoc meshes named viper and gun, the same names as the original

Check before you export

  • Every mesh is parented to the armature and weighted to at least one bone.
  • No name ends in .001. Check meshes, materials, and vertex groups.
  • Every face has a material. Use short, plain material names. Part 2 matches them by name.
  • All transforms are applied.
  • The armature is in rest pose.
  • The file has exactly one armature.
  • No $cloth bones are left.

Export DMX

  1. Open Scene Properties and find the Source Engine Export panel.
  2. Set Export Format to DMX.
  3. Set the DMX version to Binary 9 and the model format to Model 22, the ModelDoc format.
  4. Set Export Path to a dmx folder inside the hero folder of your addon: content/citadel_addons/<addon>/models/heroes_staging/viper/dmx/.
  5. In Source Engine Exportables, untick the animations. Leave only your mesh collections ticked.
  6. Choose Export, then Scene Export.
  7. Read the warnings. Fix missing materials and too many weights. Most other warnings are harmless.

The separate dmx folder keeps your files apart from the decompiled ones. Heroes use DMX, not FBX: DMX keeps the scale and supports cloth.

viper.vmdl
viper.dmx
gun.dmx

Common problems

More fixes are in Model and skin problems.

Next steps

Hero swap part 2: build the model in ModelDoc
Advanced

Swap in your DMX meshes and rebuild bodygroups, materials, the ragdoll, and LODs.

Credits

This guide is based on the work of these creators. Check out their original guides.