diff --git a/.claude/skills/character-pipeline/references/failure-modes.md b/.claude/skills/character-pipeline/references/failure-modes.md index b1a9323..e9b432c 100644 --- a/.claude/skills/character-pipeline/references/failure-modes.md +++ b/.claude/skills/character-pipeline/references/failure-modes.md @@ -134,9 +134,13 @@ faces the other way, the two compose to a character running backwards — and nothing anywhere measures the finished result. **Rule:** facing is measurable from the skeleton — the toes are forward of the -ankles, and the nose/head is forward of the spine. Assert it on the OUTPUT, after -every transform has been applied. A blanket constant like `facing_flip` is a -guess about the source that must be replaced by a measurement. +ankles. `flatten_and_scale()` now snaps that to Blender -Y, the convention the +runtime flip is built around, so every character leaves the pipeline pointing the +same way whatever the source did. Kiyoko was 180 degrees off and is now correct. + +Snap to the nearest QUARTER TURN, not to the measured angle: a rest pose with the +feet slightly splayed is not a character who is 7 degrees turned, and correcting +it as one puts a permanent yaw on the whole skeleton. --- @@ -174,9 +178,21 @@ against proportions like Taila's. A rig with different arm lengths, a different rest pose (A-pose vs T-pose) or a different bone roll will put the hands somewhere plausible for the maths and wrong for the eye. -**Rule:** the hold has measurable success criteria — the distance from each hand -bone to the grip point it was solved onto. Assert those, per character, rather -than judging by eye. +**The real cause turned out to be #2's sibling, and it affected every model.** +`set_weapon` mounted the gun with a fixed `rotation_degrees = (0, 90, -90)`. A +bone attachment is expressed in the BONE's axes, and no two rigs agree on those, +so a constant there mounts the weapon differently on every character. + +It does not need to be right at all. The pose layer aims the gun by rotating the +WRIST until the weapon's forward axis lies on the aim line, so handing it the +IDENTITY means "the gun's forward is the hand bone's -Z" — true by construction +on any rig — and the wrist absorbs whatever roll that bone happens to have. The +grip is placed at the bone's origin, so the gun sits *in* the hand instead of at +a fixed offset from a differently-oriented bone. + +**Rule:** never express a mount as a constant in a bone's local frame. Either +derive the frame from the skeleton, or hand the downstream solver an identity and +let it do the work — it already knows where the gun must point. --- diff --git a/assets/characters/skins/aria.rig.json b/assets/characters/skins/aria.rig.json index c5a3300..4b1db15 100644 --- a/assets/characters/skins/aria.rig.json +++ b/assets/characters/skins/aria.rig.json @@ -9,20 +9,20 @@ "Neck", "Head" ], - "shoulder.L": "Left shoulder", "shoulder.R": "Right shoulder", - "foot.R": "Right ankle", + "shoulder.L": "Left shoulder", "foot.L": "Left ankle", - "hand.L": "Left wrist", + "foot.R": "Right ankle", "hand.R": "Right wrist", - "forearm.L": "Left elbow", + "hand.L": "Left wrist", "forearm.R": "Right elbow", - "shin.R": "Right knee", + "forearm.L": "Left elbow", "shin.L": "Left knee", + "shin.R": "Right knee", "toe.R": "Right toe", "toe.L": "Left toe", - "upper_arm.L": "Left arm", "upper_arm.R": "Right arm", + "upper_arm.L": "Left arm", "thigh.L": "Left leg", "thigh.R": "Right leg" }, diff --git a/assets/characters/skins/kiyoko.glb b/assets/characters/skins/kiyoko.glb index 68cbe01..a41e624 100644 Binary files a/assets/characters/skins/kiyoko.glb and b/assets/characters/skins/kiyoko.glb differ diff --git a/assets/characters/skins/kiyoko.rig.json b/assets/characters/skins/kiyoko.rig.json index 7c5a3b1..b40588d 100644 --- a/assets/characters/skins/kiyoko.rig.json +++ b/assets/characters/skins/kiyoko.rig.json @@ -15,16 +15,16 @@ "shin.L": "J_Bip_L_LowerLeg", "thigh.R": "J_Bip_R_UpperLeg", "thigh.L": "J_Bip_L_UpperLeg", - "shoulder.R": "J_Bip_R_Shoulder", "shoulder.L": "J_Bip_L_Shoulder", + "shoulder.R": "J_Bip_R_Shoulder", "forearm.R": "J_Bip_R_LowerArm", "forearm.L": "J_Bip_L_LowerArm", - "upper_arm.R": "J_Bip_R_UpperArm", "upper_arm.L": "J_Bip_L_UpperArm", + "upper_arm.R": "J_Bip_R_UpperArm", "toe.L": "J_Bip_L_ToeBase", "toe.R": "J_Bip_R_ToeBase", - "foot.R": "J_Bip_R_Foot", "foot.L": "J_Bip_L_Foot", + "foot.R": "J_Bip_R_Foot", "hand.L": "J_Bip_L_Hand", "hand.R": "J_Bip_R_Hand" }, @@ -550,7 +550,7 @@ ], [ -0.02312, - 0.02503, + 0.02504, 0.00687 ] ], @@ -1899,7 +1899,7 @@ 0.0013 ], [ - -0.01334, + -0.01333, 0.01982, -0.00015 ], diff --git a/assets/characters/skins/miku.glb b/assets/characters/skins/miku.glb index 53f5d81..8523280 100644 Binary files a/assets/characters/skins/miku.glb and b/assets/characters/skins/miku.glb differ diff --git a/assets/characters/skins/miku.rig.json b/assets/characters/skins/miku.rig.json index 51c16a7..9bf122b 100644 --- a/assets/characters/skins/miku.rig.json +++ b/assets/characters/skins/miku.rig.json @@ -10,1790 +10,24 @@ "DEF-neck", "DEF-head" ], - "hand.L": "DEF-hand.L", - "thigh.L": "DEF-thigh.L", - "thigh.R": "DEF-thigh.R", - "foot.L": "DEF-foot.L", - "upper_arm.L": "DEF-upper_arm.L", - "toe.R": "DEF-toe.R", - "toe.L": "DEF-toe.L", - "foot.R": "DEF-foot.R", - "upper_arm.R": "DEF-upper_arm.R", - "shin.R": "DEF-shin.R", "shoulder.R": "DEF-shoulder.R", "shoulder.L": "DEF-shoulder.L", - "hand.R": "DEF-hand.R", + "upper_arm.L": "DEF-upper_arm.L", + "upper_arm.R": "DEF-upper_arm.R", + "forearm.L": "DEF-forearm.L", "forearm.R": "DEF-forearm.R", + "thigh.R": "DEF-thigh.R", + "thigh.L": "DEF-thigh.L", + "foot.L": "DEF-foot.L", + "foot.R": "DEF-foot.R", "shin.L": "DEF-shin.L", - "forearm.L": "DEF-forearm.L" + "shin.R": "DEF-shin.R", + "hand.L": "DEF-hand.L", + "hand.R": "DEF-hand.R", + "toe.R": "DEF-toe.R", + "toe.L": "DEF-toe.L" }, - "chains": [ - { - "class": "hair", - "root_parent": "DEF-head", - "bones": [ - "DEF-hair.004", - "DEF-hair.004.seg1", - "DEF-hair.004.seg2" - ], - "tips": [ - [ - 0.0, - 0.11488, - -0.0 - ], - [ - 0.0, - 0.52061, - -0.0 - ], - [ - 0.00078, - 0.53789, - 0.02374 - ] - ], - "hulls": [ - [], - [ - [ - -0.08143, - 0.38272, - 0.0237 - ], - [ - 0.03426, - 0.21906, - -0.02815 - ], - [ - 0.05869, - 0.3851, - -0.03557 - ], - [ - -0.06617, - 0.22707, - 0.01893 - ], - [ - -0.01082, - 0.38781, - 0.01185 - ], - [ - -0.0172, - 0.22507, - 0.00437 - ] - ], - [ - [ - 0.06428, - 0.4061, - -0.0301 - ], - [ - -0.09033, - 0.13149, - 0.03616 - ], - [ - 0.08758, - 0.13894, - -0.03072 - ], - [ - -0.07202, - 0.39924, - 0.02431 - ], - [ - -0.00266, - 0.13484, - 0.03774 - ], - [ - 0.01549, - 0.40306, - 0.03382 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.004.seg1": 0.46886951680072686 - }, - { - "DEF-hair.004": 0.46886951680072686, - "DEF-hair.004.seg2": 0.6772610986254648 - }, - { - "DEF-hair.004.seg1": 0.6772610986254648 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-head", - "bones": [ - "DEF-hair.006", - "DEF-hair.006.seg1", - "DEF-hair.006.seg2" - ], - "tips": [ - [ - 0.0, - 0.02001, - 0.0 - ], - [ - 0.0, - 0.06655, - 0.0 - ], - [ - 0.00696, - 0.14742, - 0.01863 - ] - ], - "hulls": [ - [], - [ - [ - 0.00149, - 0.13945, - 0.01558 - ], - [ - 0.08355, - 0.02985, - -0.00247 - ], - [ - -0.05662, - 0.05134, - 0.02065 - ], - [ - 0.01711, - 0.03143, - 0.02301 - ], - [ - 0.04997, - 0.10124, - 0.03084 - ], - [ - -0.05233, - 0.11389, - 0.01029 - ], - [ - -0.00817, - 0.08421, - 0.03314 - ], - [ - 0.07234, - 0.05815, - 0.02038 - ], - [ - -0.07531, - 0.09487, - -0.00266 - ], - [ - 0.02116, - 0.09343, - 0.03856 - ] - ], - [ - [ - 0.08155, - 0.12413, - -0.05244 - ], - [ - -0.09422, - 0.03568, - 0.0069 - ], - [ - 0.05503, - 0.02521, - 0.05913 - ], - [ - -0.0862, - 0.11026, - -0.06485 - ], - [ - 0.08506, - 0.02327, - -0.05135 - ], - [ - -0.04198, - 0.08297, - 0.07005 - ], - [ - 0.07842, - 0.09153, - 0.03451 - ], - [ - 0.01647, - 0.08884, - 0.07662 - ], - [ - -0.09031, - 0.11647, - -0.01195 - ], - [ - -0.08667, - 0.06435, - -0.06479 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.006.seg1": 0.8066390103049459 - }, - { - "DEF-hair.006.seg2": 2.670369212863612, - "DEF-hair.006": 0.8066390103049459 - }, - { - "DEF-hair.006.seg1": 2.670369212863612 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-head", - "bones": [ - "DEF-hair.007", - "DEF-hair.007.seg1", - "DEF-hair.007.seg2" - ], - "tips": [ - [ - 0.0, - 0.03996, - -0.0 - ], - [ - 0.0, - 0.07962, - 0.0 - ], - [ - 0.01929, - 0.08613, - 0.01362 - ] - ], - "hulls": [ - [], - [ - [ - -0.00491, - 0.07916, - 0.07559 - ], - [ - -0.01765, - 0.06175, - -0.07444 - ], - [ - 0.01722, - 0.01808, - -0.0179 - ], - [ - 0.01941, - 0.02737, - 0.04366 - ], - [ - -0.01712, - 0.01595, - -0.05584 - ], - [ - 0.01296, - 0.05811, - -0.04058 - ], - [ - 0.02246, - 0.02669, - -0.05951 - ], - [ - 0.02696, - 0.07744, - 0.06152 - ], - [ - 0.00711, - 0.04111, - 0.07121 - ], - [ - 0.01974, - 0.00343, - -0.03804 - ] - ], - [ - [ - -0.02051, - 0.09075, - -0.05177 - ], - [ - 0.02831, - 0.01495, - 0.07289 - ], - [ - 0.04066, - 0.09145, - 0.02034 - ], - [ - -0.02461, - 0.01036, - -0.07647 - ], - [ - 0.00717, - 0.08625, - 0.06013 - ], - [ - 0.05012, - 0.03765, - 0.03758 - ], - [ - 0.05047, - 0.00497, - 0.04271 - ], - [ - -0.04302, - 0.03149, - -0.05967 - ], - [ - 0.02234, - 0.04694, - 0.07048 - ], - [ - -0.01446, - 0.01587, - -0.04816 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.007.seg1": 1.3265391012291756 - }, - { - "DEF-hair.007.seg2": 1.9591007162648184, - "DEF-hair.007": 1.3265391012291756 - }, - { - "DEF-hair.007.seg1": 1.9591007162648184 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-head", - "bones": [ - "DEF-hair.008", - "DEF-hair.008.seg1", - "DEF-hair.008.seg2" - ], - "tips": [ - [ - -0.0, - 0.03349, - 0.0 - ], - [ - 0.0, - 0.0869, - -0.0 - ], - [ - 0.01255, - 0.08246, - 0.00145 - ] - ], - "hulls": [ - [], - [ - [ - 0.0175, - 0.06896, - -0.03397 - ], - [ - -0.00396, - 0.00871, - 0.01948 - ], - [ - -0.00539, - 0.06022, - 0.03459 - ], - [ - 0.02111, - 0.0273, - -0.02274 - ], - [ - 0.01713, - 0.05219, - 0.00917 - ] - ], - [ - [ - -0.00435, - 0.08485, - -0.02313 - ], - [ - 0.0084, - -0.00546, - 0.03043 - ], - [ - -0.01232, - 0.02874, - -0.03545 - ], - [ - 0.01001, - 0.08381, - 0.02029 - ], - [ - 0.01925, - 0.02996, - -0.00654 - ], - [ - 0.00796, - -0.00428, - -0.00653 - ], - [ - 0.01284, - 0.02729, - 0.02918 - ], - [ - 0.00841, - 0.08495, - -0.00248 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.008.seg1": 0.544104643240255 - }, - { - "DEF-hair.008.seg2": 1.041131147026082, - "DEF-hair.008": 0.544104643240255 - }, - { - "DEF-hair.008.seg1": 1.041131147026082 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-head", - "bones": [ - "DEF-hair.012", - "DEF-hair.012.seg1", - "DEF-hair.012.seg2" - ], - "tips": [ - [ - 0.0, - 0.11487, - 0.0 - ], - [ - -0.0, - 0.52061, - -0.0 - ], - [ - -0.00078, - 0.53789, - 0.02374 - ] - ], - "hulls": [ - [], - [ - [ - 0.08143, - 0.38272, - 0.0237 - ], - [ - -0.03426, - 0.21906, - -0.02815 - ], - [ - -0.05869, - 0.3851, - -0.03557 - ], - [ - 0.06617, - 0.22707, - 0.01893 - ], - [ - 0.01082, - 0.38781, - 0.01185 - ], - [ - 0.0172, - 0.22507, - 0.00437 - ] - ], - [ - [ - -0.06428, - 0.4061, - -0.0301 - ], - [ - 0.09033, - 0.13149, - 0.03616 - ], - [ - -0.08758, - 0.13894, - -0.03072 - ], - [ - 0.07202, - 0.39924, - 0.02431 - ], - [ - 0.00266, - 0.13484, - 0.03774 - ], - [ - -0.01549, - 0.40306, - 0.03382 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.012.seg1": 0.4688694329841727 - }, - { - "DEF-hair.012": 0.4688694329841727, - "DEF-hair.012.seg2": 0.6772612470778174 - }, - { - "DEF-hair.012.seg1": 0.6772612470778174 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-head", - "bones": [ - "DEF-hair.016", - "DEF-hair.016.seg1", - "DEF-hair.016.seg2" - ], - "tips": [ - [ - -0.0, - 0.0359, - 0.0 - ], - [ - 0.0, - 0.06812, - 0.0 - ], - [ - -0.00281, - 0.03539, - 0.00192 - ] - ], - "hulls": [ - [], - [], - [ - [ - -0.01266, - 0.0452, - -0.009 - ], - [ - 0.00301, - -0.01919, - 0.02967 - ], - [ - 0.00968, - 0.00185, - -0.02541 - ], - [ - -0.00126, - 0.01263, - 0.02435 - ], - [ - -0.0141, - 0.005, - -0.00373 - ], - [ - -0.00126, - 0.04419, - 0.01741 - ], - [ - 0.00677, - 0.03419, - -0.02659 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.016.seg1": 0.2051926899902945 - }, - { - "DEF-hair.016": 0.2051926899902945, - "DEF-hair.016.seg2": 0.8438233012966365 - }, - { - "DEF-hair.016.seg1": 0.8438233012966365 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-neck", - "bones": [ - "DEF-hair.014", - "DEF-hair.014.seg1", - "DEF-hair.014.seg2" - ], - "tips": [ - [ - -0.0, - 0.01059, - 0.0 - ], - [ - -0.0, - 0.01859, - -0.0 - ], - [ - -0.00609, - 0.07046, - -0.00229 - ] - ], - "hulls": [ - [], - [ - [ - 0.00221, - 0.02697, - 0.0023 - ], - [ - 0.01664, - 0.00595, - 0.00377 - ], - [ - -0.00478, - 0.00845, - -0.00758 - ], - [ - -0.01537, - 0.01679, - -0.00555 - ], - [ - 0.00985, - 0.01816, - 0.00259 - ], - [ - -0.00032, - 0.02545, - 0.0048 - ], - [ - -0.013, - 0.0182, - -0.0079 - ] - ], - [ - [ - -0.00561, - 0.03819, - -0.01128 - ], - [ - -0.00105, - 0.03209, - 0.009 - ], - [ - -0.00651, - 0.03548, - -0.00097 - ], - [ - 0.00293, - 0.03804, - -0.01157 - ], - [ - -0.00499, - 0.03236, - 0.0091 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.014.seg1": 0.6311526711243278 - }, - { - "DEF-hair.014.seg2": 0.7552814283274145, - "DEF-hair.014": 0.6311526711243278 - }, - { - "DEF-hair.014.seg1": 0.7552814283274145 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-neck", - "bones": [ - "DEF-hair.015", - "DEF-hair.015.seg1", - "DEF-hair.015.seg2" - ], - "tips": [ - [ - -0.0, - 0.01059, - 0.0 - ], - [ - 0.0, - 0.01859, - -0.0 - ], - [ - 0.00609, - 0.07046, - -0.00229 - ] - ], - "hulls": [ - [], - [ - [ - -0.00221, - 0.02697, - 0.0023 - ], - [ - -0.01664, - 0.00595, - 0.00377 - ], - [ - 0.00478, - 0.00845, - -0.00758 - ], - [ - 0.01537, - 0.01679, - -0.00555 - ], - [ - -0.00985, - 0.01816, - 0.00259 - ], - [ - 0.00033, - 0.02545, - 0.0048 - ], - [ - 0.013, - 0.0182, - -0.0079 - ] - ], - [ - [ - 0.00561, - 0.03819, - -0.01128 - ], - [ - 0.00105, - 0.03209, - 0.009 - ], - [ - 0.00651, - 0.03548, - -0.00097 - ], - [ - -0.00293, - 0.03804, - -0.01157 - ], - [ - 0.00499, - 0.03236, - 0.0091 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.015.seg1": 0.6311515558643954 - }, - { - "DEF-hair.015": 0.6311515558643954, - "DEF-hair.015.seg2": 0.7552778980528112 - }, - { - "DEF-hair.015.seg1": 0.7552778980528112 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-shoulder.L", - "bones": [ - "DEF-hair.010", - "DEF-hair.010.seg1", - "DEF-hair.010.seg2" - ], - "tips": [ - [ - 0.0, - 0.00777, - -0.0 - ], - [ - 0.0, - 0.03131, - 0.0 - ], - [ - 0.01565, - 0.03355, - 0.05337 - ] - ], - "hulls": [ - [], - [], - [] - ], - "neighbours": [ - { - "DEF-hair.010.seg1": 0.16639685031303486 - }, - { - "DEF-hair.010.seg2": 0.8796921148822996, - "DEF-hair.010": 0.16639685031303486 - }, - { - "DEF-hair.010.seg1": 0.8796921148822996 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-shoulder.R", - "bones": [ - "DEF-hair.011", - "DEF-hair.011.seg1", - "DEF-hair.011.seg2" - ], - "tips": [ - [ - -0.0, - 0.00777, - -0.0 - ], - [ - 0.0, - 0.03131, - 0.0 - ], - [ - -0.01565, - 0.03355, - 0.05337 - ] - ], - "hulls": [ - [], - [], - [] - ], - "neighbours": [ - { - "DEF-hair.011.seg1": 0.1663931756391417 - }, - { - "DEF-hair.011.seg2": 0.879689124889564, - "DEF-hair.011": 0.1663931756391417 - }, - { - "DEF-hair.011.seg1": 0.879689124889564 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-shoulder.R", - "bones": [ - "DEF-hair.013", - "DEF-hair.013.seg1", - "DEF-hair.013.seg2" - ], - "tips": [ - [ - 0.0, - 0.02806, - -0.0 - ], - [ - -0.0, - 0.09427, - -0.0 - ], - [ - -0.02398, - 0.06711, - -0.00468 - ] - ], - "hulls": [ - [], - [], - [ - [ - -0.01879, - 0.07281, - -0.01286 - ], - [ - 0.00337, - -0.00433, - -0.00195 - ], - [ - -0.02922, - 0.0655, - 0.02079 - ], - [ - -0.0037, - 0.01641, - -0.01974 - ], - [ - -0.01162, - 0.0174, - 0.00207 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.013.seg1": 0.349694197366202 - }, - { - "DEF-hair.013.seg2": 0.6517327485597155, - "DEF-hair.013": 0.349694197366202 - }, - { - "DEF-hair.013.seg1": 0.6517327485597155 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-shoulder.R", - "bones": [ - "DEF-hair.017", - "DEF-hair.017.seg1", - "DEF-hair.017.seg2" - ], - "tips": [ - [ - 0.0, - 0.00941, - 0.0 - ], - [ - -0.0, - 0.05162, - -0.0 - ], - [ - 0.00128, - 0.02691, - 0.00117 - ] - ], - "hulls": [ - [], - [ - [ - -0.00375, - 0.01463, - 0.00361 - ], - [ - -0.00531, - 0.01347, - -0.00329 - ], - [ - 0.00057, - 0.01508, - 0.00012 - ] - ], - [ - [ - 0.00443, - 0.04041, - 0.00074 - ], - [ - -0.00213, - -0.00019, - -0.0022 - ], - [ - 0.00498, - -0.00025, - 0.00188 - ], - [ - -0.0006, - 0.04033, - 0.00276 - ], - [ - -0.00073, - 0.00062, - 0.00252 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.017.seg1": 1.276620211903057 - }, - { - "DEF-hair.017.seg2": 0.6642583105158355, - "DEF-hair.017": 1.276620211903057 - }, - { - "DEF-hair.017.seg1": 0.6642583105158355 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-shoulder.R", - "bones": [ - "DEF-hair.018", - "DEF-hair.018.seg1", - "DEF-hair.018.seg2" - ], - "tips": [ - [ - 0.0, - 0.02265, - 0.0 - ], - [ - 0.0, - 0.07928, - 0.0 - ], - [ - -0.01157, - 0.04388, - -0.00023 - ] - ], - "hulls": [ - [], - [ - [ - 0.01359, - 0.03136, - 0.0277 - ], - [ - 0.00546, - 0.02804, - -0.02805 - ], - [ - -0.01695, - 0.03365, - -0.00426 - ], - [ - -0.01115, - 0.03295, - 0.02135 - ] - ], - [ - [ - 0.00807, - 0.05961, - 0.01306 - ], - [ - -0.01638, - 0.00023, - -0.04035 - ], - [ - 0.00079, - -0.0029, - 0.02158 - ], - [ - -0.035, - 0.04283, - -0.01184 - ], - [ - 0.03062, - 0.00806, - 0.02309 - ], - [ - -0.01504, - -0.0054, - -0.00432 - ], - [ - -0.01355, - 0.05113, - -0.00202 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.018.seg1": 0.17496539410737744 - }, - { - "DEF-hair.018.seg2": 0.5754036757698482, - "DEF-hair.018": 0.17496539410737744 - }, - { - "DEF-hair.018.seg1": 0.5754036757698482 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-thigh.L", - "bones": [ - "DEF-hair.000", - "DEF-hair.000.seg1", - "DEF-hair.000.seg2" - ], - "tips": [ - [ - -0.0, - 0.08611, - 0.0 - ], - [ - 0.0, - 0.08, - -0.0 - ], - [ - 0.12351, - 0.78722, - -0.00183 - ] - ], - "hulls": [ - [], - [ - [ - 0.35163, - 0.47831, - -0.2775 - ], - [ - 0.1734, - 0.13358, - -0.15857 - ], - [ - 0.26841, - 0.31027, - -0.1128 - ], - [ - 0.07769, - 0.27925, - -0.12897 - ], - [ - 0.24026, - 0.3754, - -0.25789 - ], - [ - 0.15202, - 0.28491, - -0.02325 - ], - [ - 0.21512, - 0.18069, - -0.05309 - ], - [ - 0.28516, - 0.40662, - -0.16059 - ], - [ - 0.09636, - 0.18123, - -0.19363 - ], - [ - 0.30502, - 0.31783, - -0.23526 - ] - ], - [ - [ - 0.02931, - 0.47878, - 0.05529 - ], - [ - 0.06992, - 0.31481, - -0.073 - ], - [ - 0.05186, - 0.31421, - 0.06098 - ], - [ - 0.06465, - 0.47035, - -0.05671 - ], - [ - 0.08225, - 0.31131, - 0.00596 - ], - [ - 0.07251, - 0.47218, - 0.002 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.000.seg1": 2.5877335663057366 - }, - { - "DEF-hair.000": 2.5877335663057366, - "DEF-hair.000.seg2": 0.40775492159508264 - }, - { - "DEF-hair.000.seg1": 0.40775492159508264 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-thigh.L", - "bones": [ - "DEF-hair.001", - "DEF-hair.001.seg1", - "DEF-hair.001.seg2" - ], - "tips": [ - [ - -0.0, - 0.06901, - -0.0 - ], - [ - 0.0, - 0.08352, - 0.0 - ], - [ - 0.01813, - 0.83868, - 0.01008 - ] - ], - "hulls": [ - [], - [], - [ - [ - -0.01038, - 0.52617, - -0.03271 - ], - [ - 0.03572, - 0.34787, - 0.02308 - ], - [ - 0.02115, - 0.51493, - 0.02781 - ], - [ - -0.01317, - 0.35614, - -0.02186 - ], - [ - 0.012, - 0.3516, - 0.02887 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.001.seg1": 0.11834733743112169 - }, - { - "DEF-hair.001.seg2": 0.8545803994440844, - "DEF-hair.001": 0.11834733743112169 - }, - { - "DEF-hair.001.seg1": 0.8545803994440844 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-thigh.L", - "bones": [ - "DEF-hair.009", - "DEF-hair.009.seg1", - "DEF-hair.009.seg2" - ], - "tips": [ - [ - -0.0, - 0.06106, - -0.0 - ], - [ - -0.0, - 0.00838, - -0.0 - ], - [ - 0.23274, - -0.62143, - 0.22715 - ] - ], - "hulls": [ - [], - [], - [ - [ - 0.23086, - -0.52644, - 0.18471 - ], - [ - -0.05477, - -0.0258, - 0.02661 - ], - [ - 0.06495, - -0.24524, - 0.09546 - ], - [ - 0.1895, - -0.37359, - 0.12178 - ], - [ - 0.1513, - -0.3825, - 0.13931 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.009.seg1": 0.13724513036544295 - }, - { - "DEF-hair.009.seg2": 0.7363037552267393, - "DEF-hair.009": 0.13724513036544295 - }, - { - "DEF-hair.009.seg1": 0.7363037552267393 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-thigh.R", - "bones": [ - "DEF-hair.002", - "DEF-hair.002.seg1", - "DEF-hair.002.seg2" - ], - "tips": [ - [ - -0.0, - 0.08611, - -0.0 - ], - [ - -0.0, - 0.08, - 0.0 - ], - [ - -0.12351, - 0.78722, - -0.00183 - ] - ], - "hulls": [ - [], - [ - [ - -0.35163, - 0.47831, - -0.2775 - ], - [ - -0.1734, - 0.13358, - -0.15857 - ], - [ - -0.26841, - 0.31027, - -0.1128 - ], - [ - -0.07769, - 0.27925, - -0.12897 - ], - [ - -0.24026, - 0.3754, - -0.25789 - ], - [ - -0.15202, - 0.28491, - -0.02325 - ], - [ - -0.21512, - 0.18069, - -0.05309 - ], - [ - -0.28517, - 0.40662, - -0.16059 - ], - [ - -0.09637, - 0.18123, - -0.19363 - ], - [ - -0.30503, - 0.31783, - -0.23525 - ] - ], - [ - [ - -0.02931, - 0.47878, - 0.05529 - ], - [ - -0.06992, - 0.31481, - -0.073 - ], - [ - -0.05186, - 0.31421, - 0.06098 - ], - [ - -0.06465, - 0.47035, - -0.05671 - ], - [ - -0.08225, - 0.31131, - 0.00596 - ], - [ - -0.07252, - 0.47218, - 0.002 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.002.seg1": 2.5877328134030515 - }, - { - "DEF-hair.002": 2.5877328134030515, - "DEF-hair.002.seg2": 0.40775412351719176 - }, - { - "DEF-hair.002.seg1": 0.40775412351719176 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-thigh.R", - "bones": [ - "DEF-hair.003", - "DEF-hair.003.seg1", - "DEF-hair.003.seg2" - ], - "tips": [ - [ - -0.0, - 0.06106, - -0.0 - ], - [ - 0.0, - 0.00838, - -0.0 - ], - [ - -0.23274, - -0.62143, - 0.22715 - ] - ], - "hulls": [ - [], - [], - [ - [ - -0.23086, - -0.52644, - 0.18471 - ], - [ - 0.05476, - -0.0258, - 0.02661 - ], - [ - -0.06495, - -0.24524, - 0.09546 - ], - [ - -0.1895, - -0.37359, - 0.12178 - ], - [ - -0.1513, - -0.3825, - 0.13931 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.003.seg1": 0.13724553065786438 - }, - { - "DEF-hair.003.seg2": 0.7363036406695933, - "DEF-hair.003": 0.13724553065786438 - }, - { - "DEF-hair.003.seg1": 0.7363036406695933 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-thigh.R", - "bones": [ - "DEF-hair.005", - "DEF-hair.005.seg1", - "DEF-hair.005.seg2" - ], - "tips": [ - [ - -0.0, - 0.06901, - -0.0 - ], - [ - -0.0, - 0.08352, - -0.0 - ], - [ - -0.01813, - 0.83868, - 0.01008 - ] - ], - "hulls": [ - [], - [], - [ - [ - 0.01038, - 0.52617, - -0.03271 - ], - [ - -0.03572, - 0.34787, - 0.02308 - ], - [ - -0.02115, - 0.51493, - 0.02781 - ], - [ - 0.01317, - 0.35614, - -0.02186 - ], - [ - -0.012, - 0.3516, - 0.02887 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.005.seg1": 0.11834750436539365 - }, - { - "DEF-hair.005.seg2": 0.8545815840011777, - "DEF-hair.005": 0.11834750436539365 - }, - { - "DEF-hair.005.seg1": 0.8545815840011777 - } - ] - } - ], + "chains": [], "twist": [], "colliders": [ { @@ -1825,17 +59,17 @@ "bone": "DEF-shin.L", "child": "DEF-foot.L", "from": 0.1, - "radius_head": 0.0741, - "radius_tail": 0.0741, - "radius": 0.0741 + "radius_head": 0.0862, + "radius_tail": 0.0728, + "radius": 0.0728 }, { "bone": "DEF-shin.R", "child": "DEF-foot.R", "from": 0.1, - "radius_head": 0.0741, - "radius_tail": 0.0741, - "radius": 0.0741 + "radius_head": 0.0862, + "radius_tail": 0.0728, + "radius": 0.0728 } ], "weights_authored": false, diff --git a/assets/characters/skins/momo.glb b/assets/characters/skins/momo.glb index fe4031f..94601d7 100644 Binary files a/assets/characters/skins/momo.glb and b/assets/characters/skins/momo.glb differ diff --git a/assets/characters/skins/momo.rig.json b/assets/characters/skins/momo.rig.json index a569278..c342f6e 100644 --- a/assets/characters/skins/momo.rig.json +++ b/assets/characters/skins/momo.rig.json @@ -11,18 +11,18 @@ "Unused_Noname_004", "Unused_Noname_010" ], - "shoulder.L": "Left shoulder", "shoulder.R": "Right shoulder", - "foot.R": "Right ankle", + "shoulder.L": "Left shoulder", "foot.L": "Left ankle", + "foot.R": "Right ankle", "hand.L": "Left wrist", "hand.R": "Right wrist", "forearm.L": "Left elbow", "forearm.R": "Right elbow", - "shin.R": "Right knee", "shin.L": "Left knee", - "toe.R": "Toes2_R", - "toe.L": "Toes3_L", + "shin.R": "Right knee", + "toe.R": "Toes0_R", + "toe.L": "Toes4_L", "upper_arm.L": "Left arm", "upper_arm.R": "Right arm", "thigh.L": "Left leg", @@ -1804,8 +1804,8 @@ "Root_006", "Root_007", "Spine", - "Toes2_R", - "Toes3_L", + "Toes0_R", + "Toes4_L", "Unused_Noname_004", "Unused_Noname_010" ] diff --git a/assets/characters/skins/taila.glb b/assets/characters/skins/taila.glb index 2fc39fa..6defd97 100644 Binary files a/assets/characters/skins/taila.glb and b/assets/characters/skins/taila.glb differ diff --git a/assets/characters/skins/taila.rig.json b/assets/characters/skins/taila.rig.json index 30f9aff..371cd06 100644 --- a/assets/characters/skins/taila.rig.json +++ b/assets/characters/skins/taila.rig.json @@ -11,22 +11,22 @@ "DEF-spine.005", "DEF-spine.006" ], - "forearm.L": "DEF-forearm.L", - "forearm.R": "DEF-forearm.R", - "shin.R": "DEF-shin.R", - "hand.L": "DEF-hand.L", - "hand.R": "DEF-hand.R", - "thigh.R": "DEF-thigh.R", - "toe.L": "DEF-toe.L", - "shoulder.L": "DEF-shoulder.L", - "foot.R": "DEF-foot.R", - "upper_arm.R": "DEF-upper_arm.R", - "upper_arm.L": "DEF-upper_arm.L", - "foot.L": "DEF-foot.L", "shoulder.R": "DEF-shoulder.R", - "toe.R": "DEF-toe.R", + "shoulder.L": "DEF-shoulder.L", + "upper_arm.L": "DEF-upper_arm.L", + "upper_arm.R": "DEF-upper_arm.R", + "forearm.R": "DEF-forearm.R", + "forearm.L": "DEF-forearm.L", + "thigh.R": "DEF-thigh.R", "thigh.L": "DEF-thigh.L", - "shin.L": "DEF-shin.L" + "foot.R": "DEF-foot.R", + "foot.L": "DEF-foot.L", + "shin.R": "DEF-shin.R", + "shin.L": "DEF-shin.L", + "hand.R": "DEF-hand.R", + "hand.L": "DEF-hand.L", + "toe.L": "DEF-toe.L", + "toe.R": "DEF-toe.R" }, "chains": [ { @@ -342,16 +342,16 @@ 0.01817, 0.00434 ], - [ - -0.00172, - 0.01822, - 0.00197 - ], [ -0.00465, 0.01808, -0.00268 ], + [ + 0.00404, + 0.01779, + 0.0016 + ], [ -0.00301, 0.0179, @@ -491,9 +491,9 @@ -0.00419 ], [ - 0.0075, - 0.01099, - -0.00153 + -0.00016, + 0.03547, + -0.00033 ] ] ], @@ -522,7 +522,7 @@ [ -0.0, 0.08774, - 0.0 + -0.0 ], [ 0.0, @@ -671,6 +671,11 @@ 0.01676, -0.01006 ], + [ + -0.01785, + 0.01605, + 0.00846 + ], [ -0.01743, 0.01605, @@ -680,11 +685,6 @@ -0.0005, 0.0168, 0.00929 - ], - [ - -0.01785, - 0.01605, - 0.00846 ] ], [ @@ -821,7 +821,7 @@ ], [ -0.03185, - 0.12799, + 0.12798, -0.00534 ], [ @@ -1000,7 +1000,7 @@ [ 0.0, 0.105, - 0.0 + -0.0 ], [ 0.0, @@ -1204,7 +1204,7 @@ 0.0 ], [ - 0.0, + -0.0, 0.05056, 0.0 ], @@ -1412,20 +1412,20 @@ 0.01064, 0.0034 ], - [ - 0.00147, - 0.00995, - -0.0042 - ], [ 0.00474, 0.01042, -0.00245 ], [ - 0.00535, - 0.01032, - 0.00241 + 6e-05, + 0.00969, + -0.00372 + ], + [ + 0.00154, + 0.00977, + 0.00037 ] ] ], @@ -1570,7 +1570,7 @@ [ 0.00052, 0.0112, - -0.00443 + -0.00442 ], [ -0.00752, @@ -1689,7 +1689,7 @@ [ 0.0, 0.0683, - -0.0 + 0.0 ], [ 0.00252, @@ -2088,14 +2088,14 @@ ], "tips": [ [ - 0.0, + -0.0, 0.11762, 0.0 ], [ 0.0, 0.18049, - -0.0 + 0.0 ], [ 0.0, @@ -2303,7 +2303,7 @@ ], [ -0.07862, - -0.20395, + -0.20394, -0.14078 ], [ @@ -2349,6 +2349,268 @@ { "class": "hair", "root_parent": "DEF-spine.004", + "bones": [ + "DEF-hair.R", + "DEF-hair.R.001", + "DEF-hair.R.002", + "DEF-hair.R.003" + ], + "tips": [ + [ + 0.0, + 0.11762, + -0.0 + ], + [ + 0.0, + 0.18049, + 0.0 + ], + [ + 0.0, + 0.10823, + -0.0 + ], + [ + 0.00673, + 0.04894, + -0.00199 + ] + ], + "hulls": [ + [ + [ + 0.10392, + 0.04499, + -0.03143 + ], + [ + -0.00179, + 0.08913, + -0.04032 + ], + [ + 0.01042, + -0.01469, + -0.03154 + ], + [ + 0.05269, + 0.08941, + 0.01263 + ], + [ + 0.0467, + 0.01999, + 0.01337 + ], + [ + 0.00289, + 0.0244, + -0.00341 + ], + [ + 0.03259, + 0.06068, + -0.03311 + ], + [ + 0.00187, + 0.02225, + -0.05257 + ], + [ + 0.06928, + 0.05051, + -0.05454 + ], + [ + 0.03548, + 0.01714, + -0.02935 + ] + ], + [ + [ + 0.04087, + 0.19192, + 0.02292 + ], + [ + 0.01014, + 0.03724, + -0.05229 + ], + [ + 0.00077, + 0.11967, + -0.03237 + ], + [ + 0.05589, + 0.03236, + 0.01606 + ], + [ + 0.05326, + 0.11999, + 0.02036 + ], + [ + 0.00244, + 0.18657, + -0.03663 + ], + [ + 0.00925, + 0.03688, + -0.00205 + ], + [ + 0.0464, + 0.03362, + -0.02716 + ], + [ + 0.04423, + 0.12228, + -0.02088 + ], + [ + 0.033, + 0.19244, + -0.01446 + ] + ], + [ + [ + 0.02337, + 0.10374, + 0.0137 + ], + [ + 0.02848, + -0.00246, + 0.02582 + ], + [ + 0.0076, + 0.04735, + -0.02831 + ], + [ + 0.03954, + 0.04619, + 0.02246 + ], + [ + 0.00572, + 0.04488, + 0.00827 + ], + [ + 0.00551, + 0.09646, + -0.01731 + ], + [ + 0.00242, + 0.00207, + 0.00675 + ], + [ + 0.0336, + 0.04774, + -0.00921 + ], + [ + 0.0059, + 0.07567, + 0.00688 + ], + [ + 0.0273, + 0.0798, + -0.0066 + ] + ], + [ + [ + -0.00144, + 0.04301, + -0.00088 + ], + [ + 0.01365, + 0.01225, + 0.00757 + ], + [ + 0.00282, + 0.01066, + -0.01138 + ], + [ + 0.00127, + 0.00974, + 0.00225 + ], + [ + 0.01206, + 0.0122, + -0.00415 + ], + [ + -0.0003, + 0.00984, + -0.00764 + ], + [ + 0.00895, + 0.0112, + 0.00848 + ], + [ + 0.00295, + 0.01034, + -0.01034 + ], + [ + 0.01117, + 0.01186, + -0.00363 + ], + [ + -0.00118, + 0.04195, + -0.00089 + ] + ] + ], + "neighbours": [ + { + "DEF-hair.R.005": 8.895136039757556, + "DEF-hair.R.006": 0.5874295932403306, + "DEF-hair.R.008": 2.6819264528755653, + "DEF-hair.R.004": 3.0752010115277004, + "DEF-hair.R.001": 1.8037417183725024 + }, + { + "DEF-hair.R.002": 3.682230264940157, + "DEF-hair.R": 1.8037417183725024 + }, + { + "DEF-hair.R.003": 3.8194620543874045, + "DEF-hair.R.001": 3.682230264940157 + }, + { + "DEF-hair.R.002": 3.8194620543874045 + } + ] + }, + { + "class": "hair", + "root_parent": "DEF-spine.003", "bones": [ "DEF-hair.L.004", "DEF-hair.L.005", @@ -2444,7 +2706,7 @@ [ 0.10543, -0.04097, - -0.04243 + -0.04242 ], [ -0.05913, @@ -2454,7 +2716,7 @@ [ 0.13118, 0.13005, - 0.05197 + 0.05198 ], [ 0.01882, @@ -2623,269 +2885,7 @@ }, { "class": "hair", - "root_parent": "DEF-spine.004", - "bones": [ - "DEF-hair.R", - "DEF-hair.R.001", - "DEF-hair.R.002", - "DEF-hair.R.003" - ], - "tips": [ - [ - 0.0, - 0.11762, - -0.0 - ], - [ - -0.0, - 0.18049, - 0.0 - ], - [ - 0.0, - 0.10823, - -0.0 - ], - [ - 0.00673, - 0.04894, - -0.00199 - ] - ], - "hulls": [ - [ - [ - 0.10392, - 0.04499, - -0.03143 - ], - [ - -0.00179, - 0.08913, - -0.04032 - ], - [ - 0.01042, - -0.01469, - -0.03154 - ], - [ - 0.05269, - 0.08941, - 0.01263 - ], - [ - 0.0467, - 0.01999, - 0.01337 - ], - [ - 0.00289, - 0.0244, - -0.00341 - ], - [ - 0.03259, - 0.06069, - -0.03311 - ], - [ - 0.00187, - 0.02225, - -0.05257 - ], - [ - 0.06928, - 0.05051, - -0.05454 - ], - [ - 0.03548, - 0.01714, - -0.02935 - ] - ], - [ - [ - 0.04087, - 0.19192, - 0.02292 - ], - [ - 0.01014, - 0.03724, - -0.05229 - ], - [ - 0.00077, - 0.11967, - -0.03237 - ], - [ - 0.05589, - 0.03236, - 0.01606 - ], - [ - 0.05326, - 0.11999, - 0.02036 - ], - [ - 0.00244, - 0.18657, - -0.03663 - ], - [ - 0.00925, - 0.03688, - -0.00205 - ], - [ - 0.0464, - 0.03362, - -0.02716 - ], - [ - 0.04423, - 0.12228, - -0.02088 - ], - [ - 0.033, - 0.19244, - -0.01446 - ] - ], - [ - [ - 0.02337, - 0.10374, - 0.0137 - ], - [ - 0.02848, - -0.00246, - 0.02582 - ], - [ - 0.0076, - 0.04735, - -0.02831 - ], - [ - 0.03954, - 0.04619, - 0.02246 - ], - [ - 0.00572, - 0.04488, - 0.00827 - ], - [ - 0.00551, - 0.09646, - -0.01731 - ], - [ - 0.00242, - 0.00207, - 0.00675 - ], - [ - 0.0336, - 0.04774, - -0.00921 - ], - [ - 0.0059, - 0.07567, - 0.00688 - ], - [ - 0.0273, - 0.0798, - -0.0066 - ] - ], - [ - [ - -0.00144, - 0.04301, - -0.00088 - ], - [ - 0.01365, - 0.01225, - 0.00757 - ], - [ - 0.00282, - 0.01066, - -0.01138 - ], - [ - 0.00127, - 0.00974, - 0.00225 - ], - [ - 0.01206, - 0.0122, - -0.00415 - ], - [ - -0.0003, - 0.00984, - -0.00764 - ], - [ - 0.00895, - 0.0112, - 0.00848 - ], - [ - 0.00926, - 0.01102, - 0.00745 - ], - [ - 0.01117, - 0.01186, - -0.00363 - ], - [ - -0.00118, - 0.04195, - -0.00089 - ] - ] - ], - "neighbours": [ - { - "DEF-hair.R.005": 8.895136039757556, - "DEF-hair.R.006": 0.5874295932403306, - "DEF-hair.R.008": 2.6819264528755653, - "DEF-hair.R.004": 3.0752010115277004, - "DEF-hair.R.001": 1.8037417183725024 - }, - { - "DEF-hair.R.002": 3.682230264940157, - "DEF-hair.R": 1.8037417183725024 - }, - { - "DEF-hair.R.003": 3.8194620543874045, - "DEF-hair.R.001": 3.682230264940157 - }, - { - "DEF-hair.R.002": 3.8194620543874045 - } - ] - }, - { - "class": "hair", - "root_parent": "DEF-spine.004", + "root_parent": "DEF-spine.003", "bones": [ "DEF-hair.R.004", "DEF-hair.R.005", @@ -2896,7 +2896,7 @@ [ -0.0, 0.13941, - 0.0 + -0.0 ], [ 0.0, @@ -2910,7 +2910,7 @@ ], [ 0.108, - -0.20337, + -0.20336, -0.03794 ] ], @@ -2969,7 +2969,7 @@ ], [ [ - -0.22588, + -0.22587, 0.29058, 0.02349 ], @@ -3009,7 +3009,7 @@ 0.0065 ], [ - -0.01314, + -0.01313, 0.17179, -0.05603 ], @@ -3075,7 +3075,7 @@ [ -0.09428, -0.32225, - -0.06802 + -0.06801 ], [ 0.0014, @@ -3174,7 +3174,7 @@ [ 0.0, 0.04862, - -0.0 + 0.0 ], [ 0.0, @@ -3430,9 +3430,9 @@ }, { "DEF-skirt.003.seg3": 5.211532068417141, - "DEF-skirt.seg3": 2.155654134166214, + "DEF-skirt.seg3": 2.1638592614301637, "DEF-skirt.007.seg2": 0.05601081196344071, - "DEF-skirt.L.seg3": 2.7081503117896872, + "DEF-skirt.L.seg3": 2.7192597439563233, "DEF-skirt.007.seg1": 0.09495247018795672, "DEF-skirt.L.001": 0.07432020535983441, "DEF-skirt.005": 0.4334825864653958, @@ -3452,14 +3452,14 @@ }, { "DEF-skirt.002": 0.25142821495506595, - "DEF-skirt.011.seg1": 5.570096570820647, + "DEF-skirt.011.seg1": 5.544001124575805, "DEF-skirt.L.001": 0.4132729913690881, "DEF-skirt.011": 4.6961528319649295, "DEF-skirt.003.seg3": 8.365425825133514, "DEF-skirt.005.seg2": 4.61498402848288, "DEF-skirt.009": 0.7582600522037454, "DEF-skirt.009.seg1": 0.9144382488613035, - "DEF-skirt.seg2": 2.155654134166214, + "DEF-skirt.seg2": 2.1638592614301637, "DEF-skirt.L.seg3": 4.3393369779026685, "DEF-skirt.011.seg2": 2.8357110381653126, "DEF-skirt.006": 0.1217170026805725, @@ -3488,19 +3488,19 @@ ], "tips": [ [ - -0.0, - 0.01789, - -0.0 - ], - [ - -0.0, + 0.0, 0.01789, -0.0 ], [ 0.0, 0.01789, - 0.0 + -0.0 + ], + [ + -0.0, + 0.01789, + -0.0 ], [ -0.01933, @@ -3521,7 +3521,7 @@ 0.05153 ], [ - -0.0226, + -0.02261, 0.01376, -0.00513 ], @@ -3660,9 +3660,9 @@ -0.02409 ], [ - -0.0027, - 0.01545, - 0.03451 + -0.00263, + 0.00945, + -0.03186 ] ], [ @@ -3796,7 +3796,7 @@ [ -0.0, 0.03781, - 0.0 + -0.0 ], [ -0.0, @@ -3804,14 +3804,14 @@ -0.0 ], [ - -0.0, + 0.0, 0.03781, - 0.0 + -0.0 ], [ - -0.01275, - 0.14672, - 0.03258 + -0.01201, + 0.14512, + 0.03219 ] ], "hulls": [ @@ -3908,15 +3908,15 @@ 0.03396, 0.00519 ], - [ - 0.01244, - 0.01059, - 0.02825 - ], [ -0.01822, 0.03022, 0.03066 + ], + [ + 0.01244, + 0.01059, + 0.02825 ] ], [ @@ -3973,9 +3973,9 @@ ], [ [ - -0.07888, - 0.14866, - 0.10517 + -0.07886, + 0.14877, + 0.10408 ], [ 0.02098, @@ -4040,7 +4040,7 @@ { "DEF-skirt.L.003": 4.760126868318332, "DEF-skirt.seg1": 2.1407108254297182, - "DEF-skirt.L.seg2": 4.229518094249963, + "DEF-skirt.L.seg2": 4.246796835031998, "DEF-skirt.003.seg2": 0.4596588821250581, "DEF-skirt.L.003.seg1": 0.6595836843532097, "DEF-skirt.seg2": 0.3928760868859329, @@ -4056,7 +4056,7 @@ "DEF-skirt.L.seg3": 3.686576538966275, "DEF-skirt.L.003.seg3": 0.009721631050302243, "DEF-skirt.L.003.seg2": 0.19439024437881924, - "DEF-skirt.L.seg1": 4.229518094249963, + "DEF-skirt.L.seg1": 4.246796835031998, "DEF-skirt.seg1": 1.587180682104046, "DEF-skirt.L.003.seg1": 0.1957218245564052, "DEF-skirt.seg2": 3.2111160715999776, @@ -4072,21 +4072,21 @@ "DEF-skirt.L.002": 0.10102962666415694, "DEF-skirt.L.001.seg1": 0.19093190472623134, "DEF-skirt.L.005": 0.04318668795316161, - "DEF-skirt.L.004": 3.793317002760232, + "DEF-skirt.L.004": 3.7163001012175743, "DEF-skirt.011.seg3": 4.602221938080493, - "DEF-skirt.011.seg2": 3.711280083702404, - "DEF-skirt.L.004.seg1": 0.9764221426855458, + "DEF-skirt.011.seg2": 3.703707791421389, + "DEF-skirt.L.004.seg1": 0.9578381959761514, "DEF-skirt.L.003": 3.6402760699503562, "DEF-skirt.L.seg2": 3.686576538966275, "DEF-skirt.L.001": 1.7430155018692777, "DEF-skirt.seg3": 4.3393369779026685, - "DEF-skirt.seg2": 2.7081503117896872, + "DEF-skirt.seg2": 2.7192597439563233, "DEF-skirt.003.seg3": 0.5467618653323603, - "DEF-skirt.L.003.seg3": 1.533915214427354, - "DEF-skirt.L.003.seg2": 0.7716510583968516, + "DEF-skirt.L.003.seg3": 1.4767131363706594, + "DEF-skirt.L.003.seg2": 0.739566607477287, "DEF-skirt.005.seg2": 0.03759796665737425, - "DEF-skirt.011.seg1": 0.6236902469398551, - "DEF-skirt.L.003.seg1": 0.7045235895324149, + "DEF-skirt.011.seg1": 0.6000672181866031, + "DEF-skirt.L.003.seg1": 0.7168149637479433, "DEF-skirt.011": 0.13239584627096912, "DEF-skirt.003.seg2": 0.024977540935678944 } @@ -4103,7 +4103,7 @@ ], "tips": [ [ - 0.0, + -0.0, 0.01473, -0.0 ], @@ -4115,12 +4115,12 @@ [ 0.0, 0.01473, - -0.0 + 0.0 ], [ - 0.0279, - 0.14363, - -0.02295 + 0.03615, + 0.14155, + -0.03115 ] ], "hulls": [ @@ -4178,29 +4178,14 @@ ], [ [ - 0.14256, - 0.00647, - -0.14966 + 0.09911, + 0.00038, + -0.10791 ], [ - -0.02332, - 0.00279, - 0.01466 - ], - [ - 0.07423, - 0.01319, - -0.03945 - ], - [ - 0.09275, - 0.00189, - -0.1056 - ], - [ - 0.03046, - 0.00077, - -0.00282 + -0.02717, + 0.01394, + 0.0105 ], [ 0.04307, @@ -4208,24 +4193,39 @@ -0.04658 ], [ - -0.00094, - 0.00519, - -0.00354 + 0.03046, + 0.00077, + -0.00282 + ], + [ + 0.07423, + 0.01319, + -0.03945 + ], + [ + -0.00096, + 0.0041, + -0.00347 + ], + [ + -0.01848, + 0.0026, + 0.00091 ], [ 0.00014, 0.00336, 0.01308 ], - [ - -0.01507, - 0.00064, - 0.00183 - ], [ 0.02267, 0.00104, -0.0143 + ], + [ + -0.02332, + 0.00279, + 0.01466 ] ], [ @@ -4287,9 +4287,9 @@ 0.17881 ], [ - 0.18049, - 0.03004, - -0.17856 + 0.19114, + 0.03703, + -0.18664 ], [ -0.044, @@ -4297,9 +4297,9 @@ 0.02135 ], [ - 0.06877, - 0.11585, - -0.07637 + 0.06809, + 0.11583, + -0.07723 ], [ 0.08415, @@ -4356,10 +4356,10 @@ { "DEF-skirt.L.003": 6.056427661191389, "DEF-skirt.R.003": 3.5362091427452844, - "DEF-skirt.L.003.seg2": 1.4465578586045362, + "DEF-skirt.L.003.seg2": 1.4336744309317115, "DEF-skirt.R.003.seg1": 0.0075091120423149416, - "DEF-skirt.L.004": 0.3003293425343978, - "DEF-skirt.L.seg3": 0.7045235895324149, + "DEF-skirt.L.004": 0.28033761075145813, + "DEF-skirt.L.seg3": 0.7168149637479433, "DEF-skirt.L.seg2": 0.1957218245564052, "DEF-skirt.L.seg1": 0.6595836843532097, "DEF-skirt.L": 1.5219704851834268, @@ -4368,10 +4368,10 @@ { "DEF-skirt.L.003.seg3": 1.7624733424013248, "DEF-skirt.R.003": 5.005937962569201, - "DEF-skirt.L.004": 0.677365454643255, - "DEF-skirt.L.seg3": 0.7716510583968516, + "DEF-skirt.L.004": 0.6573735970229051, + "DEF-skirt.L.seg3": 0.739566607477287, "DEF-skirt.L.seg2": 0.19439024437881924, - "DEF-skirt.L.003.seg1": 1.4465578586045362, + "DEF-skirt.L.003.seg1": 1.4336744309317115, "DEF-skirt.R.003.seg1": 0.1158529500045482, "DEF-skirt.L": 0.9837299947917074, "DEF-skirt.L.seg1": 0.322305533592365, @@ -4389,8 +4389,8 @@ "DEF-skirt.R.003.seg3": 5.539891594630126, "DEF-skirt.L.004.seg1": 7.552187895272386, "DEF-skirt.R.004": 1.6662561376102858, - "DEF-skirt.L.004": 5.259879864898258, - "DEF-skirt.L.seg3": 1.533915214427354, + "DEF-skirt.L.004": 5.172512625961911, + "DEF-skirt.L.seg3": 1.4767131363706594, "DEF-skirt.L.seg2": 0.009721631050302243, "DEF-skirt.R.004.seg1": 0.2699483450459348, "DEF-skirt.R.003.seg2": 1.2716413510540925, @@ -4413,7 +4413,7 @@ ], "tips": [ [ - 0.0, + -0.0, 0.05443, -0.0 ], @@ -4648,7 +4648,7 @@ "DEF-skirt.R.003": 21.153115252758028, "DEF-skirt.007": 18.84494971969905, "DEF-skirt.007.seg1": 0.7598426687282531, - "DEF-skirt.R.seg1": 3.2779650971406786, + "DEF-skirt.R.seg1": 3.2886585052114654, "DEF-skirt.007.seg3": 0.5922937660442745, "DEF-skirt.R.003.seg1": 0.9644485221168745, "DEF-skirt.003.seg3": 0.058546876452437446, @@ -4666,7 +4666,7 @@ "DEF-skirt.007.seg3": 5.990418387665851, "DEF-skirt.003.seg3": 0.07982489265778714, "DEF-skirt.R.003.seg1": 2.6460365216903683, - "DEF-skirt.R": 3.2779650971406786, + "DEF-skirt.R": 3.2886585052114654, "DEF-skirt.R.003.seg2": 0.26822713323056313, "DEF-skirt.R.003": 1.2574131429974016, "DEF-skirt.007.seg2": 0.014808934502137577, @@ -4693,7 +4693,7 @@ "DEF-skirt.R.003.seg3": 7.040713262058846, "DEF-skirt.009.seg2": 0.6798349904287918, "DEF-skirt.009.seg1": 0.03686175164852512, - "DEF-skirt.007.seg3": 0.916461866501328, + "DEF-skirt.007.seg3": 0.939187919331689, "DEF-skirt.R.001": 0.6250004873314858, "DEF-skirt.R.seg2": 0.09424409085089636, "DEF-skirt.009": 0.08669143553370695, @@ -4980,7 +4980,7 @@ ], "tips": [ [ - -0.0, + 0.0, 0.02335, 0.0 ], @@ -5208,7 +5208,7 @@ "DEF-skirt.009": 9.43662584664051, "DEF-skirt.005": 0.23030644633612807, "DEF-skirt.R": 0.5922937660442745, - "DEF-skirt.R.seg3": 0.916461866501328, + "DEF-skirt.R.seg3": 0.939187919331689, "DEF-skirt.seg2": 0.1889945161820596, "DEF-skirt.007.seg2": 0.623153370820441 } @@ -5225,7 +5225,7 @@ ], "tips": [ [ - 0.0, + -0.0, 0.02131, 0.0 ], @@ -5385,18 +5385,18 @@ [ 0.0, 0.04148, - 0.0 - ], - [ - -0.0, - 0.04148, -0.0 ], [ - -0.0, + 0.0, 0.04148, 0.0 ], + [ + 0.0, + 0.04148, + -0.0 + ], [ 0.01816, 0.02605, @@ -5451,9 +5451,9 @@ -0.01622 ], [ - 0.04483, - 0.02814, - 0.02981 + 0.01608, + 0.02948, + 0.01247 ] ], [ @@ -5479,7 +5479,7 @@ ], [ 0.01469, - 0.03476, + 0.03475, -0.05242 ], [ @@ -5629,31 +5629,31 @@ }, { "DEF-skirt.011": 4.58106049623973, - "DEF-skirt.011.seg2": 7.206079765921628, + "DEF-skirt.011.seg2": 7.19317806733265, "DEF-skirt.L.002": 0.02658579166615116, "DEF-skirt.002.seg2": 0.012493393667064645, "DEF-skirt.002.seg1": 0.07562430091019157, "DEF-skirt.L.001": 1.879150088933239, "DEF-skirt.L.001.seg1": 0.060376459628942836, "DEF-skirt.002": 1.0432309729624893, - "DEF-skirt.seg3": 5.570096570820647, + "DEF-skirt.seg3": 5.544001124575805, "DEF-skirt.003.seg3": 1.3719167847603355, "DEF-skirt.005.seg2": 3.0893325526066313, "DEF-skirt.005.seg1": 1.0448083213115291, - "DEF-skirt.L.seg3": 0.6236902469398551, + "DEF-skirt.L.seg3": 0.6000672181866031, "DEF-skirt.005.seg3": 0.031181913198806976 }, { - "DEF-skirt.011.seg1": 7.206079765921628, + "DEF-skirt.011.seg1": 7.19317806733265, "DEF-skirt.L.002": 0.1453999495240184, "DEF-skirt.002.seg3": 0.11034352255838153, - "DEF-skirt.011.seg3": 2.7495159105118065, + "DEF-skirt.011.seg3": 2.7509932421896424, "DEF-skirt.002.seg2": 0.09621669328872662, "DEF-skirt.L.001.seg1": 0.8697016458385258, "DEF-skirt.002.seg1": 0.5566789920191999, "DEF-skirt.002": 0.6140337423742315, "DEF-skirt.L.001": 1.0570456406771491, - "DEF-skirt.L.seg3": 3.711280083702404, + "DEF-skirt.L.seg3": 3.703707791421389, "DEF-skirt.seg3": 2.8357110381653126, "DEF-skirt.005.seg2": 1.4663347373091402, "DEF-skirt.005.seg1": 0.06153290296288072, @@ -5666,7 +5666,7 @@ "DEF-skirt.L.002": 0.2979373224340631, "DEF-skirt.002.seg3": 0.8674111035481489, "DEF-skirt.L.001.seg1": 0.43628207869348157, - "DEF-skirt.011.seg2": 2.7495159105118065, + "DEF-skirt.011.seg2": 2.7509932421896424, "DEF-skirt.L.seg3": 4.602221938080493, "DEF-skirt.seg3": 0.14448731559887507, "DEF-skirt.005.seg2": 0.06419735157119555, @@ -5685,14 +5685,14 @@ ], "tips": [ [ - -0.0, + 0.0, 0.00893, -0.0 ], [ 0.0, 0.00893, - -0.0 + 0.0 ], [ 0.0, @@ -5752,9 +5752,9 @@ -0.00764 ], [ - -0.00168, - 0.00542, - -0.00286 + 0.00607, + 0.00733, + 0.00522 ], [ -0.002, @@ -5762,9 +5762,9 @@ -0.00032 ], [ - 0.00607, - 0.00733, - 0.00522 + -0.00168, + 0.00542, + -0.00286 ], [ -0.0029, @@ -5802,10 +5802,10 @@ [ -0.0, 0.04557, - -0.0 + 0.0 ], [ - 0.0, + -0.0, 0.04557, 0.0 ], @@ -5869,9 +5869,9 @@ -0.00884 ], [ - 0.02427, - 0.01958, - 0.0171 + -0.0011, + 0.01791, + 9e-05 ] ], [ @@ -6040,16 +6040,16 @@ 0.03801, 0.00021 ], - [ - 0.01613, - 0.03765, - 0.00756 - ], [ 0.06968, 0.02446, -0.07201 ], + [ + 0.01613, + 0.03765, + 0.00756 + ], [ 0.00073, 0.06811, @@ -6282,7 +6282,7 @@ -0.0 ], [ - 0.0, + -0.0, 0.01609, 0.0 ], @@ -6389,7 +6389,7 @@ "DEF-skirt.R.003.seg3": 0.1715765989223872, "DEF-skirt.R.004": 0.030876031930140435, "DEF-skirt.R.004.seg1": 0.020803836908132034, - "DEF-skirt.L.004": 0.22954852875263643, + "DEF-skirt.L.004": 0.22907211825039514, "DEF-skirt.L.004.seg1": 1.117666014626619, "DEF-skirt.R.005": 0.00681448318365796 }, @@ -6438,8 +6438,8 @@ -0.0 ], [ - -0.0, - 0.0568, + 0.0, + 0.05681, 0.0 ], [ @@ -6503,7 +6503,7 @@ ], [ [ - 0.08616, + 0.08615, 0.03472, -0.05979 ], @@ -6609,32 +6609,32 @@ ], "neighbours": [ { - "DEF-skirt.L.004.seg1": 4.0678154269769955, - "DEF-skirt.L.005": 0.22954852875263643, + "DEF-skirt.L.004.seg1": 4.0505432754151975, + "DEF-skirt.L.005": 0.22907211825039514, "DEF-skirt.L.001.seg2": 0.6736723993011002, "DEF-skirt.L.002": 0.808795880142356, "DEF-skirt.L.001.seg1": 0.8051463519527622, - "DEF-skirt.L.seg3": 3.793317002760232, + "DEF-skirt.L.seg3": 3.7163001012175743, "DEF-skirt.L.003": 0.21646333191305667, "DEF-skirt.L.seg2": 0.06935733543747569, - "DEF-skirt.L.003.seg3": 5.259879864898258, + "DEF-skirt.L.003.seg3": 5.172512625961911, "DEF-skirt.R.003.seg3": 0.845388225157766, - "DEF-skirt.L.003.seg2": 0.677365454643255, + "DEF-skirt.L.003.seg2": 0.6573735970229051, "DEF-skirt.seg3": 0.8155590405608446, "DEF-skirt": 0.19603096959511881, "DEF-skirt.seg2": 0.14029811314042995, - "DEF-skirt.L.003.seg1": 0.3003293425343978, + "DEF-skirt.L.003.seg1": 0.28033761075145813, "DEF-skirt.R.004": 0.13967539384350525, "DEF-skirt.seg1": 0.20676807425859 }, { - "DEF-skirt.L.004": 4.0678154269769955, + "DEF-skirt.L.004": 4.0505432754151975, "DEF-skirt.L.005": 1.117666014626619, "DEF-skirt.R.003.seg3": 1.9171418898471628, "DEF-skirt.L.004.seg2": 4.7309382362110455, "DEF-skirt.L.003.seg3": 7.552187895272386, "DEF-skirt.R.004": 1.5419089252454603, - "DEF-skirt.L.seg3": 0.9764221426855458, + "DEF-skirt.L.seg3": 0.9578381959761514, "DEF-skirt.R.004.seg1": 0.07202823700664285, "DEF-skirt.seg3": 0.029836616482513456 }, @@ -6956,7 +6956,7 @@ [ 0.0, 0.01912, - 0.0 + -0.0 ], [ 0.0, @@ -6974,7 +6974,7 @@ [ 0.0341, 0.01431, - 0.01315 + 0.01316 ], [ -0.02492, @@ -7033,15 +7033,15 @@ 0.00086, -0.03176 ], - [ - -0.04941, - 0.01002, - -0.03727 - ], [ -0.05337, 0.00801, -0.03246 + ], + [ + -0.04941, + 0.01002, + -0.03727 ] ], [], @@ -7071,23 +7071,23 @@ 0.07203, 0.03887 ], - [ - 0.03671, - 0.07206, - 0.03793 - ], [ 0.08118, 0.02596, 0.06289 ], + [ + 0.03671, + 0.07206, + 0.03793 + ], [ 0.01837, 0.09107, 0.02763 ], [ - 0.06065, + 0.06066, 0.04663, 0.05262 ], @@ -7151,14 +7151,14 @@ ], "tips": [ [ - -0.0, + 0.0, 0.0491, -0.0 ], [ -0.0, 0.0491, - -0.0 + 0.0 ], [ -0.0, @@ -7370,11 +7370,6 @@ "DEF-skirt.010.seg3" ], "tips": [ - [ - -0.0, - 0.02681, - 0.0 - ], [ -0.0, 0.02681, @@ -7385,6 +7380,11 @@ 0.02681, 0.0 ], + [ + 0.0, + 0.02681, + -0.0 + ], [ -0.04852, 0.01964, @@ -7418,20 +7418,15 @@ 0.01908, 0.01173 ], - [ - -0.05956, - 0.01926, - 0.01065 - ], [ 0.08341, 0.01978, -0.01491 ], [ - -0.03783, - -0.01771, - 0.0045 + -0.05956, + 0.01926, + 0.01065 ], [ 0.05915, @@ -7442,6 +7437,11 @@ -0.06175, 0.02156, -0.00635 + ], + [ + -0.03783, + -0.01771, + 0.0045 ] ], [ @@ -7538,7 +7538,7 @@ [ 0.0, 0.02818, - -0.0 + 0.0 ], [ 0.0, @@ -7546,9 +7546,9 @@ 0.0 ], [ - -0.0, + 0.0, 0.02818, - 0.0 + -0.0 ], [ -0.03619, @@ -7604,9 +7604,9 @@ 1e-05 ], [ - -0.07787, - 0.01952, - -0.02892 + 0.08904, + 0.01844, + -0.00264 ] ], [ diff --git a/characters/skinned_player_model.gd b/characters/skinned_player_model.gd index 51e9661..aceca8f 100644 --- a/characters/skinned_player_model.gd +++ b/characters/skinned_player_model.gd @@ -908,17 +908,27 @@ func set_weapon(script_path: String) -> void: # (weapon swap while toggled), else the new weapon comes up invisible. if (shadows_only or first_person_mode) and not _owner_visible: _set_shadows_recursive(w) - # Undo the first-person viewmodel placement from the weapon's _ready: - # lie along the hand's grip, scaled down to character proportions. - w.position = Vector3(-0.02, 0.07, 0.0) - w.rotation_degrees = Vector3(0, 90, -90) - w.scale = Vector3(1.0, 1.0, 1.0) - # Tell the pose layer the gun's axes in hand-bone space so it can - # aim the wrist to point the muzzle exactly where the player looks. + # Seat the weapon in the hand with NO hand-relative rotation. + # + # There used to be a fixed `rotation_degrees = (0, 90, -90)` here, which + # is the offset that happens to be right for the library's own DEF-hand.R + # and is wrong for every rig whose hand bone has a different roll. A bone + # attachment is expressed in the BONE's axes, and no two rigs agree on + # those, so a constant here mounts the gun differently on every character + # — which is what "the hand mount points are totally wrong on all models" + # was. + # + # It does not need to be right, because the pose layer aims the gun by + # rotating the WRIST until the weapon's forward axis lies on the aim line + # (see _apply_rifle_hold). Handing it the identity means "the gun's + # forward is the hand bone's -Z", which is true by construction on any + # rig, and the wrist then absorbs whatever that bone's roll happens to be. + # The grip is placed at the bone's origin below, so the gun sits IN the + # hand rather than at a fixed offset from a differently-oriented bone. + w.transform = Transform3D.IDENTITY if _pose_mod: - var b: Basis = w.transform.basis.orthonormalized() - _pose_mod.gun_fwd_hand = b * Vector3(0, 0, -1) - _pose_mod.gun_up_hand = b * Vector3(0, 1, 0) + _pose_mod.gun_fwd_hand = Vector3(0, 0, -1) + _pose_mod.gun_up_hand = Vector3(0, 1, 0) _measure_weapon(w) ) diff --git a/tools/retarget.py b/tools/retarget.py index aa96ef1..b79fc2f 100644 --- a/tools/retarget.py +++ b/tools/retarget.py @@ -413,6 +413,45 @@ def flatten_and_scale(arm, meshes, target_height, roles=None): print(f"Stood the character up: feet->hips ran along " f"{'XYZ'[k]}{'+' if d[k] > 0 else '-'}, rotated to Z+") + # TURN THE CHARACTER TO FACE THE SAME WAY AS EVERY OTHER CHARACTER. + # + # Which way a model faces is a property of the file, not a constant, and two + # separate things were guessing at it: facing_correction() aligns the rest + # pose to the library's, and the runtime then applies a blanket 180 degrees + # because "glTF forward is +Z". When a source disagrees with either, the two + # compose into a character who runs backwards, and nothing measured the + # result. Kiyoko shipped like that. + # + # The skeleton knows: toes are in front of ankles. Snap that to Blender -Y, + # which is the convention the rest of the pipeline and the runtime flip are + # built around, so every character leaves here pointing the same way whatever + # the source did. + if roles is not None: + fwd = Vector((0.0, 0.0, 0.0)) + n_f = 0 + for side in ("L", "R"): + a = arm.data.bones.get(roles.limb.get(("foot", side), "")) + t = arm.data.bones.get(roles.limb.get(("toe", side), "")) + if a and t: + fwd += (t.head_local - a.head_local) + n_f += 1 + if n_f: + fwd.z = 0.0 + if fwd.length > 1e-4: + fwd.normalize() + want = Vector((0.0, -1.0, 0.0)) + ang = math.atan2(fwd.x, -fwd.y) # signed yaw from -Y to fwd + # Snap to the nearest quarter turn: a rest pose with the feet + # slightly splayed must not be counted as a turn. + q = round(ang / (math.pi / 2)) * (math.pi / 2) + if abs(q) > 1e-6: + R = Matrix.Rotation(-q, 4, Vector((0.0, 0.0, 1.0))) + for obj in [arm] + meshes: + obj.matrix_world = R @ obj.matrix_world + apply_all() + print("Turned the character to face -Y: was %.0f degrees off" + % math.degrees(q)) + lo = Vector((1e9, 1e9, 1e9)) hi = -lo.copy() for m in meshes: