Fix the wrist/hand detachment: wrist tracks the hand bone, sleeve cuff follows the hand, hand raised to meet the wrist
This commit is contained in:
1 parent
c1ccfd6e72
commit
36576a023a
26 files changed
+45
-37
No files matched your search
+21
-13
@@ -566,7 +566,7 @@ def _skin_body(spec):
|
||||
((0.20 * s * w, 0, 1.37), 0.080 * t * sleeve, 0.074 * t * sleeve), # shoulder
|
||||
((0.27 * s * w, 0, 1.23), 0.058 * t * sleeve, 0.058 * t * sleeve), # upper arm
|
||||
((0.275 * s * w, 0.005, 1.06), 0.046 * t * sleeve, 0.048 * t * sleeve), # elbow
|
||||
((0.275 * s * w, -0.01, 0.80), 0.034 * t, 0.030 * t), # wrist
|
||||
((0.275 * s * w, -0.01, 0.78), 0.034 * t, 0.030 * t), # wrist
|
||||
]
|
||||
edges += [(3, base), (base, base + 1), (base + 1, base + 2), (base + 2, base + 3)]
|
||||
hb = len(nodes)
|
||||
@@ -666,9 +666,15 @@ def _auto_weights(obj, layout, rigid=None):
|
||||
groups[bone].add([v.index], 1.0, "REPLACE")
|
||||
continue
|
||||
if abs(p.x) > 0.19 and p.z > 0.74 and p.z < 1.42:
|
||||
allowed = ["Spine", f"Shoulder{side}", f"Elbow{side}", f"Hand{side}"]
|
||||
if abs(p.x) > 0.23:
|
||||
allowed.remove("Spine")
|
||||
if p.z < 0.82:
|
||||
# Wrist: track the Hand bone fully so the forearm-end moves with
|
||||
# the rigid hand (the old Hand+Elbow blend left a visible gap at
|
||||
# the wrist when the hand rotated).
|
||||
allowed = [f"Hand{side}"]
|
||||
else:
|
||||
allowed = ["Spine", f"Shoulder{side}", f"Elbow{side}", f"Hand{side}"]
|
||||
if abs(p.x) > 0.23:
|
||||
allowed.remove("Spine")
|
||||
elif p.z < 0.80:
|
||||
allowed = ["Hips", f"Hip{side}", f"Knee{side}"]
|
||||
if p.z < 0.66:
|
||||
@@ -848,26 +854,26 @@ def _hands_and_shoes(mats, spec):
|
||||
for s in (-1.0, 1.0):
|
||||
x = 0.275 * s * w
|
||||
# Wider and shallower than the old ball: a palm, not a wrist knob.
|
||||
parts.append(sphere("Palm", 0.046, (x, -0.012, 0.742), skin, seg=10, rings=6,
|
||||
parts.append(sphere("Palm", 0.046, (x, -0.012, 0.762), skin, seg=10, rings=6,
|
||||
scale=(0.80, 0.62, 0.88)))
|
||||
# Four bent, tapering fingers with rounded tips. The two segments keep
|
||||
# the hand readable at conversation distance without adding a full
|
||||
# finger skeleton; the outer fingers are slightly shorter.
|
||||
for index, offset in enumerate((-0.024, -0.008, 0.008, 0.024)):
|
||||
fx = x + offset * s
|
||||
tip_z = (0.692, 0.681, 0.684, 0.694)[index]
|
||||
tip_z = (0.712, 0.701, 0.704, 0.714)[index]
|
||||
radius = 0.0115 if index in (1, 2) else 0.0105
|
||||
parts.append(tube("Finger", [(fx, -0.018, 0.758),
|
||||
(fx, -0.030, 0.726),
|
||||
parts.append(tube("Finger", [(fx, -0.018, 0.778),
|
||||
(fx, -0.030, 0.746),
|
||||
(fx, -0.042, tip_z)],
|
||||
radius, skin, seg=6, caps=False))
|
||||
parts.append(sphere("Fingertip", radius, (fx, -0.042, tip_z), skin,
|
||||
seg=6, rings=4))
|
||||
parts.append(tube("Thumb", [(x - 0.010 * s, -0.018, 0.758),
|
||||
(x - 0.028 * s, -0.040, 0.740),
|
||||
(x - 0.034 * s, -0.055, 0.718)],
|
||||
parts.append(tube("Thumb", [(x - 0.010 * s, -0.018, 0.778),
|
||||
(x - 0.028 * s, -0.040, 0.760),
|
||||
(x - 0.034 * s, -0.055, 0.738)],
|
||||
0.012, skin, seg=6, caps=False))
|
||||
parts.append(sphere("ThumbTip", 0.012, (x - 0.034 * s, -0.055, 0.718), skin,
|
||||
parts.append(sphere("ThumbTip", 0.012, (x - 0.034 * s, -0.055, 0.738), skin,
|
||||
seg=6, rings=4))
|
||||
parts.append(box("Shoe", (0.10, 0.25, 0.075), (0.12 * s, -0.045, 0.04), shoe,
|
||||
bevel=0.028, segs=1))
|
||||
@@ -1012,7 +1018,9 @@ def build_character(name):
|
||||
return "Head" if p.z > 1.55 else "Neck"
|
||||
side = "L" if p.x < 0 else "R"
|
||||
if abs(p.x) > 0.26 and p.z > 0.8:
|
||||
return f"Elbow{side}"
|
||||
# Sleeve: the cuff follows the hand, the upper sleeve the elbow,
|
||||
# so the sleeve does not separate from the hand at the wrist.
|
||||
return f"Hand{side}" if p.z < 1.06 else f"Elbow{side}"
|
||||
if p.z < 0.25:
|
||||
return f"Knee{side}"
|
||||
return None
|
||||
|
||||
Reference in new issue
Block a user