<aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/docs/dna_md#metahuman-dna"><codeclass="docutils literal notranslate"><spanclass="pre">DNA</span></code></a> is an integral part of <aclass="reference external"href="https://www.unrealengine.com/en-US/metahuman">MetaHuman</a> identity.
<aclass="reference external"href="https://docs.metahuman.unrealengine.com/en-US/downloading-metahumans-with-quixel-bridge/">Quixel Bridge</a>, and Bifrost in UE5.</p>
<p>MetaHuman DNA Calibration is a set of tools used for working with MetaHuman DNA files, bundled into a single package. We wanted to share this code to help users customize DNA files so they can better integrate the characters they create into their games and experiences.
MetaHuman DNA Calibration tools are provided in a GitHub repository located at this address.</p>
<h1>Overview<aclass="headerlink"href="#overview"title="Permalink to this headline"></a></h1>
<p>For an explanation about how the repository is organized, <aclass="reference internal"href="repository_organization_md.html"><spanclass="doc std std-doc">click here</span></a>.</p>
<h2>Required Knowledge<aclass="headerlink"href="#required-knowledge"title="Permalink to this headline"></a></h2>
<p>To use these tools, you should be familiar with:</p>
<ulclass="simple">
<li><p>Rigging in Maya</p></li>
<li><p>Python</p></li>
</ul>
</section>
<sectionid="optional-knowledge">
<h2>Optional Knowledge<aclass="headerlink"href="#optional-knowledge"title="Permalink to this headline"></a></h2>
<ulclass="simple">
<li><p>C++ (for <aclass="reference internal"href="dnacalib_md.html"><spanclass="doc std std-doc">DNACalib</span></a> and its <aclass="reference internal"href="dnacalib_api_md.html"><spanclass="doc std std-doc">API</span></a>)</p></li>
</ul>
</section>
<sectionid="dnacalib">
<h2>DNACalib<aclass="headerlink"href="#dnacalib"title="Permalink to this headline"></a></h2>
<p><aclass="reference internal"href="dnacalib_md.html"><spanclass="doc std std-doc">DNACalib</span></a> and its <aclass="reference internal"href="dnacalib_api_md.html"><spanclass="doc std std-doc">API</span></a> are used to inspect and modify DNA files. With <aclass="reference internal"href="dnacalib_md.html"><spanclass="doc std std-doc">DNACalib</span></a>, you can make the following changes in DNA files:</p>
<ulclass="simple">
<li><p>Rename joints, meshes, blendshapes, and / or animated maps.</p></li>
<li><p>Remove joints, meshes, and / or joint animation.</p></li>
<li><p>Rotate, scale, and translate the rig.</p></li>
<p>An overview of the MetaHuman DNA file format can be found <aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/docs/dna_md"><codeclass="docutils literal notranslate"><spanclass="pre">here</span></code></a>.</p>
<p><strong>Note</strong>: DNACalib library allows removal and renaming of any joint. However, the following joints are used for connecting head with body and should not be removed or renamed: neck_01, neck_02, FACIAL_C_FacialRoot.</p>
<p>DNACalib’s Python wrapper is compiled against Python 3.7 and 3.9. Pre-compiled binaries for Windows and Linux (both 64-bit) are part of the repository.
DNA files are stored as <aclass="reference external"href="https://git-lfs.github.com/">LFS (Large File Storage)</a> files. They are downloaded with the rest of the code if
git-lfs is installed and configured to use. If you are not using git-lfs, you have to download DNA files manually.</p>
<p>Additional information can be found <spanclass="xref myst">here</span></p>
<p>DNACalib Python wrapper can be used in Python 3.7 and 3.9, <codeclass="docutils literal notranslate"><spanclass="pre">mayapy</span></code> (Python interpreter shipped with Maya) shipped with Maya.
Supported Maya versions are 2022 and 2023.</p>
<p>Note: Maya 2022 is bundled with Python 3.7, Maya 2023 is bundled with Python 3.9.</p>
</section>
<sectionid="environment-setup">
<h2>Environment Setup<aclass="headerlink"href="#environment-setup"title="Permalink to this headline"></a></h2>
<p>In order to use MetaHuman DNA Calibration in your scripts, you need to:</p>
<ulclass="simple">
<li><p>have Python3 installed, see <spanclass="xref myst">note</span>,</p></li>
<li><p>add MetaHuman DNA Calibration location to <codeclass="docutils literal notranslate"><spanclass="pre">MAYA_MODULE_PATH</span></code> system variable (if you want to use MetaHuman DNA Calibration in Maya)</p></li>
</ul>
<p>If you plan to run the script from command line:</p>
<ulclass="simple">
<li><p>in case of Maya’s interpreter (mayapy) you will have to initialize maya with:</p></li>
If running on Linux, please make sure to append the LD_LIBRARY_PATH with absolute path to the <codeclass="docutils literal notranslate"><spanclass="pre">lib/Maya2022/linux</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">lib/Maya2023/linux</span></code> directory before running the example:</p>
<p>DNAViewer can be used in <codeclass="docutils literal notranslate"><spanclass="pre">mayapy</span></code> (Python interpreter shipped with Maya) or in Maya 2022, except <aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dna_viewer_grab_changes_from_scene_and_propagate_to_dna.py">Propagating changes from Maya scene to dna</a> which can be used just in Maya.</p>
<h1>Examples<aclass="headerlink"href="#examples"title="Permalink to this headline"></a></h1>
<p>Several Python examples are provided for reference and can be found in the <strong>examples’</strong> folder:</p>
<ulclass="simple">
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dnacalib_demo.py">Showcase a few commands</a></p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dnacalib_rename_joint_demo.py">Rename a joint</a></p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dna_demo.py">Create a small DNA from scratch</a></p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dna_binary_to_json_demo.py">Read binary DNA and write it in a human readable format</a></p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dnacalib_lod_demo.py">Create a new DNA from an existing one by extracting specific LODs</a></p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dnacalib_remove_joint.py">Remove a joint</a></p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dna_viewer_run_in_maya.py">Simple UI in Maya</a> and some <spanclass="xref myst">documentation</span> for it</p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dna_viewer_export_fbx.py">Export FBX per LOD</a></p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples/dna_viewer_grab_changes_from_scene_and_propagate_to_dna.py">Propagating changes from Maya scene to dna</a></p></li>
<p>Note: Examples are grouped in three groups: DNA, DNACalib, and DNAViewer. These names are embedded as prefixes: dna_, dnacalib_, and dna_viewer_.</p>
<p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/data/dna_files">Two demo DNA files</a> are provided for easier testing of this tool. Any DNA generated with <aclass="reference external"href="https://www.unrealengine.com/en-US/metahuman">MetaHumanCreator</a>
<p>The MHC 2023 spring release introduced changes to the rig definition (number of joints increased as well as the number of expressions).
In order to accommodate those changes, we added several files to the repository in <codeclass="docutils literal notranslate"><spanclass="pre">/data/mh4</span></code> folder: new <spanclass="xref myst">gui scene</span>, updated <spanclass="xref myst">assemble script</span> and example of Ada’s <aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/data/mh4/dna_files/Ada.dna">DNA file</a>.
If a user wants to switch and use this new rig version it is necessary to update paths in their scripts:</p>
<p>In case character DNA is downloaded from <aclass="reference external"href="https://quixel.com/bridge">Quixel Bridge</a> and we are not sure which rig definition is used, it can be checked with following code:</p>
<h1>Notes<aclass="headerlink"href="#notes"title="Permalink to this headline"></a></h1>
<p>If a user runs examples in Maya 2022, the value for <codeclass="docutils literal notranslate"><spanclass="pre">ROOT_DIR</span></code> should be changed and absolute paths must be used,
e.g. <codeclass="docutils literal notranslate"><spanclass="pre">c:/MetaHuman-DNA-Calibration</span></code> in Windows or <codeclass="docutils literal notranslate"><spanclass="pre">/home/user/MetaHuman-DNA-Calibration</span></code> in Linux. Important: Use <codeclass="docutils literal notranslate"><spanclass="pre">/</span></code> (forward slash), Maya uses forward slashes in path.</p>