saveB3D...

Blitz3D Forums/Blitz3D Programming/saveB3D...

Code_666(Posted 2003) [#1]
Can anyone help me? Everytime I try to write code to save an entity to .b3d, (with it cycling through it's children, surfaces, brushes and textures) I keep getting in a mess!

Does ANYONE have a function that does this that they are prepared to share with me?

grovel, sniffle, grovel...


Code_666(Posted 2003) [#2]
C'mon, can anyone help?


Rob(Posted 2003) [#3]
Saddam.


Code_666(Posted 2003) [#4]
That's a bit harsh isn't it?
All I did was ask a friendly community for a little help, which ironically, is so I can finish code I was going to post in the archives anyway!

Is there anyone out there who can/is willing to help?


CodeOrc(Posted 2003) [#5]
I would love to help, but it is a bit over my head at this point. Perhaps thats why others have not responded, it may too difficult.

Dunno, but I will keep looking to this post for the Jedi Master who may have the answer :)


Code_666(Posted 2003) [#6]
Thanks CodeOrc - we'll both have to keep our fingers crossed and hope the force is in our favour (is that too cheesey???!)


Uhfgood(Posted 2003) [#7]
Umm it's possible you could look at the specs and utils page under the community tab. It's got sample code for loading (and I think saving) .b3d files.


Code_666(Posted 2003) [#8]
Under the specs section, the save routine uses a red brush. It doesn't consider texturing, etc... :( How can we adopt a standard with having comprehensive code to utilise it?? I know we are all supposed to be programmers but there is such a thing called saving time (aka libraries)!!!

:(


jfk EO-11110(Posted 2003) [#9]
goto the maplet forum, search for a thread named "transparency question" or something, grab that saving code, add the new TextureName$() aso. Functions to determine the used brushes/textures... good luck.


Code_666(Posted 2003) [#10]
ok, you lost me a bit in that thread! :(


Doggie(Posted 2003) [#11]
@Rob



Code_666(Posted 2003) [#12]
@ Rob - right...... (Dr. Evil style!)

@ Everyone else

PLEEEAAASSSEE - does anyone have a function? Even with jfk's stuff I am getting into a right old state!


Code_666(Posted 2003) [#13]
C'mon - ANYONE??


jfk EO-11110(Posted 2003) [#14]
right old state? all you need to do is to nest some children. what do you want? you only need to combine this with the recursive mesh-hierarchy spy source from the code arcs.

I used to save complete maplet buildings with all used textures this way, including lightmap. it works. The only thing that is not implemented is Animation, and I agree, this is still a book with seven seals, the only in fo I found about Animation was from a guy named Dragan or something like that, unfort. I didn't bookmark it. gimme a minute, I'll try to find the url...


Code_666(Posted 2003) [#15]
thanks jfk :p


jfk EO-11110(Posted 2003) [#16]
look (and backup and bookmark):
http://www.geocities.com/drago_blitz/B3dFormat.html


jfk EO-11110(Posted 2003) [#17]
btw - if you got it working with multisurface (well this already works as seen in the maplet thread) and multiple children, then please post it in the codearchives, thanks.

Something that can be used very simple, like

charly=LoadMesh("fighter.3ds")
result=SaveMesh(charly,"fighter.b3d")

Of course, something that works with static Meshes (not LoadAnimMesh) would be perfect by now.

BTW check out the versions.txt in the Blitz installation folder for infos about the new TextureName$() etc. Functions to track down the Textures used by a mesh (or better say used by a brush used by a surface used by a mesh)!


Code_666(Posted 2003) [#18]
That was the plan jfk... I have lost track of the number of posts I have seen where people have asked for this function!

Once more into the breach...


jfk EO-11110(Posted 2003) [#19]
not that hard, I'll do that anyway, the sooner or the later.


CyBeRGoth(Posted 2003) [#20]
I would like to see this code when its done

We dont have any easy ways to save meshes out from within blitz, I know people have written lightwave and .x exporters (last time i tried the .x exporter with a texture it crashed) but having a .b3d exporter would be cool

I am sure FredBorg and halo could help with this :)

Also it would be cool if we had a .3ds exporter too :)


jfk EO-11110(Posted 2003) [#21]
I can release a multisurface B3D exporter for static meshes. But please no multiple Children support! The reason why I don't need multiple children support with static meshes is the following:

static meshes have no children, they have Surfaces instead. Only animated Meshes have children, and since animated B3D is way bejond my horizon I will not need any Children.

An other situation when a static Mesh can have Children is when you assign them manually using the ParentEntity() Command. But this doesn't make sense since you also can use the Addmesh command to assemble multiple Meshes to one Mesh.

I'll see what I can do.


jfk EO-11110(Posted 2003) [#22]
Ok, it's there, in the Code-Archives.


CyBeRGoth(Posted 2003) [#23]
Cheers JFK Thats working great


Dustin(Posted 2003) [#24]
Brilliant! Thanks for the great tool JFK!!!!


Beaker(Posted 2003) [#25]
jfk - are you freeing your brushes and textures after finding them? If you aren't then your function will leak memory.


jfk EO-11110(Posted 2003) [#26]
thanks for mention this. the getbrush etc function do create a copy of the investigated object (brush, texture), so if you se this converter reentrantly (unlike it works now) you need to - as masterbeaker sais - free them after usage.

I hope this will be in the next docs.