From eccb12f645fcf0e00c62abf631b5e2c4d208be61 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 11 Jul 2022 17:27:07 +0900 Subject: [PATCH] fix ACCESSOR_TOTAL_OFFSET_ALIGNMENT --- Assets/VRM10/Runtime/Migration/MeshUpdater.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/VRM10/Runtime/Migration/MeshUpdater.cs b/Assets/VRM10/Runtime/Migration/MeshUpdater.cs index 1ca4c8d10..ade421550 100644 --- a/Assets/VRM10/Runtime/Migration/MeshUpdater.cs +++ b/Assets/VRM10/Runtime/Migration/MeshUpdater.cs @@ -46,6 +46,12 @@ namespace UniVRM10 var bufferView = _buffer.Extend(bytes); var index = _bufferViews.Count; _bufferViews.Add(bufferView); + var mod = bytes.Length % 4; + if (mod != 0) + { + // padding for 4byte alignment + _buffer.Extend(new ArraySegment(new byte[4 - mod])); + } return index; }