Skip to content

Commit

Permalink
release DNACalibration 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smilicev committed Apr 21, 2023
1 parent 5d19123 commit dc377a7
Show file tree
Hide file tree
Showing 190 changed files with 15,275 additions and 8,656 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*.dylib

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Change Log

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.0] - 2023-04-20

### Added
- support for Maya 2023
- support for Python 3.9
- `RenameAnimatedMapCommand` class to DNACalib API. Command to remove animated maps.
- `RemoveBlendShapeCommand` class to DNACalib API. Command to remove blend shapes.
- `DNA` class to DNAViewer API. This class is used for accessing data in DNA file.
- `rig_build` method to DNAViewer API. Method used for creating maya scene with functional rig. Replacement of method `assemble_rig`.
- `Config` class to DNAViewer API. Configuration class used for `build_meshes`.
- `RigConfig` class to DNAViewer API. Configuration class used for `rig_build`.
- documentation for DNA library.

### Fixed
- `ClearBlendShapesCommand` blend shape channel LODs were not correctly set.
- `RotateCommand` to rotate blend shape target deltas as well.
- `SetBlendShapeTargetDeltasCommand` to allow setting vertex indices as well.

### Changed
- changed signature of `build_meshes`. Method used for creating maya scene with meshes.
- Simplification of additional assemble script.
- option to pass list of indices to remove in remove commands.

### Removed
- removed method `assemble_rig` from DNAViewer API.
66 changes: 59 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 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](https://www.unrealengine.com/en-US/metahuman) identity.
[`DNA`](/docs/dna.md#metahuman-dna) is an integral part of [MetaHuman](https://www.unrealengine.com/en-US/metahuman) identity.
DNA files are created with [MetaHuman Creator](https://metahuman.unrealengine.com/) and downloaded with
[Quixel Bridge](https://docs.metahuman.unrealengine.com/en-US/downloading-metahumans-with-quixel-bridge/).
[Quixel Bridge](https://docs.metahuman.unrealengine.com/en-US/downloading-metahumans-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.
Expand Down Expand Up @@ -35,9 +35,12 @@ To use these tools, you should be familiar with:
- Prune blendshapes.
- Remove all blend shape data.

An overview of the MetaHuman DNA file format can be found [`here`](/docs/dna.md).

**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. Pre-compiled binaries for Windows and Linux (both 64-bit) are part of the repository.
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.

Expand All @@ -52,37 +55,86 @@ 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, `mayapy` (Maya's Python interpreter), or Maya 2022.
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](README.md#external-software-dependencies),
- 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:

```python
import maya.standalone
maya.standalone.initialize()
```

- in case of python interpreter you will have to add the following on top of your script:
```python
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` (Maya's Python interpreter) or in Maya 2022, except [Propagating changes from Maya scene to dna](/examples/dna_viewer_grab_changes_from_scene_and_propagate_to_dna.py) which can be used just in Maya.
DNAViewer can be used in `mayapy` (Python interpreter shipped with Maya) or in Maya 2022, except [Propagating changes from Maya scene to dna](/examples/dna_viewer_grab_changes_from_scene_and_propagate_to_dna.py) which can be used just in Maya.

# Examples
Several Python examples are provided for reference and can be found in the **examples'** folder:
- [Showcase a few commands](/examples/dnacalib_demo.py)
- [Rename a joint](/examples/dnacalib_rename_joint_demo.py)
- [Create a small DNA from scratch](/examples/dna_demo.py)
- [Read binary DNA and write it in a human readable format](/examples/dna_binary_to_json_demo.py)
- [Create a new DNA from an existing one by extracting specific LODs](/examples/dnacalib_lod_demo.py)
- [Remove a joint](/examples/dnacalib_remove_joint.py)
- [Clear blend shape data](/examples/dnacalib_clear_blend_shapes.py)
- [Subtract values from neutral mesh](/examples/dnacalib_neutral_mesh_subtract.py)
- [Simple UI in Maya](examples/dna_viewer_run_in_maya.py) and some [documentation](docs/dna_viewer.md#usage-in-maya) for it
- [Generate rig and export FBX per LOD](examples/dna_viewer_demo.py)
- [Generates rig](/examples/dna_viewer_build_rig.py)
- [Export FBX per LOD](/examples/dna_viewer_export_fbx.py)
- [Propagating changes from Maya scene to dna](/examples/dna_viewer_grab_changes_from_scene_and_propagate_to_dna.py)

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](data/dna) are provided for easier testing of this tool. Any DNA generated with [MetaHumanCreator](https://www.unrealengine.com/en-US/metahuman)
should work.

# Notes
If a user runs examples in Maya 2022, the value for `ROOT_DIR` should be changed and absolute paths must be used,
eg. `c:/dna_calibration` in Windows or `/home/user/dna_calibration` in Linux. Important: Use `/` (forward slash), Maya uses forward slashes in path.
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](docs/faq.md) for additional specifications.

Expand Down
Loading

0 comments on commit dc377a7

Please sign in to comment.