Archived

This topic is now archived and is closed to further replies.

Bender77

3DSMax Export plugin (smooth groups, etc)

Recommended Posts

I''m currently developping an exporter plugin for 3DSMax. 3DSMax use a different method than real-time 3D API (opengl, directX): instead of having a single IB & VB It has an IV & VB for vertex position and another one for texture coordinates. Also, it uses smoothing group instead of having vertices dulicated along hard edges. Finaly each face is assigned a material ID. (We want to split that mesh in one or more subsets bas on those IDs) I managed to handle the conversion, but my code seem unecessary complex and not very robust. Could anyone link me to some ressource about it, or give me some tips. ps: And what about the ''rumor'' that direct X9 would be able to use different index buffers for different vertex streams , this would allow to use the 3DSMax''s mesh style more directly.(actually I couldn''t find anything like this in the SDK documentation...)

Share this post


Link to post
Share on other sites
Using multiple streams does not solve your problem, because the indices are the same on all streams.

Conversion of Max''s meshes into hardware-friendly meshes is a bit of a pain, that''s true (smoothing groups I never even tried). So you''ll have to bite the bullet or use an existing export tool, among which Flexporter (http://www.codercorner.com/Flexporter.htm) is great.

This process is typically called "consolidation".


____________
Jare/Iguana
http://www.iguanademos.com/Jare

Share this post


Link to post
Share on other sites
Thanks for awnsering .

I was talking of multiple Index buffers, that is, each VB (or vertex stream) is indexed by a different IB.

The point is I heard before the release of DX9 f such an ability to use multiple streams of IB in one call. And ''surprisingly'' I didn''t found it in dx9...

Anyway I thank you for the keyword "consolidation" which I didn''t knwow, maybe it will help finding things with google.

PS: I''m not yet sure my code is robust but if you''d like to have a look at my smoothing group code and comment about it, I would appreciate external viewpoint (excuse my poor english ) )...
(Until now this piece of code has been working perfectly assuming one face is belonging to one and only one smooth group)

Share this post


Link to post
Share on other sites
Hi Bender,

I am actually maintaining our company exporter at the moment and improving the support for smoothing groups, submaterials such that the output becomes highly optimized for rendering (that including doing my own tristripping too complete with a strip-previewer within Max - arghh!) and I don''t think that can be done in any simple way. Our exporter is >10.000 lines of C++ code long and not completely done yet. Just the fact that Max stores normals in faces and not in vertices as expected by hardware is a real pain. So I don''t think it can be done in any very easy way. sorry.

The strategy I use is to collect all Max nodes I want to export in a structure (e.g. those that are selected). Then I build my own datastructure with the data I need from Max where I store all the needed info. Then I reorganize the data to make it more optimal for hardware (e.g. merging data from objects that has the same texture) and then I emit them in our own data format.



Jacob Marner, M.Sc.
Console Programmer, Deadline Games

Share this post


Link to post
Share on other sites
Hm, what is so complex about these multiple streams...

The real pain is Physique exporter imho, that one simply is pain in the ass (same bone assigned multiple times to single vertex?!).

I read all the vertex data (position, bone assignments for skinned meshes, texture coords) and all that is not-indexed, directly stored into faces themselves. *Then* I walk the faces and do indexing of that vertices...
However normals now are exported without any knowledge of smoothing groups, but for that one must create indexed vertices and then there is source in the MAX SDK Help for that one, nice and clean (linked list for every vertex about all smGroups it is used in). So maybe after my indexing of vertices I could compute the normals in the faces directly and then do just another indexing...
A bit slower, but it is exporter, and I don''t mind to wait 2-3 sec to export 10k mesh, really!

Share this post


Link to post
Share on other sites
MAX is far from good.

I use dotXSI, for which a File ToolKit is available at no cost, and which has PlugIns for Maya, 3DS Max and a few other software.

check infos there:
[url]http://www.softimage.com/connect/xsi/[/url]


The file format is rather cool, and the FTK is easy to use.

-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites