Add the MakeHuman-head character head source (head=mh) with project eyes/brows/mouth and CC0 attribution
This commit is contained in:
1 parent
632ec16aaa
commit
cdd2e02564
5 files changed
+96
-10
No files matched your search
+10
-7
@@ -54,7 +54,7 @@ PROTOTYPE = "npc_casual" # canonical one-variant prototype
|
||||
# The four buildable parts. `head` is the bare head shell; `face` is the shell
|
||||
# plus nose/eyes/mouth/ears; `hand_l`/`hand_r` are the left/right hand geometry.
|
||||
PART_NAMES = ("head", "face", "hand_l", "hand_r", "head_proto",
|
||||
"hand_l_proto", "hand_r_proto")
|
||||
"hand_l_proto", "hand_r_proto", "head_mh")
|
||||
_HAND_PREFIXES = ("Palm", "Finger", "Fingertip", "Thumb", "ThumbTip")
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ def build_part(name, variant, out, subdiv=48):
|
||||
obj = ba._hand_proto(mats, spec, side=-1.0)
|
||||
elif name == "hand_r_proto":
|
||||
obj = ba._hand_proto(mats, spec, side=1.0)
|
||||
elif name == "head_mh":
|
||||
obj = ba.join(ba._makehuman_head(mats, spec), "head_mh")
|
||||
else:
|
||||
side = -1.0 if name == "hand_l" else 1.0
|
||||
hs = ba._hands_and_shoes(mats, spec)
|
||||
@@ -164,14 +166,15 @@ def extract_part(name, variant, out):
|
||||
return _extract_group(mesh, group, out)
|
||||
|
||||
|
||||
def assemble(variant, out, head_proto=False):
|
||||
def assemble(variant, out, head="face"):
|
||||
"""Assemble a variant (currently rebuilds the procedural character).
|
||||
|
||||
This proves the end-to-end wiring; once parts are approved, this swaps the
|
||||
new part GLBs in instead of calling ``build_character`` directly. Pass
|
||||
``head_proto=True`` to build with the connected-shell prototype head.
|
||||
``head="mh"`` or ``head="proto"`` to build with the MakeHuman or prototype
|
||||
head source.
|
||||
"""
|
||||
objs = ba.build_character(variant, head_proto=head_proto)
|
||||
objs = ba.build_character(variant, head=head)
|
||||
mesh = next(o for o in objs if o.type == "MESH")
|
||||
arm = next(o for o in objs if o.type == "ARMATURE")
|
||||
out = Path(out)
|
||||
@@ -279,8 +282,8 @@ def main(argv=None):
|
||||
asm = sub.add_parser("assemble")
|
||||
asm.add_argument("--variant", default=PROTOTYPE)
|
||||
asm.add_argument("--out", required=True)
|
||||
asm.add_argument("--head-proto", action="store_true",
|
||||
help="use the connected-shell prototype head")
|
||||
asm.add_argument("--head", default="face", choices=("face", "proto", "mh"),
|
||||
help="head source (face | proto | mh)")
|
||||
|
||||
insp = sub.add_parser("inspect")
|
||||
insp.add_argument("--file", required=True)
|
||||
@@ -316,7 +319,7 @@ def main(argv=None):
|
||||
extract_part(args.part, args.variant, args.out)
|
||||
print(f"extracted {args.part} -> {args.out}")
|
||||
elif args.cmd == "assemble":
|
||||
assemble(args.variant, args.out, head_proto=args.head_proto)
|
||||
assemble(args.variant, args.out, head=args.head)
|
||||
print(f"assembled {args.variant} -> {args.out}")
|
||||
elif args.cmd == "inspect":
|
||||
inspect(args.file)
|
||||
|
||||
Reference in new issue
Block a user