Yet Another Blender Egg Exporter (YABEE)

coppertop, fixed UV image bug. I interpreted UV image as the texture, but UV image don’t have a flag about the texture’s type - i forgot about it.
Also added EXPORT_UV_IMAGE_AS_TEXTURE constant. To disable interpreting UV image as the texture set it to False.
I’ll add the ‘different files’ feature in next revision - it’s not too hard. )

drahun can you run Blender from console and inserted here the error message from console?

@Ninth

Thanks, that’s great :smiley:.

I run blender from command prompt. I try export animated model with the script. This the report:
read blend: D:\test-boks.blend
Traceback (most recent call last):
File “D:\test-boks.blend\blender25_egg_export.”, line 889, in
File “D:\test-boks.blend\blender25_egg_export.”, line 879, in write_out
File “D:\test-boks.blend\blender25_egg_export.”, line 101, in get_full_egg_str

File “D:\test-boks.blend\blender25_eqq_export.”, line 86, in get_full_egg_str
File “D:\test-boks.blend\blender25_eqq_export.”, line 588, in get_full_egg_str

File “D:\test-boks.blend\blender25_egg_export.”, line 579, in get_joints_str
AttributeError: ‘NoneType’ object has no attribute ‘data’

Well? I am not sure if it’s what you want to know.

Hm, look like an armature hasn’t any bones in the bone dict. What kind of bones type do you use?
---- edit
Ah, no, i was wrong. Error talk me, that object in the Armature modifier == None. Please, check it.

Ah, no, i was wrong. Error talk me, that object in the Armature modifier == None. Please, check it.

You were right. After I check that, I successfully export the model. The texture, the animation, play nice in panda.

can’t wait the script possible export more complex from blender.

Update. Rev 10.
Changes:

  • Models that are attached directly to bone without any modifiers are now exported as part of an animated mesh
    [Attaching to Joint)
  • First UV channel is now stored without name to use as default
  • Auto-creating subdirs if not exists while writing egg file
  • Copying texture images in the specified subdir, relative to the EGG file (not fully tested, may contain bugs - check console output)
  • Recording the animation in separate files
  • Setting the number of sign after point for store in the file

Good progress.
Any plans for glow/gloss/normal/parallax maps support? And Im not sure if it already supports Empty objects?

Yes, i’ll plan to work with textures type

Any unsupported (including Empty) objects are exported as empty group with transforms.

I try to export a character with a bit complex polygon but no armature using YABEE rev 10, and got this: IndexError: tuple index out of range
What’s happened? I try with rev 7 and successfully.

Please, insert here full error text from console.

Okay, here they are:

found bundled python: D:\MMORPG~2\PROGRA~1\BLENDE~1\Blender\2.57\python
read blend: D:\tempat\Lat-001\models\sarah41.blend
Traceback (most recent call last):
  File "D:\tempat\Lat-001\models\sarah41.blend\yabee.py", line 33, in <module>
    write_out(FILE_PATH, ANIMATIONS)
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 891, in write_out
    file.write(get_egg_materials_str())
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 666, in get_egg_materials_str
    for name, path in get_used_textures().items():
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 622, in get_used_textures
    tex_list[f.image.name] = (uv.name, bpy.path.relpath(f.image.filepath))
  File "D:\MMORPG~2\PROGRA~1\BLENDE~1\Blender\2.57\scripts\modules\bpy\path.py",
 line 53, in relpath
    return "//" + _os.path.relpath(path, start)
  File "D:\MMORPG~2\PROGRA~1\BLENDE~1\Blender\2.57\python\lib\ntpath.py", line 6
22, in relpath
    raise ValueError(error)
ValueError: path is on mount 'E:', start on mount 'D:'
Traceback (most recent call last):
  File "D:\tempat\Lat-001\models\sarah41.blend\yabee.py", line 33, in <module>
    write_out(FILE_PATH, ANIMATIONS)
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 891, in write_out
    file.write(get_egg_materials_str())
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 666, in get_egg_materials_str
    for name, path in get_used_textures().items():
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 622, in get_used_textures
    tex_list[f.image.name] = (uv.name, bpy.path.relpath(f.image.filepath))
  File "D:\MMORPG~2\PROGRA~1\BLENDE~1\Blender\2.57\scripts\modules\bpy\path.py",
 line 53, in relpath
    return "//" + _os.path.relpath(path, start)
  File "D:\MMORPG~2\PROGRA~1\BLENDE~1\Blender\2.57\python\lib\ntpath.py", line 6
22, in relpath
    raise ValueError(error)
ValueError: path is on mount 'E:', start on mount 'D:'

importing obj 'D:\\mmorpg-project\\3d\\Garapan\\Sarah\\n901.obj'
        parsing obj file...
2.8910 sec
        loading materials and images...
        b'D:\\mmorpg-project\\3d\\Garapan\\Sarah\\n901.obj':b'Ke 0.0000 0.0000 0
.0000' (ignored)
        b'D:\\mmorpg-project\\3d\\Garapan\\Sarah\\n901.obj':b'Ke 0.0000 0.0000 0
.0000' (ignored)
        b'D:\\mmorpg-project\\3d\\Garapan\\Sarah\\n901.obj':b'Ke 0.0000 0.0000 0
.0000' (ignored)
        b'D:\\mmorpg-project\\3d\\Garapan\\Sarah\\n901.obj':b'Ke 0.0000 0.0000 0
.0000' (ignored)
        b'D:\\mmorpg-project\\3d\\Garapan\\Sarah\\n901.obj':b'Ke 0.0000 0.0000 0
.0000' (ignored)
2.3120 sec
        building geometry...
        verts:16493 faces:24005 materials: 6 smoothgroups:19 ...
finished importing: b'D:\\mmorpg-project\\3d\\Garapan\\Sarah\\n901.obj' in 7.454
0 sec.
blend_file_thumb failed to create thumbnail: unknown
Traceback (most recent call last):
  File "D:\mmorpg-project\3d\Garapan\sarah41.blend\yabee.py", line 33, in <modul
e>
    write_out(FILE_PATH, ANIMATIONS)
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 891, in write_out
    file.write(get_egg_materials_str())
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 670, in get_egg_materials_str
    if path[2] != 'MODULATE':
IndexError: tuple index out of range
Traceback (most recent call last):
  File "D:\mmorpg-project\3d\Garapan\sarah41.blend\yabee.py.001", line 33, in <m
odule>
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 891, in write_out
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 670, in get_egg_materials_str
IndexError: tuple index out of range
read blend: D:\mmorpg-project\3d\Garapan\Sarah\sarah41.blend
Traceback (most recent call last):
  File "D:\mmorpg-project\3d\Garapan\Sarah\sarah41.blend\yabee.py", line 33, in
<module>
    write_out(FILE_PATH, ANIMATIONS)
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 891, in write_out
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 670, in get_egg_materials_str
IndexError: tuple index out of range
Traceback (most recent call last):
  File "D:\mmorpg-project\3d\Garapan\Sarah\sarah41.blend\yabee.py", line 33, in
<module>
    write_out(FILE_PATH, ANIMATIONS)
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 891, in write_out
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 670, in get_egg_materials_str
IndexError: tuple index out of range
Traceback (most recent call last):
  File "D:\mmorpg-project\3d\Garapan\Sarah\sarah41.blend\yabee.py.001", line 33,
 in <module>
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 891, in write_out
  File "D:\mmorpg-project\Program Files\Blender Foundation\Blender\YABEE\yabee_l
ibs\egg_writer.py", line 670, in get_egg_materials_str
IndexError: tuple index out of range

It’s not rev 10. Try to download the script again, and fully replace old script.

will this work with blender 2.58? I may be using it wrong because when i run the script I get no errors but nothing is exported to my specified location. I’ll keep on trying in the meantime. thank you

It’s should work with 2.58.
If you used last revision (10), then you may check the console. The script should display the full path where he writed file: “WRITE main EGG to …”
Also it can be a problem with permissions to the output folder.
You can specify relative path to output egg: ‘./my_file.egg’/ In this case script should write file to the user’s home directory, for example ‘C:\Documents and settings\user_name\my_file.egg’ for XP/2000 or ‘/home/user_name/my_file.egg’ for linux.
And lastly, if you set ANIM_ONLY = True and you have no animated model, then there is nothing to write )

works like a charm, I had forgotten to select the object and changed the location to a more sense making one. Thank you very much ! :smiley:

I can’t seem to get yabee 7 or 10 to install in Blender 2.58. If I place it in my addons folder and use ctrl-alt-u it doesn’t show up in the list. If I manually install it I get no error warnings but it doesn’t appear in my export dialog.

I would just go back to Blender 2.4x and use chicken but it’s too deprecated for my current project. Also, using the X format and converting through Panda works but the file size and computational expense makes that method impractical when dealing with complex models.

See instructions in first post. I do not do the installation / integration as I continue to make changes to the script.

Ninth, would you have any objections to me posting a temporary gui and installer for Yabee rev 10? I made it for my own personal use but I thought others as lazy as myself might be interested.

Quick Question: How do we actually use this?
I am a complete newbie and I have absolutely no Blender .egg exporting/script using knowledge in Blender.

j.edgar, You are free to make any changes and publish them :slight_smile:

sukiwater, script does not require installation. Just open it in th Blender’s text editor and run them