Jump to content

MDB to FBX, FBX to MDB converter


FreshLook

Recommended Posts

  • Replies 353
  • Created
  • Last Reply

Top Posters In This Topic

 

The Root Bone doesn't need to match the name of the skeleton? :mellow:

 

I set the name of root bone to "test" and the animation works, although I have tested it again to be sure and the toolset crashes often.

 

 

Yes, the root bone has to be exactly as the part before _skel or _<animation>.

And you need to have a static gr2 file, which as far as I know defines how the bones are linked together, and what their origin is.

Then, the animations files store the move/rotate/resize changes of the bones during the animation.

Link to comment
Share on other sites

 

 

The Root Bone doesn't need to match the name of the skeleton? :mellow:

 

I set the name of root bone to "test" and the animation works, although I have tested it again to be sure and the toolset crashes often.

 

 

Yes, the root bone has to be exactly as the part before _skel or _<animation>.

And you need to have a static gr2 file, which as far as I know defines how the bones are linked together, and what their origin is.

Then, the animations files store the move/rotate/resize changes of the bones during the animation.

 

 

Are you sure about the root bone name? We must distinguish three names:

  1. The name of the GR2 file.
  2. The name of the skeletons or animations that the GR2 file contains.
  3. The name of the root bone of a skeleton.

Some gr2 files I have examined:

 

P_HHM_skel.gr2:

  • Skeleton name: P_HHM_skel
  • Root bone name: P_HHM_skel

P_HHM_skel01.gr2:

  • Skeleton name: P_HHM_skel
  • Root bone name: P_HHM_skel

P_HHM_skel02.gr2: idem.

N_Aldanon_skel01.gr2: idem.

N_Lorne_skel01.gr2: idem.

 

P_HHMcapewing_skel.gr2:

  • Skeleton name: P_HHMcapewing_skel
  • Root bone name: P_HHMcapewing_skel

The pattern I see:

  • The skeleton name doesn't need to match the file name, but follows a convention. For example, it seems that all human male skeletons are named P_HHM_skel.
  • The root bone name matches the skeleton name.
Edited by FreshLook
Link to comment
Share on other sites

I dunno what I did wrong. Maybe the way I added keyframes messed up something? Or they way I exported? Do I have to export my animation and skeleton separately from two different FBX files?

 

Will keep experimenting with it.. If anyone has figured this out and can post a Step by Step workflow to get the bare minimum stuff working - Would be great.

 

(Ideally a Youtube video / or guide with some screenshots, keep it super basic to just the flow of Import / Export, Ideally with a renamed or new skeleton)

 

TY.

 

 

EDIT:

 

 

EDIT: I have tried it and it worked. First I worked with the skeleton alone to ensure it was in resting pose:

  1. Converted P_HHF_skel.gr2 to FBX and imported it into Blender.
  2. Renamed the skeleton from P_HHF_skel to P_AHF_skel. I also renamed the root bone from P_HHF_skel to P_AHF_skel.
  3. Exported to FBX.
  4. Converted the FBX to NWN2.
  5. Renamed the output skeleton to P_AHF_skel.gr2.

Then I worked with the animation:

  1. Converted P_HHF_skel.gr2 and P_HHF_UnA_run.gr2 to FBX and imported it into Blender.
  2. Renamed the skeleton and the root bone again.
  3. Modified the animation.
  4. Exported to FBX.
  5. Converted the FBX to NWN2.
  6. Renamed the output animation to P_AHF_UnA_run.gr2 (ignore the output skeleton).

Finally:

  1. Copied P_AHF_skel.gr2 and P_AHF_UnA_run.gr2 to the override folder.
  2. Created a new appearance exactly like the Human one but with head and body skeleton P_AH?_skel.

 

Based on your quote here, it appears you work with the skeleton / animation separately?

 

I tried importing Skel / GR2 / MDB at the same time into one FBX. I renamed the Skeleton and modified the animations, exported and then used those files.

 

Is this wrong?

Edited by TrinitalMod
Link to comment
Share on other sites

I dunno what I did wrong. Maybe the way I added keyframes messed up something? Or they way I exported? Do I have to export my animation and skeleton separately from two different FBX files?

 

Will keep experimenting with it.. If anyone has figured this out and can post a Step by Step workflow to get the bare minimum stuff working - Would be great.

 

(Ideally a Youtube video / or guide with some screenshots, keep it super basic to just the flow of Import / Export, Ideally with a renamed or new skeleton)

 

TY.

 

 

EDIT:

 

 

EDIT: I have tried it and it worked. First I worked with the skeleton alone to ensure it was in resting pose:

  1. Converted P_HHF_skel.gr2 to FBX and imported it into Blender.
  2. Renamed the skeleton from P_HHF_skel to P_AHF_skel. I also renamed the root bone from P_HHF_skel to P_AHF_skel.
  3. Exported to FBX.
  4. Converted the FBX to NWN2.
  5. Renamed the output skeleton to P_AHF_skel.gr2.

Then I worked with the animation:

  1. Converted P_HHF_skel.gr2 and P_HHF_UnA_run.gr2 to FBX and imported it into Blender.
  2. Renamed the skeleton and the root bone again.
  3. Modified the animation.
  4. Exported to FBX.
  5. Converted the FBX to NWN2.
  6. Renamed the output animation to P_AHF_UnA_run.gr2 (ignore the output skeleton).

Finally:

  1. Copied P_AHF_skel.gr2 and P_AHF_UnA_run.gr2 to the override folder.
  2. Created a new appearance exactly like the Human one but with head and body skeleton P_AH?_skel.

 

Based on your quote here, it appears you work with the skeleton / animation separately?

 

I tried importing Skel / GR2 / MDB at the same time into one FBX. I renamed the Skeleton and modified the animations, exported and then used those files.

 

Is this wrong?

 

If you export the skeleton along the animation, the skeleton will be exported to FBX as it's posed in the current frame (this happens with Blender, with other apps I don't know). I tried the trick of reseting the translation, rotation and scaling of the bones before exporting and it doesn't work. So to ensure the exported skeleton is in it's default pose, I first work with the skeleton alone , rename it, export it to FBX, convert it to GR2 and this file will be the final skeleton. Then I work with the skeleton + animation + (optional) mdb, export it to FBX, convert it to GR2 but I only use the GR2 animation file.

Edited by FreshLook
Link to comment
Share on other sites

 

I dunno what I did wrong. Maybe the way I added keyframes messed up something? Or they way I exported? Do I have to export my animation and skeleton separately from two different FBX files?

 

Will keep experimenting with it.. If anyone has figured this out and can post a Step by Step workflow to get the bare minimum stuff working - Would be great.

 

(Ideally a Youtube video / or guide with some screenshots, keep it super basic to just the flow of Import / Export, Ideally with a renamed or new skeleton)

 

TY.

 

 

EDIT:

 

 

EDIT: I have tried it and it worked. First I worked with the skeleton alone to ensure it was in resting pose:

  1. Converted P_HHF_skel.gr2 to FBX and imported it into Blender.
  2. Renamed the skeleton from P_HHF_skel to P_AHF_skel. I also renamed the root bone from P_HHF_skel to P_AHF_skel.
  3. Exported to FBX.
  4. Converted the FBX to NWN2.
  5. Renamed the output skeleton to P_AHF_skel.gr2.

Then I worked with the animation:

  1. Converted P_HHF_skel.gr2 and P_HHF_UnA_run.gr2 to FBX and imported it into Blender.
  2. Renamed the skeleton and the root bone again.
  3. Modified the animation.
  4. Exported to FBX.
  5. Converted the FBX to NWN2.
  6. Renamed the output animation to P_AHF_UnA_run.gr2 (ignore the output skeleton).

Finally:

  1. Copied P_AHF_skel.gr2 and P_AHF_UnA_run.gr2 to the override folder.
  2. Created a new appearance exactly like the Human one but with head and body skeleton P_AH?_skel.

 

Based on your quote here, it appears you work with the skeleton / animation separately?

 

I tried importing Skel / GR2 / MDB at the same time into one FBX. I renamed the Skeleton and modified the animations, exported and then used those files.

 

Is this wrong?

 

If you export the skeleton along the animation, the skeleton will be exported to FBX as it's posed in the current frame (this happens with Blender, with other apps I don't know). I tried the trick of reseting the translation, rotation and scaling of the bones before exporting and it doesn't work. So to ensure the exported skeleton is in it's default pose, I first work with the skeleton alone , rename it, export it to FBX, convert it to GR2 and this file will be the final skeleton. Then I work with the skeleton + animation + (optional) mdb, export it to FBX, convert it to GR2 but I only use the GR2 animation file.

 

 

Gotcha - Okay will do.

 

EDIT:

 

We should start documenting this on git wiki too - also make sure you quickly jot down the steps you took to make that tyr banner.

 

That will be so insanely useful. >.<

Edited by TrinitalMod
Link to comment
Share on other sites

 

Are you sure about the root bone name?

 

P_HHM_skel.gr2:

  • Skeleton name: P_HHM_skel
  • Root bone name: P_HHM_skel

Yes, the root bone name is the reference the engine uses to determine which animation to play.

It is also the name that has to be in appearance.2da

 

So, you can name a creature model monster.mdb, and its skeleton mycreature_skel.gr2 (the _skel part is compulsory). As long as the animations follow the naming convention mycreature_UNA/1hs/C2h(etc...)_attack01/run/walk(etc...).gr2 and the appearance.2da links monster.mdb to mycreature_skel, it will work.

 

See P_HHM_* for all Human Male based characters.

 

 

 

P_HHM_skel01.gr2:
  • Skeleton name: P_HHM_skel
  • Root bone name: P_HHM_skel

P_HHM_skel02.gr2: idem.

N_Aldanon_skel01.gr2: idem.

N_Lorne_skel01.gr2: idem.

The number after P_HHM_skel relates to the head model number (01 --> P_HHM_Head01, 02 --> P_hhm_head02 etc...)

Same for N_Aldanon or N_Lorne (although they both use the P_HHM_skel skeleton, they have their own heads models. Again, as long as appearance.2da gives the correspondance between the mdb and the skel, you can name the models as you wish).

 

 

 

P_HHMcapewing_skel.gr2:
  • Skeleton name: P_HHMcapewing_skel
  • Root bone name: P_HHMcapewing_skel

It's slightly different here: this skeleton is for cloaks and wings (which means by the way that a Human Male based character cannot have both cloak and wing, unless a special mdb is specifically made for him).

The P_HHM_skel will only cover head, body, arms and legs.

P_HHMcapewing is a skeleton attached to P_HHM_skel for cloaks and wings (and there's a third skeleton for tails).

Each of these three skeletons needs to have it's own _skel.gr2 file. However, the animations for P_HHM need to include all three in order to cover the wings and tails variants.

In other words, if you change a walk animation without importing and exporting the capewing_skel skeleton, the wings or cloak of the creature will at best appear detached, sometimes even set at 0,0,0.

 

 

 

The pattern I see:

  • The skeleton name doesn't need to match the file name, but follows a convention. For example, it seems that all human male skeletons are named P_HHM_skel.
  • The root bone name matches the skeleton name.

Well, it depends on what the file name refers to. True for the mdb, wrong for the _skel.gr2 file.

 

The convention for player characters is P for player, HH for human, M/F for male female.

Elves will use EE instead of HH, dwarves will use DD, etc...

However elves and half-elves will also use the P_hh?_skel skeleton, the HH or EE distinction is for the engine to select the right model (elves being slightly smaller than humans, and of course elves heads have pointed ears, so need a different choice of heads).

Link to comment
Share on other sites

I have added conversion of collision spheres to FBX. Next I will do conversion of collision spheres to MDB.

 

dbWQqfo.png

 

 

Gotcha - Okay will do.

 

EDIT:

 

We should start documenting this on git wiki too - also make sure you quickly jot down the steps you took to make that tyr banner.

 

That will be so insanely useful. >.<

 

 

When I have developed the planned features, I'll write tutorials. There is little left, look here: https://github.com/Arbos/nwn2mdk/issues

 

By the way, I have found a way to export a skeleton to FBX in rest position even if it's animated. Before exporting, select the skeleton, go to the armature tab and click "Rest position" button. It will not export animations, so conversion from FBX to GR2 should only generate GR2 skeleton. Then click "Pose position" to return to animation edition.

Link to comment
Share on other sites

I added conversion of collision spheres to MDB. Now the tool has all the features needed to create new creatures from scratch, although I haven't tried to create one.

 

I have also written a tutorial showing how to animate a placeable (the banner of Tyr): https://github.com/Arbos/nwn2mdk/wiki/Tutorial:-Animated-Placeable

Edited by FreshLook
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...