From 05e62dec1099f5d321d8ded3b20ab3b66eac12db Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Tue, 28 Feb 2023 00:21:15 +0100 Subject: [PATCH] b3d -> glTF: Add base64 padding --- b3d.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/b3d.lua b/b3d.lua index ced2a31..08bbf1e 100644 --- a/b3d.lua +++ b/b3d.lua @@ -989,6 +989,7 @@ do end local buffer_string = table.concat(buffer_rope) + local base64 = assert(minetest.encode_base64, "b3d:to_gltf needs `minetest.encode_base64`!")(buffer_string) return { asset = { generator = "modlib b3d:to_gltf", @@ -1004,7 +1005,7 @@ do { byteLength = #buffer_string, uri = "data:application/octet-stream;base64," - .. assert(minetest.encode_base64, "b3d:to_gltf needs `minetest.encode_base64`!")(buffer_string) + .. base64 .. ("="):rep(#base64 % 4) -- Blender requires base64 padding }, }, -- Meshes & nodes