Summary
Hello,
I’m getting a decoding error when loading a DNA file into the new Expression Editor.
Please select what you are reporting on:
Creative
What Type of Bug are you experiencing?
Assets
Steps to Reproduce
Open the Expression Editor
Load DNA file
Expected Result
DNA file to load without error.
Observed Result
# Traceback (most recent call last):
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\mh_expression_editor\1.9.7\mh_expression_editor\window.py", line 1411, in on_load_btn_clicked
# **self.config["pruning_threshold"],
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\frt_api\2.1.0\frt_api\publisher.py", line 62, in wrapper
# raise e
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\frt_api\2.1.0\frt_api\publisher.py", line 57, in wrapper
# result = func(*args, **kwargs)
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\frt_api\2.1.0\frt_api\core.py", line 18, in inner_wrapper
# res = func(*args, **kwargs)
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\frt_api\2.1.0\frt_api\rig\rig.py", line 204, in __init__
# self.rig_definition, self.rdf_reader = get_rig_definition(binary_rig_definition_file_path)
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\frt_api\2.1.0\frt_api\model\rdf\mapper.py", line 19, in get_rig_definition
# reader.read()
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\rdf_model\0.20.0\rdf_model\file\reader.py", line 155, in read
# self._open_reader()
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\rdf_model\0.20.0\rdf_model\file\reader.py", line 137, in _open_reader
# ver = read_fileformat_version(self._rdf_path)
# File "C:\Program Files\Epic Games\MetaHumanForMaya\lib\rdf_model\0.20.0\rdf_model\file\reader.py", line 752, in read_fileformat_version
# header = f.read(7)
# File "C:/Program Files/Autodesk/Maya2022\Python37\lib\codecs.py", line 322, in decode
# (result, consumed) = self._buffer_decode(data, self.errors, final)
# UnicodeDecodeError: 'CP_UTF8' codec can't decode byte 0xae in position 34: No mapping for the Unicode character exists in the target code page.
Platform(s)
Windows
Additional Notes
Changing the open command as follows seems to fix the error.
with open(filepath, "rb") as f:
header = f.read(7)
header = header.decode("ascii")
A colleague pointed out you can also use the RDF_SKIP_VERSION_CHECK environment variable if you don’t want to edit the code.