Nintendo DS imd-file (blender/3ds importer neeeded)

Skeletons, animations, shaders, texturing, converting, fixing and anything else related to read game models
ChrisX930
Posts: 35
Joined: Wed Feb 24, 2016 11:08 am

Nintendo DS imd-file (blender/3ds importer neeeded)

Post by ChrisX930 »

Hey Guys,

I got a bunch of imd-files which are like the source of some Nintendo DS model+texture files in xml format.
I've attached a few example files.

I believe there are a few model to imd exporters out there already like this one: https://github.com/jellees/nns-blender-plugin
But there's no way to import these imd files into Blender/3DSMax etc. yet.

Could you help me with this?
I'd like to import them in Blender, edit them and be able to export them again.

Thank you so much in advance!
ChrisX930
Posts: 35
Joined: Wed Feb 24, 2016 11:08 am

Re: Nintendo DS imd-file (blender/3ds importer neeeded)

Post by ChrisX930 »

ChrisX930 wrote:-snip-


Push


Also a small update to help with that.
At least, I think I figured out how the textures are stored in the files.

Each Texture uses colors from a palette which are stored in the file.
Here's an example:

Code: Select all

<tex_palette_array size="1">
   <tex_palette index="0" name="hamabe" color_size="16">
      75c5 7a28 5e92 6a8e 7eef 7f54 6f13 62f5
      7fb8 7ffe 6758 6b9c 677b 6bde 7fff 7fff
   </tex_palette>
</tex_palette_array>

Each imd File can have one or more palettes.
The palettes have either 4, 8 or 16 colors in RGB565 format.
75c5 = rgb(68, 129, 235) ██████
7a28 = rgb(117, 197, 10) ██████
5e92 = rgb(122, 40, 10) ██████
6a8e = rgb(102, 170, 136) ██████
7eef = rgb(119, 238, 238) ██████
7f54 = rgb(119, 255, 85) ██████
6f13 = rgb(102, 255, 17) ██████
62f5= rgb(102, 34, 255) ██████
and so on (I believe)

The textures itself are stored like this:

Code: Select all

<tex_image index="13" name="tshadow"
      width="32" height="32" original_width="32" original_height="32"
      format="palette16"
      color0_mode="color"
      palette_name="tshadow"
      path="C:/mayadata/area0/tex/tshadow.tga"
   >
      <bitmap size="256">
         3333 0333 1100 4441 1444 0011 3330 3333
         3333 1000 4411 4444 4444 1144 0001 3333
         0033 4111 4444 4444 4444 4444 1114 3300
         1103 4441 4444 4444 4444 4444 1444 3011
         1110 4444 4444 4444 4444 4444 4444 0111
         4110 4444 4444 4444 4444 4444 4444 0114
         4410 4444 4444 4444 4444 4444 4444 0144
         4411 4444 4444 4444 4444 4444 4444 1144
         4441 4444 4444 4444 4444 4444 4444 1444
         4441 4444 4444 4444 4444 4444 4444 1444
         4441 4444 4444 4444 4444 4444 4444 1444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4444 4444 4444 4444 4444 4444 4444 4444
         4441 4444 4444 4444 4444 4444 4444 1444
         4441 4444 4444 4444 4444 4444 4444 1444
         4441 4444 4444 4444 4444 4444 4444 1444
         4411 4444 4444 4444 4444 4444 4444 1144
         4410 4444 4444 4444 4444 4444 4444 0144
         4110 4444 4444 4444 4444 4444 4444 0114
         1110 4444 4444 4444 4444 4444 4444 0111
         1103 4441 4444 4444 4444 4444 1444 3011
         0033 4111 4444 4444 4444 4444 1114 3300
         3333 1000 4411 4444 4444 1144 0001 3333
         3333 0333 1100 4441 1444 0011 3330 3333
      </bitmap>
   </tex_image>

"format" tells us, which palette type is used,
"palette_name" tells us, which palette is used
also "width" and "height" tells us which size the texture has.
Each bit inside <bitmap> (0-F) tells us which color of the palette is used for each pixel.

I'm not pretty experienced in coding Tools that can handle and displays the pixels and colors or convert them to image-files (bmp, tga, png).

Maybe someone could help me by creating a Tool to convert this files to dae + tga/png/bmp?
reh
Posts: 48
Joined: Sun Apr 21, 2019 2:09 am

Re: Nintendo DS imd-file (blender/3ds importer neeeded)

Post by reh »

Have you tried to convert to .nsbmd?
Try to convert with this program, there are several programs that can open .nsbmd, just search.
ChrisX930
Posts: 35
Joined: Wed Feb 24, 2016 11:08 am

Re: Nintendo DS imd-file (blender/3ds importer neeeded)

Post by ChrisX930 »

reh wrote:Have you tried to convert to .nsbmd?
Try to convert with this program, there are several programs that can open .nsbmd, just search.


This is what I want to prevent.
My goal is not to convert the imd-files to a binary file (nsbmd). I could do that with the Tools the SDK has anyways.
My goal is to convert them back to dae/fbx or being able to import them back to a 3D-Environment like Blender/3DSMax/Maya for easy editing.

Converting them to nsbmd, getting the obj out of it and stuff would cause some stuff to become lost.
ChrisX930
Posts: 35
Joined: Wed Feb 24, 2016 11:08 am

Re: Nintendo DS imd-file (blender/3ds importer neeeded)

Post by ChrisX930 »

Good morning o/

as addition to my last findings, I found out that the image format is not always RGB565.

I've found a ruby-script that handles the decoding of the textures but I don't know/understand ruby.
Here's the script (attachment):
wowjinxy
Posts: 1
Joined: Mon Sep 16, 2019 11:29 pm

Re: Nintendo DS imd-file (blender/3ds importer neeeded)

Post by wowjinxy »

I had to recover my account just to say this. Most sprites are rgb555 not rgb565. There is also the possibility of other pallets as well. Theres model data in some and multiple sprites in some. Its quite complex. Later today I'll upload a few other files to show you all.