Yet Another Blender Egg Exporter (YABEE)

Fixed )
Yes, i forgot to import os )

Bamboo_Pandamonium, try actor.ls() and look at the hierarchy for your joint

Okay, this worked better for me. The model animates and looks like it’s supposed to instead of a plane, but for some reason parts of it are stretched and deformed. It also gets larger. Only when it animates, though – as a still model, it looks fine.

Could it have something to do with the weight painting? I noticed the parts I have weighted at about 1.0 stay intact. Do I have to go back and set all the weights to 1.0?

I’m sorry I keep posting about this. I’m just really glad someone’s working on this. I’d help if I were better at programming. :blush:

@ninth

I haven’t had a chance to try out the animation export yet, but I just wanted to tell you that you are my new hero. Seriously. Thanks.

@Bamboo_Pandamonium

Just some thought that came to my mind – do you have any scale (in object mode) applied to the model or the skeleton? What you described sounds like a scaling problem. Although, that’s just a long shot.

@ninth
Would you mind adding some docstrings? Some of the functions aren’t that self-explaining.

I’ll upload the code to github once it’s ready (as in working and feature-complete).

By the way, what’s the license? Sorry if it was mentioned already and i missed it.

and thanks again hundred times :slight_smile:

I think I found a bug - the “” with the " {1}" should not contain an inverse transformation matrix.
I updated the script.

I will try to add a docstrings, but with my knowledge of the English it may be quite ugly )

As for the license - I think that with BSD all should be satisfied )

No problems, but I would like to thank you for your great efforts, ninth!

Thanks. I’m glad that my work was useful )


Added some docstrings.
Added NURBS Curve export. Supported only the non cyclic NURBS Curve.

Added tangent and binormal generation for the normalmapping. Need testing.
Result

Don’t forget to assign your material to the mesh faces.
To export a texture as the normalmap:

Gonna test as soon as I can find a moment but in the meantime, don’t you think this thread deserves to be made sticky?

Well, may be :slight_smile: It seems that my script grows up to named as the exporter :slight_smile:

I’m gonna have to take some time to learn my ways through Blender 2.5, I guess, because ATM I feel a little bit lost in there. The power of habits, I suppose. So it might be something wrong on my part.

This is the message I get on the console when trying to export a cube with one material and two textures – color and normal:

Traceback (most recent call last):
  File "/home/coppertop/Development/yabee/cube.blend/yabee.py", line 33, in <module>
    write_out(FILE_PATH, ANIMATIONS)
  File "/home/coppertop/Development/yabee/yabee/yabee_libs/egg_writer.py", line 891, in write_out
    file.write(get_egg_materials_str())
  File "/home/coppertop/Development/yabee/yabee/yabee_libs/egg_writer.py", line 670, in get_egg_materials_str
    if path[2] != 'MODULATE':
IndexError: tuple index out of range

The way I assigned the material and the textures is as follows:

  • UV mapped the object (obviously)
  • Left the default material on the object.
  • Added a color texture from image. Set it to UV coords. Left all other options intact.
  • Added a normal texture from image. Set it to UV coords. Set the Influence options to Norm while removing selection from Color there.

I’m not sure what it means to “assign material to mesh faces”. Does it mean just setting a material on the object, or is something else required here?[/list]

Each face may have one or more materials and textures assigned.

Yeah, I understand that. This is what the Assign button is for when in edit mode, yes. That’s the same as Blender 2.49. What I was asking is if there’s anything additional that needs to be done. I guess I should have written it more clearly :slight_smile:.

No, it’s all you need.
I repeated your steps and didn’t have any problems. Can you upload your file or send me at e-mail (in PM)?

I create a box, add armature, and animate it. I export with the script, the egg file created. I try to use it in panda, a window open with only gray blank background, but the model not show.I opened egg file with text editor and found this:
{ Z-up }
Armature {
}

What’s the mistake?
[/code]

I think that you select an Armature instead of the mesh object before exporting. Try to select the “box”.

I could, but it turns out it won’t be needed :slight_smile:. I found where the problem was (or, more precisely, what was causing it) and it was, simply, one of my habits.

When exporting, I had a texture opened in the UV window. I wanted to make sure I’ve unwrapped the box correctly to fit the texture. It looks like the exporter was somehow confused by that.

When I removed the image from the UV window, it exported nicely and cleanly. Works flawlessly (at least for this simple case).

Now I just need to make myself an animation that I could export and test that part with.

Again, thank you very, very much for making this exporter.

Thanks for test ) I’ll check and fix the assumption about the UV window, if possible.

Ok, I’ve tested the animations and, for the simplest case (two bones using vertex groups), they work with no problems at all. Tested with Blender 2.58.1 r38019.

However, I would like to humbly request that you consider making it possible to export animations into different files. That’s a useful thing to have, sometimes.

Anyway, today is the day I finally say “good bye” to Blender 2.49.

I try to export again. i select the mesh object (box) and try to export it to flash disk (drive d:), but script failed with the message: look the python console.
egg file is created. Here in the text editor:

<CoordinateSystem> { Z-up } 

What’s wrong?