x2egg - "Too many data elements in structure." -

Actually i’ve some problem with the X file format depending of the tool that generate it.

the 1.5.3 version of the x2egg convertor seem to correct some of the error but not all.
Is there a way to parse the X file to make it compatible with x2egg tools ?

Can you upload your .x file somewhere? I’m 100% sure the xlexer problem was solved in 1.5.3.

Here it is :


I want to make some test of a cool scene with Panda 3D with shader (normal map, grass and water) but i’ve really big problem to have a easy way to exporte all my work.

I actually use wings 3D for the modeling+UV mapping part (very easy and quick).
I also use blender for some export (more pluging than wings) or animation.
I use the pack from chronosphere :
That support import and export of wings 3d format in blender.

Perhaps you hit vertices/tris count limit. Try to split it. It happened to me when using vrml2egg.

It’s that i think with the first model.
I made an second one low poly (3k).
I don’t think it’s an problem with the vertices/tris count.

For information the python pluging for blender to parse wings3D file :

Wings 3D is actually the more easy and free tool do create static object with UV mapping.
You could also set bump or normalmap in it, the only things it’s the exporter to Panda that left :stuck_out_tongue:

Your x file really is invalid. What tool are you using to generate it? It seems to be generating invalid x files.

See, at line 112987 of arbre1.x, it looks like this:

AnimationKey {
0; 4; 0.999962,0.0,0.00872654,0.0;;;
1; 4; 0.999962,-5.43167e-004,0.00870961,-5.51621e-004;;;
2; 4; 0.999961,-0.0010843,0.0086589,-0.00109454;;;
3; 4; 0.999961,-0.00162138,0.00857457,-0.0016202;;;
98; 4; 0.999961,0.0010843,0.0086589,0.00109454;;;
99; 4; 0.999962,5.43168e-004,0.00870961,5.51622e-004;;;
100; 4; 0.999962,4.21019e-010,0.00872654,4.28432e-010;;;

The second line is 100, which means that there will be 100 frames of animation data following. But in fact there are 101 frames! The frames are numbered 0 through 100, which is 101 frames, not 100. There really are too many data elements in this structure.

You could edit the x file by hand, if you wanted, to remove the last line, or to change the “100” to “101”. But you’ll have to do this for every joint in the model. Better to complain to the author of the tool that generated this file.


The strange thinks it’s that i could import them easily without problem in some other apps like the Delgine Editor (Very usefull for make some level for Panda too :wink:) http://www.delgine.com/

It’s an very good tool to have a good level editor :wink:

For the X file format some info i’ve found :

I’ve corrected the X file manualy for try what you tell drwr.
Here the file of the low poly tree :

Here the new error done by x2egg :
:angry:file(error): Too many faces in MeshMaterialList.

This file have only 2005 vertices and 3499 faces. 36 mesh under delengine for exemple

This only means that these other apps are overlooking the faults in the x file. They are either ignoring frames beyond 100, or they are ignoring the value “100” and understanding it to mean “101”, the actual number of frames encountered.

This is a perfectly sensible thing for an app to do. It follows the robustness principle. (It really ought to be telling you that it is doing so, however.)

Arguably, Panda’s x reader should be modified to be similarly forgiving, and in fact I will do so now. That doesn’t help your immediate problem, however.

As to the next problem, well, this is a similar flaw in the x file. Now you have a material list at line 40 that says “apply this material to face 1.” But in fact, the mesh in question (at line 36) has 0 faces. So the material list is incorrectly referencing a face that doesn’t exist.

There are lots of similarly empty meshes in your x file, all of which have the same problem. It may be difficult to remove them all by hand. Perhaps you could remove them in the original model before you export?

Or, possibly, since Delgine can load the x file in question without trouble, maybe you could load it into Delgine and then save it out again? It might write out a correct x file.