The dna_expression_extractor takes a head.dna file as input, reads and
evaluates it through Epic's official RigLogic runtime, and exports every
control's facial expression, as well as each PSD corrective expression, as a
discrete morph target (full blendshape + joint deformation). Alongside the
output, a correctives.json file provides the connection logic needed to
wire everything back up in the DCC of your choice (Maya, Blender, etc.). A
joints.json file is also included, listing the full skeleton hierarchy.
If you find this project helpful, buying me a coffee shows your appreciation buymeacoffee.com/SeanNolan
dna_expression_extractor <file.dna> -o <out_dir> [options]
| Argument | Description |
|---|---|
<file.dna> |
Path to the MetaHuman head.dna file to read. Required, positional. |
-o <out_dir> |
Directory the OBJs and JSON sidecars are written to. Default: expression_objs. |
--mesh <name> |
Export only this mesh. Repeatable (pass multiple times for multiple meshes). Default: all meshes at --lod. |
--lod <n> |
LOD level used for mesh selection and the RigInstance. Default: 0. |
--up-axis y|z |
Coordinate system for all output: OBJ positions, blendshape deltas, and joint transforms. Default: y. |
--list-expressions |
Print the raw control list and PSD corrective count, (no export). |
--list-meshes |
Print the meshes available at --lod, (no export). |
--help, -h |
Print usage and exit (no export). |
Example:
dna_expression_extractor head.dna -o expression_objsEvery run writes into -o <out_dir>:
- base_neutral.obj - neutral base meshes (all if not specified at export time)
- One
.objper raw control (the full pose, blendshape + joint deformation combined) and one isolated-delta.objper PSD corrective (the combo pose with each contributing single expression subtracted out, then rebased onto neutral, so it imports as a standalone morph target rather than requiring its drivers to already be active). correctives.json: units (cm), the coordinate system actually used (up_axis, matching whatever--up-axisresolved to), and the driver → driven wiring for every control and corrective, socombinationShape-style nodes can be reconnected in your DCC.joints.json: the full skeleton hierarchy. Each joint lists its name, parent (its actual DNA parent,nullfor the root), and local translate/rotate (cm / degrees) relative to that parent.
Tested against MetaHuman head.dna files exported from Unreal Engine 5.7.
Other 5.x versions producing the same DNA format are expected to work but
aren't independently verified.
Rather than configuring the build locally, you can trigger .github/workflows/build.yml
manually (Actions tab -> "Build" -> "Run workflow"). It's a workflow_dispatch-only
job that clones OpenRigLogic, configures and builds on windows-latest, and uploads
dna_expression_extractor.exe as a downloadable artifact.
On Windows, install Visual Studio Build Tools
(or full Visual Studio) with the "Desktop development with C++" workload
checked. This provides the cl.exe compiler and MSBuild that CMake will use
in the steps below. Without it, cmake --build fails.
Download CMake (3.16 or newer) from cmake.org/download.
On Windows, the installer has an option to add CMake to the system PATH for
all users or the current user; enable it so cmake is callable from any
terminal. If you skip that step, add the CMake bin folder to your PATH
manually afterward.
Verify it's on your PATH:
cmake --versionOpen a terminal in whatever parent directory you'd like the project to live
under, then clone the repo (this creates a new dna_2_obj folder for you):
git clone https://github.com/swnolan/dna_2_obj.git
cd dna_2_objThe build depends on Epic's OpenRigLogic
repo, the public RigLogic runtime and DNA reader. This is fully public: no
Epic Games account, no Unreal Engine EULA, and no GitHub-to-Epic account
linking is required. (That's in contrast to pulling RigLogicLib out of
the private Unreal Engine source tree, which does require a linked Epic
account; this project avoids that path.)
git clone --depth 1 https://github.com/EpicGames/OpenRigLogic.gitClone it anywhere convenient; you'll pass its path to CMake in the next
step. It ships its own CMakeLists.txt and vendors its own
CMakeModulesExtra, so no additional module setup is needed.
cmake -B build -DRIGLOGIC_DIR=/path/to/OpenRigLogic
cmake --build build --config ReleaseThe built binary always lands at bin/x64/dna_expression_extractor.exe,
regardless of the Debug/Release config.
You'll need a MetaHuman head.dna file to run the tool against. These are
exported from Epic's MetaHuman tooling (MetaHuman Creator or
Unreal's MetahumanForMaya); obtaining one does require an
Epic Games account, separately from the OpenRigLogic build dependency
above.
./bin/x64/dna_expression_extractor.exe path/to/your.dna -o expression_objsA dna2obj.mod file lets Maya's module system pick up the dna2obj Python
package (see python/dna2obj/maya/README.md
for what it does) without manually editing PYTHONPATH.
- Download the
dna2obj-maya-moduleartifact from abuild.ymlrun (Actions tab -> latest "Build" run -> Artifacts) and extract it. You get two items: adna2obj.modfile and adna2obj/folder (bundlingpython/and the builtbin/x64/dna_expression_extractor.exe). - Drag both items into a folder Maya's module system scans, e.g.
%USERPROFILE%\Documents\maya\modules. - Restart Maya.
dna2obj.modaddsdna2obj/python/toPYTHONPATHsoimport dna2objworks from the Script Editor.
MIT (see LICENSE). This project builds against Epic's
OpenRigLogic, also MIT-licensed;
it's cloned separately at build time (see above) and isn't vendored in this repo.
