Skip to content

Commit 30aec07

Browse files
committed
release DNACalibration 1.2.0
1 parent dc377a7 commit 30aec07

16 files changed

+180981
-3582
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,47 @@ Several Python examples are provided for reference and can be found in the **exa
129129
Note: Examples are grouped in three groups: DNA, DNACalib, and DNAViewer. These names are embedded as prefixes: dna_, dnacalib_, and dna_viewer_.
130130

131131
## Example DNA files
132-
[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)
132+
[Two demo DNA files](data/dna_files) are provided for easier testing of this tool. Any DNA generated with [MetaHumanCreator](https://www.unrealengine.com/en-US/metahuman)
133133
should work.
134134

135+
The MHC 2023 spring release introduced changes to the rig definition (number of joints increased as well as the number of expressions).
136+
In order to accommodate those changes, we added several files to the repository in `/data/mh4` folder: new [gui scene](/data/mh4/gui.ma), updated [assemble script](/data/mh4/additional_assemble_script.py) and example of Ada’s [DNA file](data/mh4/dna_files/Ada.dna).
137+
If a user wants to switch and use this new rig version it is necessary to update paths in their scripts:
138+
```python
139+
GUI = f"{DATA_DIR}/mh4/gui.ma"
140+
ADDITIONAL_ASSEMBLE_SCRIPT = f"{DATA_DIR}/mh4/additional_assemble_script.py"
141+
```
142+
143+
In case character DNA is downloaded from [Quixel Bridge](https://quixel.com/bridge) and we are not sure which rig definition is used, it can be checked with following code:
144+
```python
145+
from dna import (
146+
BinaryStreamReader,
147+
DataLayer_All,
148+
FileStream,
149+
Status,
150+
)
151+
152+
def load_dna_reader(dna_file):
153+
stream = FileStream(
154+
dna_file, FileStream.AccessMode_Read, FileStream.OpenMode_Binary
155+
)
156+
reader = BinaryStreamReader(stream, DataLayer_All)
157+
reader.read()
158+
if not Status.isOk():
159+
status = Status.get()
160+
raise RuntimeError(f"Error loading DNA: {status.message}")
161+
return reader
162+
163+
character_dna = "path_to/character.dna"
164+
reader = load_dna_reader(character_dna)
165+
if reader.getDBName() == "MH.4":
166+
print("Use mh4 folder")
167+
elif reader.getDBName() == "DHI":
168+
print("Use data folder")
169+
else:
170+
print("Unsupported rig definition!")
171+
```
172+
135173
# Notes
136174
If a user runs examples in Maya 2022, the value for `ROOT_DIR` should be changed and absolute paths must be used,
137175
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.

0 commit comments

Comments
 (0)