blender-to-gmstudio / blender-to-smf

Import-Export of Blender model from/to SMF model format
MIT License
11 stars 2 forks source link

float division by zero when all four group weights are zero #14

Closed bartteunis closed 3 years ago

bartteunis commented 3 years ago
Traceback (most recent call last):
  File "C:\Users\<user>\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blender-to-smf\__init__.py", line 108, in execute
    return export_smf(self, self.filepath, context, self.export_textures, self.export_nla_tracks, self.export_type, self.mult, self.subdivisions)
  File "C:\Users\<user>\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blender-to-smf\smf.py", line 264, in export_smf
    w = group.weight/s*255
ZeroDivisionError: float division by zero

location: <unknown location>:-1
bartteunis commented 3 years ago

The current fix in Blender is to select the MESH type objects that this applies to, go to Weight Paint mode and use Weights > Clean. Use All Groups as Subset. Limit can be left at 0.000.