From 12826a7840f71668a1d438442a54f8c796f46bf3 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Mon, 1 Feb 2021 13:29:00 +0100 Subject: [PATCH] Strip unneeded zero weights --- b3d.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/b3d.lua b/b3d.lua index be195bf..5a89a7c 100644 --- a/b3d.lua +++ b/b3d.lua @@ -193,7 +193,11 @@ function read(stream) while content() do local vertex_id = id() assert(not bone[vertex_id], "duplicate vertex weight") - bone[vertex_id] = float() + local weight = float() + if weight > 0 then + -- Many exporters include unneeded zero weights + bone[vertex_id] = weight + end end return bone end,