AutoBone: Properly handle ratio output

This commit is contained in:
ButterscotchVanilla committed 2021-08-16 18:14:15 -04:00
1 parent 380ae27762
commit e1d17f61c4
2 files changed
+21 -10

No files matched your search

@@ -178,6 +178,26 @@ public class SkeletonConfig extends EJBag {
LogManager.log.info("[AutoBone] Done processing!");
//#region Stats/Values
Float neckLength = autoBone.configs.get("Neck");
Float chestLength = autoBone.configs.get("Chest");
Float waistLength = autoBone.configs.get("Waist");
Float hipWidth = autoBone.configs.get("Hips width");
Float legsLength = autoBone.configs.get("Legs length");
Float kneeHeight = autoBone.configs.get("Knee height");
float neckWaist = neckLength != null && waistLength != null ? neckLength / waistLength : 0f;
float chestWaist = chestLength != null && waistLength != null ? chestLength / waistLength : 0f;
float hipWaist = hipWidth != null && waistLength != null ? hipWidth / waistLength : 0f;
float legWaist = legsLength != null && waistLength != null ? legsLength / waistLength : 0f;
float kneeLeg = kneeHeight != null && legsLength != null ? kneeHeight / legsLength : 0f;
LogManager.log.info("[AutoBone] Ratios: [{Neck-Waist: " + StringUtils.prettyNumber(neckWaist) +
"}, {Chest-Waist: " + StringUtils.prettyNumber(chestWaist) +
"}, {Hip-Waist: " + StringUtils.prettyNumber(hipWaist) +
"}, {Leg-Waist: " + StringUtils.prettyNumber(legWaist) +
"}, {Knee-Leg: " + StringUtils.prettyNumber(kneeLeg) + "}]");
boolean first = true;
StringBuilder configInfo = new StringBuilder("[");
@@ -212,6 +232,7 @@ public class SkeletonConfig extends EJBag {
LogManager.log.info("[AutoBone] Average height error: " + StringUtils.prettyNumber(mean, 6) + " (SD " + StringUtils.prettyNumber(std, 6) + ")");
}
//#endregion
// Update GUI values after adjustment
refreshAll();
@@ -465,16 +465,6 @@ public class AutoBone {
float finalHeight = getHeight(configs);
LogManager.log.info("[AutoBone] Target height: " + targetHeight + " New height: " + finalHeight);
try {
LogManager.log.info("[AutoBone] Ratios: [{Neck-Waist: " + StringUtils.prettyNumber(configs.get("Neck") / configs.get("Waist")) +
"}, {Chest-Waist: " + StringUtils.prettyNumber(configs.get("Chest") / configs.get("Waist")) +
"}, {Hip-Waist: " + StringUtils.prettyNumber(configs.get("Hips width") / configs.get("Waist")) +
"}, {Leg-Waist: " + StringUtils.prettyNumber(configs.get("Legs length") / configs.get("Waist")) +
"}, {Knee-Leg: " + StringUtils.prettyNumber(configs.get("Knee height") / configs.get("Legs length")) + "}]");
} catch (Exception e) {
// I literally couldn't care less, this is only for debugging
}
LogManager.log.info("[AutoBone] Done! Applying to skeleton...");
if (!applyConfigToSkeleton(skeleton)) {
LogManager.log.info("[AutoBone] Applying to skeleton failed, only saving configs...");