triazo / immersive_scaler

VRChat correct proportions, made easy in blender.
MIT License
122 stars 6 forks source link

Avzomend can't be rescaled, with scale to eyes is set to true target height is detected as negative #18

Closed Asovrix closed 1 year ago

Asovrix commented 1 year ago

This is unrelated to my previous issue. Rindo model that I use can be scaled completely fine (although it requires manual bone mapping). Model that I am trying to adjust is Avzomend: https://yorshkasencho.booth.pm/items/4118550 I can't really tell what might be causing issues by looking at armature, I even did some manual adjustments to the rig, since by default it has several issues. Bones have been mapped manually.

Blender version: 3.4.1 CATS version: latest development https://github.com/absolute-quantum/cats-blender-plugin/commit/d837be3688da748444bc5ae06e902cf4f0477129 Immersive scaler: latest as of writing this message Error message, happens regardless of Scale to Eyes setting:

TypeError: must be real number, not complex
Error: Python: Traceback (most recent call last):
  File "C:\Users\Asovrix\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\immersive_scaler\operations.py", line 630, in invoke
    return self.execute(context)
  File "C:\Users\Asovrix\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\immersive_scaler\operations.py", line 612, in execute
    rescale_main(self.target_height, self.arm_to_legs / 100.0, self.arm_thickness / 100.0, self.leg_thickness / 100.0, self.extra_leg_length, self.scale_hand, self.thigh_percentage / 100.0, self.custom_scale_ratio, self.scale_eyes, True )
  File "C:\Users\Asovrix\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\immersive_scaler\operations.py", line 512, in rescale_main
    scale_to_floor(arm_to_legs, arm_thickness, leg_thickness, extra_leg_length, scale_hand, thigh_percentage, custom_scale_ratio, legacy)
  File "C:\Users\Asovrix\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\immersive_scaler\operations.py", line 366, in scale_to_floor
    arm_scale_ratio = calculate_arm_rescaling(arm, rescale_arm_ratio, legacy)
  File "C:\Users\Asovrix\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\immersive_scaler\operations.py", line 256, in calculate_arm_rescaling
    arm_change = (math.sqrt((head_arm_change * total_length - neck_length) * (head_arm_change * total_length + neck_length)) / arm_length) - (shoulder_length / arm_length)
TypeError: must be real number, not complex
Asovrix commented 1 year ago

Turns out I was using older version of IMScale (0.3.0). Issue originally is caused because of both meshes and armature having unapplied rotations and scale. Version 0.3.1 and onwards are not affected by this issue.