save .b3d

Blitz3D Forums/Blitz3D Programming/save .b3d

Ross C(Posted 2005) [#1]
Ok, i'm having some bother saving a b3d i've created in code. For example, say i create 3 spheres, and i parent them all to a pivot. I want to save this out as a .b3d file. I tried jfk's code in the archive, but it keeps giving me a texture not found error. so, i created a brush and texture and applied it to all the sphere and i even changed the pivot into a cube.

And it still doesn't work. I beleive that code only works of your loading in a file then saving it back out. What i'm after is something to save out what i've created in blitz. This isn't for a commercial app or anything. It just makes my editor a bit hard to finish, when it can't save...

Anyone offer any help?


jfk EO-11110(Posted 2005) [#2]
You may be able to save multiple meshes, parented to a pivot when you use the correct structure (nested nodes maybe), but I never really managed it to do this myself, tho I didn't try hard.

If you want to use my code, all you have to do is adding everything together to a single mesh. (and of course, the code expects a texture for every brush, you may edit the source, it's easily possible to make it use a color only, tho what map would use colors instead of textures?)

so you should use AddMEsh to add everything together to a single mesh that was initially created using CreateMEsh().

If you use AddMesh, you sould not use PositionEntity, Rotateentity, Scaleentity or EntityTexture, instead use its Mesh-Counterparts: PositionMEsh, RotateMesh, ScaleMesh and PaintMesh.

If you use copies of the original individual Meshes, and use their (Entity-) Rotation, Position etc. values with RotateMesh, PositionMesh etc., you'll be able to continue working with the level (in a non-degenerative way) after saving it / collapsing their copies.


Ross C(Posted 2005) [#3]
Hmm AddMesh is a possiblity, but what i'm after is saving the meshes using that node thingy, exporting into Gile[s], then lightmapping, bringing back into blitz ready for use in my game, so i don't think i can use addmesh in this case. I will have a look at your code again, thanks.

I'm useless at this sort of thing :o)


jfk EO-11110(Posted 2005) [#4]
Of course Gile[s] can lightmap meshes that where collapsed to a single mesh using AddMesh. Only you won't be able to access the individual parts as children in Blitz if it's once collapsed.


Ross C(Posted 2005) [#5]
yeah, but that's what i need to be able to do unfortunetly :o) No worries though, i'll get it working! Thanks for replying. It's appreciated :o)