FlailingFog / KK-Blender-Porter-Pack

Plugin pack for exporting Koikatsu characters to Blender.
Other
356 stars 30 forks source link

KKBP tries to divide by 0 in 7.0.0 #571

Closed StShAzzy closed 2 weeks ago

StShAzzy commented 3 months ago

it's Chika Haruno (KKS default char)

Koikatsu Sunshine with HF Patch 1.19 KKBP 7.0.0 (so newest version at the time of writing this) Windows 10 22H2 64-bits Blender 3.6.13


Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\modifymesh.py", line 47, in execute
    self.create_tear_shapekeys()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\modifymesh.py", line 609, in create_tear_shapekeys
    middle_of_head = loc / len(selected_verts)
ZeroDivisionError: division by zero

Error: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\modifymesh.py", line 47, in execute
    self.create_tear_shapekeys()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\modifymesh.py", line 609, in create_tear_shapekeys
    middle_of_head = loc / len(selected_verts)
ZeroDivisionError: division by zero

Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\importbuttons.py", line 97, in execute
    function()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\importbuttons.py", line 69, in <lambda>
    lambda:bpy.ops.kkbp.modifymesh('INVOKE_DEFAULT'),
  File "F:\Users\USER\Downloads\temp\blender-3.6.13-windows-x64\3.6\scripts\modules\bpy\ops.py", line 111, in __call__
    ret = _op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Error: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\modifymesh.py", line 47, in execute
    self.create_tear_shapekeys()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KKBP700\importing\modifymesh.py", line 609, in create_tear_shapekeys
    middle_of_head = loc / len(selected_verts)
ZeroDivisionError: division by zero```
FlailingFog commented 3 months ago

Hi, I am making KKBP 7.0.0 compatible for Blender 4.2 LTS Beta. Can you try it on that version instead? I am not seeing any import errors in that version.

StShAzzy commented 3 months ago

i'll try it soon

StShAzzy commented 3 months ago

ok, so now Chika Haruko works, but it seems there's a specific eyebrow that causes the process to fail

          Make sure the default model imports correctly before troubleshooting on this model!

Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\modifymaterial.py", line 60, in execute
    self.link_textures_for_body()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\modifymaterial.py", line 509, in link_textures_for_body
    self.image_load('KK Eyebrows (mayuge)', 'Gentex', 'Eyebrow', self.body['SMR materials']['cf_O_mayuge'][0] + '_MT_CT.png')
                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: only strings are allowed as keys of ID properties

Error: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\modifymaterial.py", line 60, in execute
    self.link_textures_for_body()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\modifymaterial.py", line 509, in link_textures_for_body
    self.image_load('KK Eyebrows (mayuge)', 'Gentex', 'Eyebrow', self.body['SMR materials']['cf_O_mayuge'][0] + '_MT_CT.png')
                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: only strings are allowed as keys of ID properties

Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\importbuttons.py", line 97, in execute
    function()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\importbuttons.py", line 71, in <lambda>
    lambda:bpy.ops.kkbp.modifymaterial('INVOKE_DEFAULT'),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Users\USER\Downloads\temp\blender-4.2.0-beta+v42.c94bed9afa0d-windows.amd64-release\4.2\scripts\modules\bpy\ops.py", line 107, in __call__
    ret = _op_call(self.idname_py(), kw, C_exec, C_undo)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\modifymaterial.py", line 60, in execute
    self.link_textures_for_body()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\KKBP700\importing\modifymaterial.py", line 509, in link_textures_for_body
    self.image_load('KK Eyebrows (mayuge)', 'Gentex', 'Eyebrow', self.body['SMR materials']['cf_O_mayuge'][0] + '_MT_CT.png')
                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: only strings are allowed as keys of ID properties

seems the problem is a eyebrow? i'll try narrowing down the possible causes

StShAzzy commented 3 months ago

this card can trigger it, and what's different on it? the eyebrows! pretty goofy

card.zip