Other

项目介绍

EpicGames/MetaHuman-DNA-Calibration 是一个托管在 GitHub 上的开源项目,主要使用 Mathematica 编写,采用 Other 许可证,目前获得 627 个 Star、197 次 Fork。

仓库全名
EpicGames/MetaHuman-DNA-Calibration
开源许可证
Other
Star 数
627
Fork 数
197
未关闭 Issue
36

README 摘要

Important Note This repository has not been updated to support MetaHuman characters created in MetaHuman Creator in Unreal Engine 5.6. Characters created in Unreal Engine 5.6 should be edited using the new MetaHuman for Maya plugin, available for download on Fab. This repository remains compatible with characters created in Unreal Engine 5.5 or earlier. MetaHuman DNA Calibration MetaHuman DNA Calibration is a set of…

完整内容见 GitHub 原始 README 或本页 。

常见问题

MetaHuman-DNA-Calibration 用什么语言开发?

主要使用 Mathematica 编写,采用 Other 许可证,目前有 627 个 Star。

MetaHuman-DNA-Calibration 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 MetaHuman-DNA-Calibration 的源码?

可以直接克隆仓库:git clone https://github.com/EpicGames/MetaHuman-DNA-Calibration.git,默认分支为 main;安装与运行步骤见仓库 README。

MetaHuman-DNA-Calibration 最近还在维护吗?

仓库最近一次更新为 2025年6月20日,当前有 36 个未关闭 Issue;Star 数为 627,可作为社区活跃度的参考。

简要分析

热度分
1067
价值分
438
活跃状态
活跃
暂无主题

语言占比

AMPL
C
C++
CMake
CSS
HLSL
Mathematica
Python
SWIG

Release

README

Important Note

This repository has not been updated to support MetaHuman characters created in MetaHuman Creator in Unreal Engine 5.6. Characters created in Unreal Engine 5.6 should be edited using the new MetaHuman for Maya plugin, available for download on Fab. This repository remains compatible with characters created in Unreal Engine 5.5 or earlier.

MetaHuman DNA Calibration

MetaHuman DNA Calibration is a set of tools used for working with MetaHuman DNA files, bundled into a single package. DNA is an integral part of MetaHuman identity. DNA files are created with MetaHuman Creator and downloaded with Quixel Bridge, and Bifrost in UE5.

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.

Overview

For an explanation about how the repository is organized, click here.

The MetaHuman DNA Calibration repository contains two distinct tools:

Required Knowledge

To use these tools, you should be familiar with:

  • Rigging in Maya
  • Python

Optional Knowledge

DNACalib

DNACalib and its API are used to inspect and modify DNA files. With DNACalib, you can make the following changes in DNA files:

  • Rename joints, meshes, blendshapes, and / or animated maps.
  • Remove joints, meshes, and / or joint animation.
  • Rotate, scale, and translate the rig.
  • Remove LODs.
  • Change neutral joint positions, neutral mesh positions, and blendshape delta values.
  • Prune blendshapes.
  • Remove all blend shape data.

An overview of the MetaHuman DNA file format can be found here.

Note: 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.

External Software Dependencies

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. If you are using a different version of Python, you must recompile it. Any Python 3 version should be fine. If a user has a different platform or architecture, the library and its dependencies must be compiled.

Important DNA files are stored as LFS (Large File Storage) 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.

Additional information can be found here

Warning: Python 2 is not supported.

DNACalib can be used in C++ projects as a C++ library.

DNACalib Python wrapper can be used in Python 3.7 and 3.9, mayapy (Python interpreter shipped with Maya) shipped with Maya. Supported Maya versions are 2022 and 2023.

Note: Maya 2022 is bundled with Python 3.7, Maya 2023 is bundled with Python 3.9.

Environment Setup

In order to use MetaHuman DNA Calibration in your scripts, you need to:

  • have Python3 installed, see note,
  • add MetaHuman DNA Calibration location to MAYA_MODULE_PATH system variable (if you want to use MetaHuman DNA Calibration in Maya)

If you plan to run the script from command line:

  • in case of Maya’s interpreter (mayapy) you will have to initialize maya with:
import maya.standalone 
maya.standalone.initialize()
  • in case of python interpreter you will have to add the following on top of your script:
from os import path as ospath
from sys import path as syspath
from sys import platform

ROOT_DIR = f"{ospath.dirname(ospath.abspath(__file__))}/..".replace("\\", "/")
MAYA_VERSION = "2022"  # or 2023
ROOT_LIB_DIR = f"{ROOT_DIR}/lib/Maya{MAYA_VERSION}"
if platform == "win32":
    LIB_DIR = f"{ROOT_LIB_DIR}/windows"
elif platform == "linux":
    LIB_DIR = f"{ROOT_LIB_DIR}/linux"
else:
    raise OSError(
        "OS not supported, please compile dependencies and add value to LIB_DIR"
    )

# Adds directories to path
syspath.insert(0, ROOT_DIR)
syspath.insert(0, LIB_DIR)

NOTE: If running on Linux, please make sure to append the LD_LIBRARY_PATH with absolute path to the lib/Maya2022/linux or lib/Maya2023/linux directory before running the example:

  • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path-to-lib-linux-dir>

DNAViewer

With DNAViewer, you can:

  • Create functional rigs for Maya.
  • Export FBX files.
  • Read internal parts of DNA files.

DNAViewer can be used in mayapy (Python interpreter shipped with Maya) or in Maya 2022, except Propagating changes from Maya scene to dna which can be used just in Maya.

Examples

Several Python examples are provided for reference and can be found in the examples’ folder:

Note: Examples are grouped in three groups: DNA, DNACalib, and DNAViewer. These names are embedded as prefixes: dna_, dnacalib_, and dna_viewer_.

Example DNA files

Two demo DNA files are provided for easier testing of this tool. Any DNA generated with MetaHumanCreator should work.

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 /data/mh4 folder: new gui scene, updated assemble script and example of Ada’s DNA file. If a user wants to switch and use this new rig version it is necessary to update paths in their scripts:

GUI = f"{DATA_DIR}/mh4/gui.ma"
ADDITIONAL_ASSEMBLE_SCRIPT = f"{DATA_DIR}/mh4/additional_assemble_script.py"

In case character DNA is downloaded from Quixel Bridge and we are not sure which rig definition is used, it can be checked with following code:

from dna import (
    BinaryStreamReader,
    DataLayer_All,
    FileStream,
    Status,
)

def load_dna_reader(dna_file):
    stream = FileStream(
        dna_file, FileStream.AccessMode_Read, FileStream.OpenMode_Binary
    )
    reader = BinaryStreamReader(stream, DataLayer_All)
    reader.read()
    if not Status.isOk():
        status = Status.get()
        raise RuntimeError(f"Error loading DNA: {status.message}")
    return reader

character_dna = "path_to/character.dna"
reader = load_dna_reader(character_dna)
if reader.getDBName() == "MH.4":
  print("Use mh4 folder")
elif reader.getDBName() == "DHI":
  print("Use data folder")
else:
  print("Unsupported rig definition!")

Notes

If a user runs examples in Maya, the value for ROOT_DIR should be changed and absolute paths must be used, e.g. c:/MetaHuman-DNA-Calibration in Windows or /home/user/MetaHuman-DNA-Calibration in Linux. Important: Use / (forward slash), Maya uses forward slashes in path.

See the FAQ guide for additional specifications.

License

MetaHuman DNA Calibration is released with licence.

评论

暂无评论