What's new

BMD plugin for 3D studio max. Imports bones, skinning, animations and vertex colors.

Fluesopp

New member
Hm.. Try this first.
1) Run the script from the MaxScript meny.
2) Go to Customize -> Customize User Interface -> Toolbar (tab)
3) Select MaxBMD from the "Category" drop menu
4) Drag the button, that apperars in the list, to any toolbar you like.
5) Click OK and click the newly created button.
 

GaryCXJk

New member
bmdimport.jpg


The screenshot might look a little bit deceiving, since the import window disappears after clicking on the import button, but altogether it works well. There are indeed some gripes, but I'll test it with version two to see if it works without doing it externally.
 

Jeztac

New member
Hm.. Try this first.
1) Run the script from the MaxScript meny.
2) Go to Customize -> Customize User Interface -> Toolbar (tab)
3) Select MaxBMD from the "Category" drop menu
4) Drag the button, that apperars in the list, to any toolbar you like.
5) Click OK and click the newly created button.

That's what I've been doing, I run the script, go to customize user interface, in the toolbar tab I can't find MaxBMD, I have no idea why its not working.\

Sorry to be such a bother
 

GaryCXJk

New member
Try searching for "BMD Importer" instead.

bmdimport2.jpg


Subsequently, just follow the steps properly:

bmdimport3.jpg


bmdimport4.jpg
 
Last edited:

BigGlitch98

New member
Huh...

I try to import a TWW model and it docent give me the mesh. it gives me the bones but not the mesh or skin. does anybody know of a fix? This is when it is still is 3ds max.

btw i am a noob and don't know programming languages.

i am using 3ds max 8.

and sorry for the erros in the sentence. it's 4:47 AM and i stayed up all night.
 
Last edited:

BigGlitch98

New member
It is the kargaroc, and it is in bb.arc. I tryed it with other models and it does the same thing.

EDIT: I got max 9 and it doesn't help. I get the same thing, except the error is :

--Runtime error: array index must be positive number, got: 0

It works with some figure models (the ones that you take pictures to get) tho.

EDIT 2: i got a screen of it
newbitmapimage2wk7.png
 
Last edited:

Jeztac

New member
Thanks a lot, it worked perfectly, sorry for making such a stupid mistake, I've never really used to many scripts or plugins for 3dsmax apart from the b3d pipeline, I'll get some pictures up soon.

Edit:
mario-2.png
 
Last edited:
OP
C

Coder

New member
It's great to see more screen shots.
Just fixed some animation bugs and added support for .x file exporting (requires the kW x-port plugin from http://kwxport.sourceforge.net/). Any animations with scale or position changes (face animations) should work now. Also update the UI (see readme.txt).
I haven't had time to fix the texture path and bb.bdl issues yet.
The image below is from some .x files I imported into xna.

MaxBmd_Beta_06

xnafq3.jpg
 

Fluesopp

New member
Sweet. You haven't found out how the color on Midna's hair is done? I have a theory that the texture is not a texture but a alpha map or something, with the polygon being colored yellow/orange with the grayscale map being the switch between the two, if you get what I mean.
 
OP
C

Coder

New member
I just found out how to extract the sounds from Zelda: Twilight Princess at http://www.hcs64.com/mboard/forum.php5?showthread=10382.
It also has a bunch of other cool utilities like wwdumpsnd (extracts sounds from The Legend of Zelda: The Wind Waker) at http://www.hcs64.com/in_cube.html.

I've been wanting to get the hair color working for some time now. It looks like all the vertex colors are in greyscale for this character. I think the hair and the blue symbols might use the alpha channel to create a glowing effect. I haven't used shaders before and I didn't implement much of the Mat3 section. For now I might just manually set it using the process you suggested.

Does anyone know if it's possible to get facial animations like Demo06_02.arc\bmdr\demo00_midna_cut00_fc_blend.bmd using Demo06_02.arc\bmdr\demo06_midna_cut03_fc_1_o.bck. It looks like the bmd file only has one bone so I'm guessing it might be some kind of morphing animation.
 

Fluesopp

New member
Perhaps morphing between two models?

About the texture, is not BMD viewer viewing it properly? Thakis have probably a solution for it.
 

thakis

New member
Coder: Some facial animations are done via texture animations (.btp in sunshine iirc). The hair color is probably done with a shader. In bmdview2, you can choose "Dump shaders" to take a look at GLSL shaders that emulate the cube's gfx chip (The shaders appear in the same folder where the model ist).
 

Fluesopp

New member
I took a look at the shader file, and I was right. It's two colors that are blended together with the grayscale texture as the blender. Exactly how it's blended, I don't know, but it's yellow 1.00000, 0.862745, 0.000000 on the light parts, and a red 0.313726, 0.000000, 0.000000 on the dark parts.

I post the shader for Midna's hair here.
//TODO: swap mode, indirect texturing, lod select, alpha testing (?)
//Names: md_hair_m_v

uniform sampler2D texture0; //6 -> 14
uniform sampler2D texture1; //7 -> 15

void main()
{
const vec4 ONE = vec4(1.0, 1.0, 1.0, 1.0);

//konst colors
const vec4 konst0 = vec4(0.000000, 0.000000, 0.000000, 1.00000);
const vec4 konst1 = vec4(1.00000, 0.862745, 0.000000, 1.00000);
const vec4 konst3 = vec4(1.00000, 1.00000, 1.00000, 1.00000);

//registers (use gl_FragColor as GX_TEVPREV)
vec4 c0 = vec4(0.000000, 0.000000, 0.000000, 1.00000);
vec4 c1 = vec4(0.313726, 0.000000, 0.000000, 1.00000);

//Tev stages

//Tev stage 0
//GX_SetTevOrder(0x0, 0x0, 0x0, 0x4)
gl_FragColor.rgb = mix(konst0.rgb, texture2D(texture0, gl_TexCoord[0].st).rgb, 1.0*ONE.rgb) + c0.rgb;
gl_FragColor.rgb = clamp(gl_FragColor.rgb, vec3(0.0, 0.0, 0.0), ONE.rgb);

gl_FragColor.a = mix(0.0, konst3.a, texture2D(texture0, gl_TexCoord[0].st).a) + 0.0;
gl_FragColor.a = clamp(gl_FragColor.a, 0.0, 1.0);


//Tev stage 1
//GX_SetTevOrder(0x1, 0x1, 0x1, 0x4)
gl_FragColor.rgb = mix(0.0*ONE.rgb, gl_FragColor.rgb, texture2D(texture1, gl_TexCoord[1].st).rgb) + 0.0*ONE.rgb;
gl_FragColor.rgb *= 4.0;
gl_FragColor.rgb = clamp(gl_FragColor.rgb, vec3(0.0, 0.0, 0.0), ONE.rgb);

gl_FragColor.a = mix(gl_Color.a, 0.0, 0.0) + 0.0;
gl_FragColor.a = clamp(gl_FragColor.a, 0.0, 1.0);


//Tev stage 2
//GX_SetTevOrder(0x2, 0x0, 0x0, 0x4)
gl_FragColor.rgb = mix(c1.rgb, konst1.rgb, gl_FragColor.rgb) + 0.0*ONE.rgb;
gl_FragColor.rgb = clamp(gl_FragColor.rgb, vec3(0.0, 0.0, 0.0), ONE.rgb);

gl_FragColor.a = mix(gl_Color.a, 0.0, 0.0) + 0.0;
gl_FragColor.a = clamp(gl_FragColor.a, 0.0, 1.0);



}
 
OP
C

Coder

New member
This version should fix the bb.bdl issue that GaryCXJk found. When importing TWW models it's probably easier to uncheck the "Export Textures" checkbox in the UI and use BmdView2 to extract the tga files (use "_" as the filename).

Thanks for the info thakis and Fluesopp, I've been stuck on the hair color for some time now. It looks like I'll need to learn how to use shaders.

I'm going to be busy with some other things for the next few weeks so I probably won't be posting any updates for awhile.

MaxBmd 0.7
 
Last edited:

Top