lsalzman / iqm

Inter-Quake Model format development kit
MIT License
239 stars 73 forks source link

Material reference gives NoneType #18

Closed EatMeReturns closed 8 years ago

EatMeReturns commented 8 years ago

When I was attempting to export, I had issues with "data.materials[matindex] giving NoneType and crashing the Blender v2.64 exporter (I'm running Blender v2.69 on Linux). I made the following quick fix at line #855:

matprefix = ((data.materials and data.materials[matindex]) and data.materials[matindex].name) or ''

The change in question is to check if data.materials[matindex] exists before referencing its name attribute.

lsalzman commented 8 years ago

Okay, fixed.