Question about .X fileformat

Blitz3D Forums/Blitz3D Beginners Area/Question about .X fileformat

PowerPC603(Posted 2005) [#1]
Hi,

I experimented with Blender to add a so-called sceneroot to my spacestation.

That way, I thought I could load the .X with the LoadAnimMesh command and have a parent-children setup.
I wanted to have that scene-root as the uppermost parent, while the spacestation-mesh is a child of that uppermost parent, along with some other stuff.
The other stuff would be weapons that are attached to the station, so it can defend itself, in case it is attacked.
And of course, a door that would open when a ship would dock.

After exporting to .X, I noticed that I don't have any children in my scene.
I loaded the entire file with LoadAnimMesh and printed onto the scene the number of children in the scene, which is "0":
Station = LoadAnimMesh("Station.x")
Text 10, 10, "Children: " + CountChildren(Station)

All mesh-data (I placed cubes where the weapons would come) is visible, so I see the cubes and the station, but it seems that there is no parent-child support for .X files.

Is this true?

I modelled 1 station and placed 4 cubes onto it (which would later be exchanged by the weapons).
After studying the .X file, all meshes are just created seperately (which is correct, because they are all seperate meshes), but I cannot see any indication of parenting.


PowerPC603(Posted 2005) [#2]
I've found the problem, but not sure how to solve it.

It seems that Blender doesn't export "frames".
I opened the driver.x model that comes with Blitz3D in Notepad and there are Frames present.

I've modified my station.x file to include those and now I have 5 children, as needed.

So, now I guess I have to make a program to "import" those frame-sections into my model-files, so each Mesh-section has a Frame-section.


John J.(Posted 2005) [#3]
I think if you connect them to bones, it may work. Take a look at the example at "samples\mak\anim\makbot\---.bb"; it uses an .X file and gets some of the bones (children) and attaches a light flare to them for the effect.


PowerPC603(Posted 2005) [#4]
I've tested the "export .X as animation" option within Blender, and then the scene is exported with frame-sections.

I created a scene with one cube as parent, with 2 children (a sphere and another cube).

When I load that scene into B3D (loadanimmesh), only the parent is visible and the scene only has 1 child.
The other cube and sphere are not visible and don't appear to be children of that parent cube.
However, the meshes are present in the .X file.
I tried printing the number of children of that parent cube, but there are none.

Seems that Blender's .X export doesn't work perfectly.

But no problem, my game will use one big datafile, which declares all waretypes, missiletypes, shieldtypes, shiptypes, stationtypes, ... in the game.
I'll just add a section in those station-types which will declare the positions where the weapons should be mounted.
Then I can also add a few lines which state which weapons should be installed there.
Then I can add them via code.

It was easier to have pivots in the .X file, which would be used as coordinates for the weapons, but this is no real problem.

The use for one big datafile, is just for modding purposes.
This way, a modder can add a new file (with other prices, new stations, new ships, ..., let the game use that new file and the game adapts automatically to the mod, including those adaptations in the game.

The game is only in the very early stages and I'm still learning a lot about modelling, texturing, ...
So the game will not be ready for the next few months/years.