The Blitz3D 'Export Project' wants YOU!

Blitz3D Forums/Blitz3D Programming/The Blitz3D 'Export Project' wants YOU!

Prehaps this can be stickied?!?

Possible community project

What i am trying to do:
Compile an entire suite of SOLID, reliable exporters for b3d together in one place(here?) for tools developers (theyre a bit spread out in the codearcs & not all are fully functional).

Im after ones that can save images etc. and mesh ones that can not only simply save a mesh, but export everything exactly 'as is' from a mesh with children, all attached to a parent pivot, complete with as many supported features (all surfs, textures, uvs, normals, color, alpha, blend, fx, specular etc.) as possible/are supported by the format.

If anyone has complete Static & animated exporters for X, OBJ, B3D, COB, LWO, or any others and they work in the way described above, please add, stating the limitations/functions.

Please put all improvement posts/comments in the relevent codearcs pages to keep the topic clean

Importers are also welcome :)

The list so far:
-----------------------------------------------------------
TYPE: STATIC DIRECTX(Complete mesh hierachy) by dan at D-Grafix
www.blitzbasic.com/codearcs/codearcs.php?code=1906

It saves a complete mesh hierachy with texture refs, meshnames, colors, alpha, normals, MT Matricies etc. (cant get rid of specular shininess though (dont know which one it is and shine appears black!)
(thanks to shambler, i used your file template code for a guide to the X format:) Note for blender, remove all texture refs and giles doesnt seem to like the vertex color section (may cause vertex color 'rainbows')

------------------------------------------------------
TYPE: ANIMATED DIRECTX by B32
www.blitzbasic.com/codearcs/codearcs.php?code=1740

Limitations are: meshes don't work without using LoadAnimMesh, because the static versions are all placed at 0,0,0.
Another thing is, that it sometimes exports 'NAN' as a float, and some importers can't deal with it, so they have to be replaced with zeros
And, Blender doesn't load this file, because the Materials tag is incomplete. saves surfs, textures, uvs, normals
doesn't save: color, alpha, blend, fx, specular

-----------------------------------------------------
TYPE STATIC B3D (Single Mesh) by JFK
www.melog.ch/dl/saveb3d_2007a.zip

Can save only one mesh at a time, may be modified (parallel nodes in file). Due to the nature of it, it isn't SOLID nor ROBUST, nor CLEAN or BUGFREE at all, use at your own risk :) At least, it used to save a big map that was exported by giles "AS IS". The source also contains some info on how to save lights that can be read by giles.
There may be a problem with redundant texture references. I doubt it causes a memory leak, but if it does then I'd be glad if somebody's gonna help to debug it. (the problem is mentioned in the code) Make sure to read the notes in the source.


------------------------------------------------------------
TYPE: X & B3D import/export By Devils Child
dc.chat-blitz.de/upload/files/Devils%20Child/[x]port.zip
its a framework with 3ds/b3d/x import and x export.



------------------------------------------------------
OTHERS (Not reported on/sorted yet) thankx b32:


These were all the links I could find in the archives:
Save X
www.blitzbasic.com/codearcs/codearcs.php?code=1906
Save 3DS
www.blitzbasic.com/codearcs/codearcs.php?code=1815
Save Anim B3D
www.blitzbasic.com/codearcs/codearcs.php?code=1794
SaveAnimFile
www.blitzbasic.com/codearcs/codearcs.php?code=1740
SingleFile
www.blitzbasic.com/codearcs/codearcs.php?code=1500
ASC saver
www.blitzbasic.com/codearcs/codearcs.php?code=1033
Save B3D
www.blitzbasic.com/codearcs/codearcs.php?code=866
ASE->B3D
www.blitzbasic.com/codearcs/codearcs.php?code=707
Save .X multisurface
www.blitzbasic.com/codearcs/codearcs.php?code=631
Save .X single surface
www.blitzbasic.com/codearcs/codearcs.php?code=111
Animb3D
www.blitzbasic.com/codearcs/codearcs.php?code=1764
B3D->XML->B3D
www.blitzbasic.com/codearcs/codearcs.php?code=665
import .cob/.scn
www.blitzbasic.com/codearcs/codearcs.php?code=335
Save DDS
www.blitzbasic.com/codearcs/codearcs.php?code=1813
Import OBJ
www.blitzbasic.com/codearcs/codearcs.php?code=1323
Load Giles .gls
www.blitzbasic.com/codearcs/codearcs.php?code=1134
Convert .X/.3DS->.B3D
www.blitzbasic.com/codearcs/codearcs.php?code=342
Save .TGA
www.blitzbasic.com/codearcs/codearcs.php?code=1
Save Stevies format :)
www.blitzbasic.com/Community/posts.php?topic=26973#283228
Save FLE
www.blitzbasic.com/toolbox/toolbox.php?tool=167
Save 3DS
www.blitzforum.de/forum/viewtopic.php?t=20214&sid=9a9fdb3fe33470707f7c5c86e7b63b82
DX8->B3D
www.blitzbasic.com/toolbox/toolbox.php?tool=64



.

I made an .x exporter too, with animation support:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1740
Limitations are: meshes don't work without using LoadAnimMesh, because the static versions are all placed at 0,0,0.
Another thing is, that it sometimes exports 'NAN' as a float, and some importers can't deal with it, so they have to be replaced with zeros
And, Blender doesn't load this file, because the Materials tag is incomplete.
I have worked on this, but I made it fit my own program. However it would be nice to update it sometime.
saves surfs, textures, uvs, normals
doesn't save: color, alpha, blend, fx, specular

You know it's pretty easy to write a B3D mesh file. It's much harder to obtain information about a brush (fx, alpha, blendmode etc.) or about a texture (blend, flags, scale, rotation...) wich is required when you want to save a mesh that is stored in memory as a blitz mesh entity.

In this thread:
http://www.blitzbasic.com/Community/posts.php?topic=66551
I have released all my current "wisdom" about B3D export in Blitz3D. Based on those infos I used to write a static B3D exporter that actually works well. It is woven deeply into my app code, right now I ain't got the nerves to extract it, maybe later.

I was thinking about writing an .OBJ exporter (lightwave). That format is pretty basic. It would be handy, because there are a lot of programs that can import it. However, it doesn't support much more than basic vertex/triangle information.
And I would like to make a more complete version of the animated .x exporter. Entityshininess/mesh color support would be nice. And maybe use the binary .x format instead of the text version.
Another idea would be making an importer, that converts other formats into .b3d before loading. I believe the newer versions of the .x format support vertex weights? Maybe it is possible to first convert such a file into a .b3d and then load it?
For my own project, the .obj exporter and the animated .x exporter would be handy, so I would mainly like to focus on those.

sounds a good idea binary would be great to save on huge filesize, but is difficult to debug.

"OBJ (lightwave)"
i though obj was wavefront and lwo was lightwave. could be wrong.

Well, i think the main pain about writing a .b3d exporter, was as jfk says, the brushes and textures. I also found a problem with finding the scaling and rotation of textures applied to a mesh. You can obviously read a .b3d file from the hard disc and find it's texture scale and rotation, but it would be a bit hard to read .x and .3ds files for this information.

You would also need the user to store his information, if he's coding an editor, in a certain way, so it can be retreived, because some information cannot be taken from meshes just using the blitz3d commands. Good luck and i'll try and help out when i get home.

I have updated the animated .x exporter. The transform matrix was not exported correctly. So, now the files can be loaded with LoadMesh as well.
www.blitzbasic.com/codearcs/codearcs.php?code=1740

Ross - yes you may read scaling and rotation etc. directly from the file, but I think it' smuch more handy to get them from the loaded entity, this way you can use all the powerful commands, like AddMEsh and so on, and then finally save the entity as it is displayed onscreen (see the thread I mentioned, scale and rotation can be retrieved)

I agree jfk. I can at present save a supposed unlimited number of meshes to a .b3d file. BUT, the big problem is the texture list. When saving a .b3d file, you must list all the textures and brushes at the beginning of the file. SO, you'd need to first of all scan through every mesh, grab the brush's and texture's, and store them, then proceed to save.

The actual saving of the mesh(es) is easy and could be easily done with a recursive function. The hardest part is the textures/brushes.

I don't have much of an interest for saving animated entities. You would need the bones and weightings, which are currently not possible to get from the entity structure.

Another thought. I remember Beaker mentioning, parenting everything to a parent. Now, upon saving, you simply perform a recursive function, using FindChild. You should be able to search every entity without the use of types.

I think it's possible to save multiple meshes in one B3D file using multiple (nested?) Nodes. Not sure if you can access the meshes as children. I guess you'd have to load them with LoadAnimMesh. Parsing the hierarchy recursively would also allow to seperate pivots from meshes using the EntityClass$(). Not sure if you have to/can nest the nodes.

Personally I never use this, because my editors first use AddMesh to unify the map to a single mesh with an optimized number of surfaces. a modified version of the SaveB3D from the code archives is used. Basicly the addition is little, just obtain the brush and tedxture properties as mentioned and use them instead of the static values of the example.

yes brush and texture was the hardest part, but finally it's done and it works with everything but DDS. when a dds texture is detected, the flags must be set manually cause I would need the TextureBuffer to retrieve the current flags, and that TextureBuffer is always zero with DDS textures.

Ok, here's mine, latest B3D exporter. Can save only one mesh at a time, may be modified (parallel nodes in file). Due to the nature of it, it isn't SOLID nor ROBUST, nor CLEAN or BUGFREE at all, use at your own risk :) At least, it used to save a big map that was exported by giles "AS IS". The source also contains some info on how to save lights that can be read by giles.
There may be a problem with redundant texture references. I doubt it causes a memory leak, but if it does then I'd be glad if somebody's gonna help to debug it. (the problem is mentioned in the code)

http://www.melog.ch/dl/saveb3d_2007a.zip
Make sure to read the notes in the source.

Now, since this thread is sticky and everything, how about somebody collects all links to export sources found in the archives and elsewhere, and lists them here, preferably in the very first post? Thanks.

Nice one(added it to list above), unfortunately havent had the time to look at it yet :(

He Dan, I updated my exporter, now it is compatible with LoadMesh and I added a Nan removal function.

Oh just realized there's a bug in my code. In the BRUS writing section a brush named lo_bru is created (Using GetSurfaceBrush()). This should be freed after processing, at the corresponding loop end. I'll update the zip, later. :-°

These were all the links I could find in the archives:
Save X
http://www.blitzbasic.com/codearcs/codearcs.php?code=1906
Save 3DS
http://www.blitzbasic.com/codearcs/codearcs.php?code=1815
Save Anim B3D
http://www.blitzbasic.com/codearcs/codearcs.php?code=1794
SaveAnimFile
http://www.blitzbasic.com/codearcs/codearcs.php?code=1740
SingleFile
http://www.blitzbasic.com/codearcs/codearcs.php?code=1500
ASC saver
http://www.blitzbasic.com/codearcs/codearcs.php?code=1033
Save B3D
http://www.blitzbasic.com/codearcs/codearcs.php?code=866
ASE->B3D
http://www.blitzbasic.com/codearcs/codearcs.php?code=707
Save .X multisurface
http://www.blitzbasic.com/codearcs/codearcs.php?code=631
Save .X single surface
http://www.blitzbasic.com/codearcs/codearcs.php?code=111
Animb3D
http://www.blitzbasic.com/codearcs/codearcs.php?code=1764
B3D->XML->B3D
http://www.blitzbasic.com/codearcs/codearcs.php?code=665
import .cob/.scn
http://www.blitzbasic.com/codearcs/codearcs.php?code=335
Save DDS
http://www.blitzbasic.com/codearcs/codearcs.php?code=1813
Import OBJ
http://www.blitzbasic.com/codearcs/codearcs.php?code=1323
Load Giles .gls
http://www.blitzbasic.com/codearcs/codearcs.php?code=1134
Convert .X/.3DS->.B3D
http://www.blitzbasic.com/codearcs/codearcs.php?code=342
Save .TGA
http://www.blitzbasic.com/codearcs/codearcs.php?code=1
Save Stevies format :)
http://www.blitzbasic.com/Community/posts.php?topic=26973#283228
Save FLE
http://www.blitzbasic.com/toolbox/toolbox.php?tool=167
Save 3DS
http://www.blitzforum.de/forum/viewtopic.php?t=20214&sid=9a9fdb3fe33470707f7c5c86e7b63b82
DX8->B3D
http://www.blitzbasic.com/toolbox/toolbox.php?tool=64

Wow, thanks! Finally, that's a lot!


Save Stevies format :)
www.blitzbasic.com/Community/posts.php?topic=26973#283228



What a useless piece of crap that format is! Did it's job for me back in the day though ;)

Great list, thx

i've been thinking about something like that previously, so i would like to make the framework!

in a few days or today, i will show a demo where we can develop on...

i think we need a name. how about "[x]port"?

http://dc.chat-blitz.de/upload/files/Devils%20Child/[x]port.zip

Before I download (sitting at a linux box here) What exactly is it?

There's also some news about my new AS-IS B3D exporter (see prev. post): Although it saves redundant textures (eg: the lightmap textures may be the same for many brushes, noless it's indexed multiple times), this doesn't seem to be a problem since Blitz will auto-optimize VRam usage, not only when you load a texture by code multiple times with the same flags and settings, but also if it's referenced multiple times in a mesh file.

The point is, a brush is described by texture indexes, so this makes the whole approach somewhat more compicated (or maybe there's a simple solution and I just don't see it right now, however).

I can save myself a lot of debugging work and forget about this. After all, a 2 MB map mesh is only a few kb bigger with this unoptimized texture list, and VRam usage is the same.

At least (unless I made a mistake), it seems to me that's the way it is. Confirmations welcome.

its a framework with 3ds/b3d/x import and x export.
i'm sitting here and implementing more exports!

ps: updated: dc.chat-blitz.de/upload/files/Devils%20Child/[x]port.zip

Hey, jfk EO-11110. You forgot one thing: another 3D engines does not optimize all Object/Mesh/Textures directly after loading. At moment only Genesis3D, the Unreal-Engine (1-3) and Blitz3D does this.

You're right, but then again Blitz3D is the target render Engine for this B3D exporter. I'd like to know how UU3D handles this. Giles for example would not optimize it, but this isn't a desaster since we usually import meshes without lightmaps in giles. After all, this allows to easily export a scene "AS IS" (with all visual fx such as blendmodes, vertex settings etc.) from within Blitz3D. I think currently there's no sustitute for it.

You are however welcome to add a texture list optimizer to the function :) (Index references in the brushes must be altered correspondingly)

DC - sounds good! Keep it up!

oooh more stuff, cool

added and looking now :)

A real asset would be a dx92b3d bones. this would complement my spriteforge app nicely :)

It's funny how threads suddenly get your attention - great work going on here, what a great idea.

IPete2.

here: i've been working on:
http://www.dc.chat-blitz.de/upload/files/Devils%20Child/[x]port.zip

Great work, Devil! :)

added it :)

Does anyone have any code for bvh ??

There was a release, I named it "bvhdemo_bb.zip" when I downloaded it, not sure if this is the original name.

If you use the advanced search options of yahoo and search for "bvh" on the specific page www.blitzbasic.com then you'll find a lot of bvh discussion topics.

EDIT done some research, the 1st and second host has vanished, so I uploaded the blitz bvh demo here:
http://www.melog.ch/dl/bvhdemo.zip

Not much, a walking guy, using a "walk.bvh" file. (Not by me, BTW)

Thanks jfk.

Has anyone got ones for avi, gif or mpeg? This would be fantastic if there is such code :D

avi export is in the code archives, in userlibs section.

i made an XMF/CMF cal3d importer exporter. i have yet to submit it.

Can somobody reupload the Devils Child's [x]port ? ;)