This commit is contained in:
Nicholas Butzke
2026-08-02 02:20:02 -04:00
parent 61669627db
commit 922983429e
226 changed files with 34032 additions and 18521 deletions
+8
View File
@@ -130,6 +130,7 @@ static func update(skeleton: Skeleton3D, driven: Array) -> void:
static func _reweight(mi: MeshInstance3D, skeleton: Skeleton3D,
joint_helpers: Dictionary, chain_l: PackedVector3Array,
chain_r: PackedVector3Array, limb_radius: float) -> void:
var safe_bounds := mi.mesh.get_aabb()
var skin: Skin = mi.skin
var bone_of := {}
for b in skin.get_bind_count():
@@ -179,6 +180,13 @@ static func _reweight(mi: MeshInstance3D, skeleton: Skeleton3D,
rebuilt.surface_set_material(i, e["material"])
if e["name"] != "":
rebuilt.surface_set_name(i, e["name"])
# Preserve an explicit conservative bound across this second mesh rebuild.
# See SkinLegRepair: sparse runtime Skin binds can otherwise produce more
# bone AABBs than the renderer skeleton contains.
var padding := Vector3.ONE * maxf(safe_bounds.size.length() * 0.12, 0.25)
safe_bounds.position -= padding
safe_bounds.size += padding * 2.0
rebuilt.custom_aabb = safe_bounds
mi.mesh = rebuilt