<h1>DNACalib<aclass="headerlink"href="#dnacalib"title="Permalink to this headline"></a></h1>
<p>This library is used for performing modifications on a DNA file.
It is written in C++ and there is also a Python wrapper for it. <aclass="reference external"href="https://www.swig.org/">SWIG</a> library is used for generating
bindings for Python. DNACalib can be used in command line, or in Maya.
Binaries for Windows and Linux are provided. <strong>If you are using a different architecture and/or platform, you must build DNACalib.</strong></p>
<sectionid="dnacalib-folder-structure">
<h2>DNACalib folder structure<aclass="headerlink"href="#dnacalib-folder-structure"title="Permalink to this headline"></a></h2>
<ulclass="simple">
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/dnacalib/DNACalib"><codeclass="docutils literal notranslate"><spanclass="pre">DNACalib</span></code></a> - Contains C++ source code of DNACalib and its dependencies. There is a library for
reading and writing DNA files, along with a few other utility libraries.</p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/dnacalib/PyDNACalib"><codeclass="docutils literal notranslate"><spanclass="pre">PyDNACalib</span></code></a> - Contains the source code for generating the Python wrapper for DNACalib.</p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/dnacalib/PyDNA"><codeclass="docutils literal notranslate"><spanclass="pre">PyDNA</span></code></a> - Contains the source code for generating the Python wrapper for DNA library, that is under
DNACalib folder containing C++ source code.</p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/dnacalib/SPyUS"><codeclass="docutils literal notranslate"><spanclass="pre">SPyUS</span></code></a> - Contains some common SWIG interface files used by both PyDNACalib and PyDNA.</p></li>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/dnacalib/CMakeModulesExtra"><codeclass="docutils literal notranslate"><spanclass="pre">CMakeModulesExtra</span></code></a> - Contains some common CMake functions that are used throughout the
project, both in C++ and the Python wrapper.</p></li>
</ul>
</section>
<sectionid="usage">
<h2>Usage<aclass="headerlink"href="#usage"title="Permalink to this headline"></a></h2>
<p>For example, to change rotation values of neutral joints, use the
<p>Below is an example that reads DNA, changes rotation values of all neutral joints to <codeclass="docutils literal notranslate"><spanclass="pre">{1,</span><spanclass="pre">2,</span><spanclass="pre">3}</span></code>, and overwrites the DNA
auto writer = dnac::makeScoped<dnac::BinaryStreamWriter>(inOutStream.get());
writer->setFrom(dnaReader.get());
writer->write();
// Check if an error occurred while writing DNA file
if (!dnac::Status::isOk()) {
// handle writer error
}
</pre></div>
</div>
</section>
<sectionid="examples">
<h2>Examples<aclass="headerlink"href="#examples"title="Permalink to this headline"></a></h2>
<sectionid="c">
<h3>C++<aclass="headerlink"href="#c"title="Permalink to this headline"></a></h3>
<p>Examples of C++ library usage can be found <aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/dnacalib/DNACalib/examples">here</a>.</p>
<li><p><aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/dnacalib/DNACalib/examples/SingleCommand.cpp">Rename a blendshape</a></p></li>
</ul>
</section>
<sectionid="python">
<h3>Python<aclass="headerlink"href="#python"title="Permalink to this headline"></a></h3>
<p>Examples of using the library from Python are <aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/examples">here</a>.</p>
<p>These are:</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/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/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_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/dnacalib_neutral_mesh_subtract.py">Subtract values from neutral mesh</a></p></li>
</ul>
</section>
</section>
<sectionid="build">
<h2>Build<aclass="headerlink"href="#build"title="Permalink to this headline"></a></h2>
<p>Prebuilt binaries for 64-bit Windows and Linux are <aclass="reference external"href="https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/lib">provided</a>.
If you are using a different architecture and/or platform, you must build DNACalib.</p>
<p>Prerequisites:</p>
<ulclass="simple">
<li><p><aclass="reference external"href="https://cmake.org/download/">CMake</a> at least version 3.14</p></li>
<li><p><aclass="reference external"href="https://www.swig.org/download.html">SWIG</a> at least version 4.0.0</p></li>
<li><p><aclass="reference external"href="https://www.python.org/downloads/">Python</a> To specify the exact version of python3 to use, set the CMake variable
<codeclass="docutils literal notranslate"><spanclass="pre">PYTHON3_EXACT_VERSION</span></code>. For example, to use the lib from Maya 2022, use version 3.7. For Maya 2023, use version 3.9.</p></li>