From e1d17f61c4d40262e7f0bbca334d5de86409f442 Mon Sep 17 00:00:00 2001 From: ButterscotchVanilla Date: Sat, 14 Aug 2021 08:42:35 -0400 Subject: [PATCH] AutoBone: Properly handle ratio output --- .../java/io/eiren/gui/SkeletonConfig.java | 21 +++++++++++++++++++ .../java/io/eiren/gui/autobone/AutoBone.java | 10 --------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/main/java/io/eiren/gui/SkeletonConfig.java b/src/main/java/io/eiren/gui/SkeletonConfig.java index 16f8cf21a..17c377009 100644 --- a/src/main/java/io/eiren/gui/SkeletonConfig.java +++ b/src/main/java/io/eiren/gui/SkeletonConfig.java @@ -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(); diff --git a/src/main/java/io/eiren/gui/autobone/AutoBone.java b/src/main/java/io/eiren/gui/autobone/AutoBone.java index 388b5b488..326c9bce5 100644 --- a/src/main/java/io/eiren/gui/autobone/AutoBone.java +++ b/src/main/java/io/eiren/gui/autobone/AutoBone.java @@ -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...");