saturday06 / VRM-Addon-for-Blender

VRM Importer, Exporter and Utilities for Blender 2.93 to 4.1
https://vrm-addon-for-blender.info
MIT License
1.24k stars 141 forks source link

Bug report: Error on Export #403

Open Elwurd opened 5 months ago

Elwurd commented 5 months ago

I've made a model and rigged it to the VRM skeleton, but this error pops up and the export fails:

Python: Traceback (most recent call last): File "C:\Users\kyled\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\VRM_Addon_for_Blender-release\exporter\legacy_vrm_exporter.py", line 159, in export_vrm self.mesh_to_bin_and_dict() File "C:\Users\kyled\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\VRM_Addon_for_Blender-release\exporter\legacy_vrm_exporter.py", line 2030, in mesh_to_bin_and_dict morph_normal_diff_dict = self.fetch_morph_vertex_normal_difference( File "C:\Users\kyled\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\VRM_Addon_for_Blender-release\exporter\legacy_vrm_exporter.py", line 1654, in fetch_morph_vertex_normal_difference material = mesh_data.materials[polygon.material_index] IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

It's very possible, even likely that I've just done something wrong but I can't quite figure out what.

saturday06 commented 5 months ago

Thanks for reporting! I'll fix this bug over the weekend.

Elwurd commented 5 months ago

Oh sorry, I thought I had replied to this! I figured out what was causing it; The exporter errors if you try and export a mesh with no texture; I was making sure the mesh worked fine before I started texturing, but slapping on some plain white materials in blender worked just fine.

saturday06 commented 5 months ago

This export error (mesh with no texture and etc) was resolved with the latest version v2.20.25 just released. Thank you for your report.