Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
blender export VS Format specification
Topic Started: Oct 3 2012, 01:29 PM (259 Views)
karlsson
Newbie
[ * ]
I have a question regarding the blender 2.6 U3D exporter and the U3D format specification.

In the mesh chunk, the exporter writes nVertex and nTriangle as 16bit or 32bit unsigned integer depending on selected format verison:
Line: 6510 File.write(pack(Choose(UseV2,"L","H"),self.nVertex));
Line: 6563 File.write(pack(Choose(UseV2,"L","H"),self.nTriangle));

But the format specification says: WORD nVertex and WORD nTriangle in both V1 and V2 format specification.
Is the format specification wrong or is it a bug in the export script?

For now, I have changed the export script to match the specification and it works well with my importer.

I really like this format for skinned animated meshes.
Keep up the good work with the blender export script! :thumb_up:
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
I don't understand the question. Is this really U3D/GM related? Are you working on a U3D exporter for Blender?
Edited by Despellanion, Oct 3 2012, 09:29 PM.
Offline Profile Quote Post Goto Top
 
karlsson
Newbie
[ * ]
No, i have written an .u3d model importer for my own project based on the .u3d V2 specification:
http://ultimate3d.org/U3DModelFileFormatV2.htm

and i came across this issue when i tried to import models exported from blender with this export script:
http://s9.zetaboards.com/Ultimate3D_community/single/?p=8043461&t=173826
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Hi karlsson,

and welcome to the community. Finally someone can benefit from my format specifications. I really appreciate that :) .

Regarding your question the answer is, that it is a bug in the format specification. The only importer for U3D v. 2.0 I knew about so far (mine) expects DWORDs at this location so the behavior of the export script is consistent with that, but the format specification is inconsistent. There is an obvious reason to prefer this solution. Using a WORD for the triangle count would bound it at 65536, which can be too low in some practical cases. This is not too bad, because vertices are indexed with WORDs anyway, but since we really do not need to care about saving 4 bytes per mesh, it is better to use DWORDs.

I have corrected this mistake in the format specification now. The same change applies to $U3D_SHADOW_GEOMETRY, but you probably ignore this chunk anyway. Thanks for the report.
Offline Profile Quote Post Goto Top
 
karlsson
Newbie
[ * ]

Thanks for your quick response!

That makes sense, I'll let you know if I come across any other issues, so far the importer seems to work very well.
A reliable blender exporter for a strict powerful binary model format is just what I've been looking for, seems like I've found it!

Thank you!
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply