Add the fused hand prototype (hand_l_proto/hand_r_proto) and record the finger-articulation decision
This commit is contained in:
1 parent
44dba010a7
commit
58d1e79a12
5 files changed
+47
-5
No files matched your search
@@ -1007,6 +1007,32 @@ def _hands_and_shoes(mats, spec):
|
||||
return parts
|
||||
|
||||
|
||||
def _hand_proto(mats, spec, side=-1.0):
|
||||
"""Connected hand: palm, four fingers and a thumb fused into one mesh.
|
||||
|
||||
The shipped hand is separate primitive parts that read as a mitten at
|
||||
conversation distance; fusing the finger bases into the palm gives a
|
||||
connected hand with readable finger separation. `side` is −1 (left, x<0)
|
||||
or +1 (right, x>0).
|
||||
"""
|
||||
hs = _hands_and_shoes(mats, spec)
|
||||
|
||||
def _cx(o):
|
||||
xs = [v.co.x for v in o.data.vertices]
|
||||
return (min(xs) + max(xs)) / 2
|
||||
|
||||
hand = [o for o in hs
|
||||
if o.name.startswith(("Palm", "Finger", "Fingertip", "Thumb", "ThumbTip"))
|
||||
and (_cx(o) < 0 if side < 0 else _cx(o) > 0)]
|
||||
obj = join(hand, "HandL" if side < 0 else "HandR")
|
||||
bm = bmesh.new()
|
||||
bm.from_mesh(obj.data)
|
||||
bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.006)
|
||||
bm.to_mesh(obj.data)
|
||||
bm.free()
|
||||
return obj
|
||||
|
||||
|
||||
def _clothing(spec, mats):
|
||||
layer = spec["layer"]
|
||||
cloth = mats["cloth"]
|
||||
|
||||
Reference in new issue
Block a user