Jump to content

MDB to FBX, FBX to MDB converter


FreshLook

Recommended Posts

Arrrgh I found the culprit

 

I modified config.yml and added path to my NWN2 like that

 

# (Optional) Directory where NWN2 is installed.
# nwn2_home: D:\GOG Galaxy\Games
D:\GOGGalaxy\Games\NWN2Complete

 

I never thought I should instead have this last line

 

nwn2_home: D:\GOGGalaxy\Games\NWN2Complete

 

Now it works !!!!!

 

Thanks both for your help

Link to comment
Share on other sites

  • Replies 353
  • Created
  • Last Reply

Top Posters In This Topic

I imported successfully an hair model I did some times ago. The import is P_HHF_Hair21.mdb + P_HHF_skel.gr2 => FBX

 

When I open the FBX in 3DS all poly are unwelded ! Does it happens with Blender ?

 

 

I have also the following warning when importing in 3DS :

Warning: Skin Modifiers Import (o)
The Initial position (or Initial Pose) of the skinned objects is missing.
The plug-in will create a pose automatically but running the 'Assume Skin Pose' command may create unexpected results.

Link to comment
Share on other sites

Because a MDB stores normals, tangents, binormals, uv and bone indices per vertex, there can be several vertices with same position. The tool creates a FBX vertex for each MDB vertex. If within a MDB the are several vertices with same position, then there is going to be unwelded polygons. However a DCC may support vertex attributes per polygon-vertex. Maybe an improvement of the tool would be that the FBX contatins a unique vertex per position and sets the other attributes per polygon-vertex.

 

The tool isn't writing pose information to the generated FBX. However, since the skeleton and skin are in rest position, the automatic created pose should be correct.

Link to comment
Share on other sites

To me that sounds a bit like a merge doubles in Blender, which doesn't always produce ideal results. Hence I turned that off by default. With the MDB import/export scripts, I tried experimenting with merging seams by comparing both vertex coordinates and normals, but that reportedly resulted in improperly blended bone weights.

Link to comment
Share on other sites

I will investigate about converting the MDB to FBX to have a unique vertex per position.

 

Can I download P_HHF_Hair21.mdb from somewhere, so I can use it for testing?

 

It was one of the first hair I did. I think it's no more on the vault (published it in 2010). But I can send it to you.

 

I have done more testing and other meshes are not as much unwelded. I suspect it may be relative to smoothing groups. When I transform a mdb which I was certain had only one smoothing group, I have no multiple vertices in the fbx. When I did hair 21 I didn't know what were smoothing groups and I fear the mesh was not smoothed.

 

That would be logic, 2 adjacents poly not in the same smoothing group would have different normals and like you explained above that would produce more than 1 vertice.

 

EDIT : hair 21 is still on the vault. Search for my name there : Krighaur. It will show you an hair pack.

Edited by phil76
Link to comment
Share on other sites

Finally I have understood how it works.

 

I have tested both import and export of skinned mdb with 3DS Max 2016 and it works fine.

 

Your tool is a great improvement for developping custom content. Many thanks to you.

 

EDIT : It seems I missed a big problem

 

When I import an mdb, the skeleton hierarchy is :

p_hhf_skel (if importing a human female mdb)

p_hhf_skel (yes there are a p_hhf_skel under the root)

then all other skeleton bones in an habitual hierarchy

 

If I re-import the fbx in 3DS Max I have an error 'incomplete binding pose' and the skeleton hierarchy is lost. All bones are now cubes. I searched in Autodesk forum and found that it is a problem still under analyse from Autodesk probably related to bones of the skeleton not having weights upon meshes (which is my case, I worked on a basic head mesh and so all vertices from teh mesh were skinned to the head bone).

I tried the workaround suggested by autodesk (use HIK for CAT) but it did not solved the problem.

Edited by phil76
Link to comment
Share on other sites

Finally I have understood how it works.

 

I have tested both import and export of skinned mdb with 3DS Max 2016 and it works fine.

 

Your tool is a great improvement for developping custom content. Many thanks to you.

 

It's been a year since I started this project. I'm glad it serves some people, even if the NWN2 community is small.

 

What you say about smoothing groups makes sense. Because a MDB doesn't store smoothing groups, it's not possible to recover the original ones. However, I'm making progress on writing to FBX vertex attributes per polygon-vertex instead of per vertex. In my tests so far, when I import the FBX into Blender, now there aren't any loose polygons, preserving the smooth parts and flat parts correctly. Even Blender marks sharp edges as if the artists had used the Mark Edge tool. I guess the FBX plug-in of 3ds Max will do fine as well.

Edited by FreshLook
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...