Problem with EGG exporting(regarding material)

I’m using Blender 2.46(but had the same problem with 2.49), and my model is exported pretty well(a very simple model, three spheres, one witha few tweakings… simple thing).

But when I enable materials(just to put some color on my humble model), I get an error:

Traceback (most recent call last):
  File "<string>", line 876, in button
  File "<string>", line 732, in fExport
  File "<string>", line 386, in doExport
  File "<string>", line 1454, in __init__
  File "<string>", line 997, in __init__
AttributeError: 'Blender Material' object has no attribute 'enabledTextures'

I’m very new with this so… anyone can direct me to a solution, please?

Well, that is an interesting one - never seen that before, and according to the Blender reference that can’t happen, so this might in fact be a Blender bug!

My first question is what textures do you have on your model? Also, are they all disabled? If you do have any they need to be uv mapped with textures saved to the disk, though neither of those mistakes results in this error, at least not that I have ever encountered!

It might be helpful you you to just email it to me or post a link - I’ld spot what is wrong in an instant, which is easier than me doing 20 questions here.

I think I wasn’t clear, but I’m using no textures, just materials(i.e., setting no textures, just color, reflection, et cetera). I didn’t even had my UV unwrapped back then. So, obviously, all textures are disabled.

I just noticed a detail that might be important, that I have blender 2.5 installed as well(though I’m almost sure the scripts are the ones installed by the 2.46 .deb installer). While I can’t send you my model now(because I’m not home), any other guesses?

The line of code that is causing the crash is in a loop that is looping over the textures applied to the object. If you had no textures then the line of code in question would never be run, hence why I asked if you had any disabled textures, because it seems extremely unlikely that blender would think it had a texture when it does not, and you might have a disabled texture which still gets looped over. The precise line of code that fails is in fact checking if the texture is disabled, to skip including the texture if it is.

Blender 2.5 doesn’t interact with the previous versions, so you should be safe in that regard. Its not like 2.5 could even begin to run chicken anyway - everything has changed, so you would get far earlier errors.

Anyway, I don’t really have enough information, so its easiest to wait till you can send me the file.

I’m sending it right now. Hopefully, we’ll find out what the problem is…

Okay, so I sent the model to lethe, and then I uninstalled Blender, cleared my .blender folder and tried again… it worked. Except it was being exported without the materials(completely uncolored), and if I use the same model I sent lethe before(I downloaded it again from the same email I sent), it keeps giving the same error.

Just to remember:

Traceback (most recent call last):
  File "<string>", line 876, in button
  File "<string>", line 732, in fExport
  File "<string>", line 386, in doExport
  File "<string>", line 1454, in __init__
  File "<string>", line 997, in __init__
AttributeError: 'Blender Material' object has no attribute 'enabledTextures'

It also seems to be duplicating my meshes. If anyone want to take a look, I can send the model and you can check it out, but I’m still clueless. =/

Update: it turns out I was linking the materials to the objects instead of the meshes, which causes them to be material-less. But if I do it right(linking the materials to the mesh) it gives me that error. :frowning:

Ok, I still have no idea what your problem is - the error makes no sense as I said, but I’ve reorganised the code slightly in a way that means it should fail another test before ever getting to the test that is causing the crash (Even though that test can not fail like that according to the Blender manual!). Anyway - try this version http://thaines.net/content/panda3d/chicken_exportR91b.zip - it might work, but as I said its a total guess.

This is freaky, it’s actually working now!

Well, looking at the bright side, I have a working solution. Now it’s a matter of investigating the code deeper and try to debug it(since it’s a very specific error to me, I guess I gotta be the one to find its cause).

Thanks a lot of a bunch! :smiley: