saveB3D...
Blitz3D Forums/Blitz3D Programming/saveB3D...
| ||
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... |
| ||
C'mon, can anyone help? |
| ||
Saddam. |
| ||
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? |
| ||
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 :) |
| ||
Thanks CodeOrc - we'll both have to keep our fingers crossed and hope the force is in our favour (is that too cheesey???!) |
| ||
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. |
| ||
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)!!! :( |
| ||
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. |
| ||
ok, you lost me a bit in that thread! :( |
| ||
@Rob |
| ||
@ 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! |
| ||
C'mon - ANYONE?? |
| ||
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... |
| ||
thanks jfk :p |
| ||
look (and backup and bookmark): http://www.geocities.com/drago_blitz/B3dFormat.html |
| ||
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)! |
| ||
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... |
| ||
not that hard, I'll do that anyway, the sooner or the later. |
| ||
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 :) |
| ||
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. |
| ||
Ok, it's there, in the Code-Archives. |
| ||
Cheers JFK Thats working great |
| ||
Brilliant! Thanks for the great tool JFK!!!! |
| ||
jfk - are you freeing your brushes and textures after finding them? If you aren't then your function will leak memory. |
| ||
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. |