Skip to content

Commit

Permalink
feat: support legacy UniVRM editor import
Browse files Browse the repository at this point in the history
  • Loading branch information
saturday06 committed Oct 25, 2023
1 parent 8dc9f38 commit 5c0afa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion io_scene_vrm/common/gltf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def pack_glb(
json_dict: dict[str, Json], binary_chunk: Union[bytes, bytearray]
) -> bytes:
magic = b"glTF" + struct.pack("<I", 2)
json_str = json.dumps(json_dict).encode("utf-8")
json_str = json.dumps(
json_dict,
ensure_ascii=False, # UniVRM 0.56.3はエディタインポート時のUnicodeエスケープに未対応
).encode("utf-8")
if len(json_str) % 4 != 0:
json_str += b"\x20" * (4 - len(json_str) % 4)
json_size = struct.pack("<I", len(json_str))
Expand Down

0 comments on commit 5c0afa7

Please sign in to comment.