I should also mention BabylonJS runs inside of a HTML browser using WebGL. WebGL 1.0 is based on the very old OpenGL 2.0, which greatly limits how much uniform data can be passed to a vertex shader. This in turn limits the # of bones on implementations that do not exceed the minimums (all the mobile platforms). WebGL 2.0 spec is close to done, but that could still take long for adoption.
My thought was to create a rig much like the Game rig, but also have the IK bones. I also want to replace the fingers with shape keys. You could probably have 1 key per finger & 2 per thumb. I also do not need the Jaw bone. Exporting facial shape keys instead for speech / expressions.
I changed some of the pre-existing mergers within rig_merge.py and created this 33 bone skeleton (22 ignoring IK bones, in orange)
This could also be done with separate mergers listed below:
- Code: Select all
WristMergers = {
"hand.L" : ("hand.L",
("palm_index.L", "palm_middle.L", "palm_ring.L", "palm_pinky.L",
"thumb.01.L", "thumb.02.L", "thumb.03.L",
"f_index.01.L", "f_index.02.L", "f_index.03.L",
"f_middle.01.L", "f_middle.02.L", "f_middle.03.L",
"f_ring.01.L", "f_ring.02.L", "f_ring.03.L",
"f_pinky.01.L", "f_pinky.02.L", "f_pinky.03.L")),
"hand.R" : ("hand.R",
("palm_index.R", "palm_middle.R", "palm_ring.R", "palm_pinky.R",
"thumb.01.R", "thumb.02.R", "thumb.03.R",
"f_index.01.R", "f_index.02.R", "f_index.03.R",
"f_middle.01.R", "f_middle.02.R", "f_middle.03.R",
"f_ring.01.R", "f_ring.02.R", "f_ring.03.R",
"f_pinky.01.R", "f_pinky.02.R", "f_pinky.03.R")),
}
HipMergersIK = {
"hips" : ("hips", (
"hips", "pelvis.L", "pelvis.R", "DEF-hip.L", "DEF-hip.R",
"DEF-gluteus.L", "DEF-gluteus.R"
))
}
ShoulderMergersIK = {
"chest" : ("chest", (
"DEF-serratus.L", "DEF-serratus.R",
"DEF-pect.L", "DEF-pect.R",
)),
"chest-1" : ("chest-1", (
"chest-1", "DEF-sternum",
"DEF-scapula.L", "scapAim.L",
"DEF-scapula.R", "scapAim.R",
)),
"clavicle.L" : ("clavicle.L", (
"clavicle.L", "DEF-clav-0.L", "DEF-clav-1.L", "DEF-clav-2.L", "DEF-clav-3.L", "DEF-clav-4.L", "DEF-deltoid-1.L",
"shoulder01.L", "scap-parent.L",
)),
"upper_arm.L" : ("upper_arm.L", (
"upper_arm.L", "DEF-deltoid-2.L"
)),
"clavicle.R" : ("clavicle.R", (
"clavicle.R", "DEF-clav-0.R", "DEF-clav-1.R", "DEF-clav-2.R", "DEF-clav-3.R", "DEF-clav-4.R", "DEF-deltoid-1.R",
"shoulder01.R", "scap-parent.R",
)),
"upper_arm.R" : ("upper_arm.R", (
"upper_arm.R", "DEF-deltoid-2.R"
)),
}
HeadJawMergers = {
"head" : ("head", ("head", "lolid.L", "lolid.R", "uplid.L", "uplid.R","jaw", "tongue_base", "tongue_mid", "tongue_tip")),
}
Some small work is probably required to get mergers with these names to run, not including the rig's JSON file. I also do not know if changes neededto the rig to make the IK usable could be put in the script. I do not really need the switching mechanism in the runtime tab.
Finally, I do not know how much of the finger shape keys can be done in the script. I see that vertex groups of bones present are included. Could it be possible to at least have an option to include all vertex groups regardless of whether created? Or explain how the face shape keys data was made.