pumbaaho / blender2ogre

Automatically exported from code.google.com/p/blender2ogre
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Obsolete alpha work-around crashes #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It was some time since I fixed this in my private copy of the exporter now, so 
I don't remember the exact circumstances that gives rise to this bug, but 
sometimes the exporter will crash on the following line:

    if (slot.texture.image is not None) and (slot.texture.image.use_alpha): usealpha = True; break

(This is line 7017 in the version of io_export_ogreDotScene.py I'm currently 
looking at.)

As it seems, slot.texture.image is None under some circumstances, which makes 
this line crash as it looks up use_alpha on None.

Interestingly, the resulting `usealpha' variable is never even used (the line 
that used to use it is commented out), so it seems completely unnecessary to 
begin with. Simply removing the whole block fixed the problem for me with no 
obvious ill effects.

I have attached the patch I used to fix it.

Original issue reported on code.google.com by dolda2...@gmail.com on 9 Aug 2014 at 5:42

Attachments: