Importing Custom Models with 3ds Max

Have you always wanted to play as a different character in New Super Mario Bros. Wii? Then look no further, I'll show you the steps to make sure how to get your character model working with New Super Mario Bros. Wii.

This tutorial also applies to replacing ANY model in the game. Once you get the gist of it, you can theoretically replace any model you like. The focus of this tutorial, however, is to guide people creating their own player models.

If it's too complex for ya, I'm sorry, but this is a fairly complex process and it doesn't get any simpler than this. It's far easier to understand if you actually have the programs and stuff and go by step-by-step. But this is by no means a short task. Be wary.

This is done with a Windows 7 OS, I can't really assist if you have problems when use an other OS.

'''I WILL REMIND YOU THAT YOU NEED TO SAVE OFTEN!!! MAKE BACK-UPS OFTEN!!'''

Getting Started
Tutorial written by Baby Luigi on rvlution forum

You require the following items:


 * 3DS Max 2010 (any 3D program will actually do, as long as it can skin characters and export them as a readable Autodesk Collada .dae file that BrawlBox can read. However I don't know how to properly skin in Maya, Blender, Google Sketch-Up, etc any other 3D program so don't ask me about those, this is why this tutorial is specifically geared towards 3DS Max users).


 * BrawlCrate (the latest version is preferable)


 * New Super Mario Bros. Wii base files (Kinopio.arc, Luigi.arc, Mario.arc)


 * A working riivolution/homebrew/whatever. This is NOT the thread to ask how to set up homebrew/riivolution. I assume you got it all down and everything is ready to get modded.


 * A non shitty image editor. GIMP is ideal since it's the one I use but if you have Photoshop, GIMP, or any other image editor and know how to use them then go ahead and use them. If you use MS Paint for texture edits I will *metaphorically* stab you to death with a paintbrush.


 * Models. A good place to get them is the

Things to note: Kinopio.arc replaces Blue Toad, Yellow Toad, the Toads you rescue in levels, and the Toad that comes out of a castle to inform you of captured Toads in the game, since the single model file in there accounts for these Toads. Unless you have a clever or advanced work-away around this, think carefully before replacing them. I will say that Toad House Toads and Toads you rescue from enemy encounters are unaffected.

First things first, get your vanilla files from New Super Mario Bros Wii. For those of you that have a unmodified New Super Mario Bros. Wii ISO, you can extract them with Wiimm's ISO Tools or Dolphin Emulator. The files are located in Partition 1/Object/*name*.arc

Now, open a file of your choice with BrawlBox/BrawlCrate. Open the headers and click on the .mdl files, make sure you export them as a .dae file so 3DS Max can read it.

(images much too small? click on them to see their full size!)





Export it anywhere where you like. Note that whenever you open a model with BrawlBox, an error pops up.



That's fine, just click OK and ignore it. Open 3DS Max. First maximize the bottom right viewport by clicking [+] on the upperleft hand side, then Maximize Viewport.



Then, go to the upper left, click on the 3DS Max icon, go under “Import” and import the .dae file you want to edit. We'll start with Mario's head since it's the easier part of the model process.



Whenever you import a .dae file the FBX import window should pop up. The default settings should be fine. I think the only thing I changed was the scaling factor, the units being converted to centimeters instead of inches.



You will get prompt with an error window. That's fine, continue and you should see your model in 3DS Max.





(if you have no idea what this is, it's Mario's head upside down, facing away from the camera)

If you're new and have problems navigating 3DS Max, consult the Help section in the 3DS Max user guide under the Help toolbar. Practice navigating around until you get used to its interface and how to get around.

Importing your model into 3DS Max
Now search for the model you want to replace Mario's head with. For the sake of this example, I will import Koopa Troopa into Mario (Hindsight edit: DO NOT USE THIS EXAMPLE, TEST RUNS OF THIS SPECIFIC WILL CRASH YOUR GAME, THIS EXAMPLE IS SHOWCASED PURELY FOR DEMONSTRATIVE PURPOSES. UNTIL I FIGURED OUT WHAT EXACTLY CAUSES THE CRASH, I REPEAT, DO NOT EXACTLY COPY ME.) You can find a Koopa Troopa in New Super Mario Bros. Wii files but any model will do as long you don't over-exceed the poly-size, in which game developers limit in order for optimal, 60 fps game-play experience (New Super Mario Bros. uses fairly low-poly models, the best models for pointers are from Mario Kart Wii, Mario Sports Mix, and this very game). The model's resource is a good place to find models, or you can rip them yourself with or 3Dvia printscreen. Dolphin Emulator (or any emulators with this capability) is a good resource to extract textures from as well. (this is NOT the place to ask to rip models either, just throwing that out there)

Now, importing Koopa Troopa using the same steps to import the Mario head...



Be careful, if the model bones (bones are represented by wireframe, structural parts, I will get into more detail into what they do later) and polygons share the same name as Mario's bones and polygons, your bones and polygons will get screwed up if you try importing. A workaway around this is saving your model as a separate .max file, then merging it into the scene instead of importing it. That way, you can tell 3DS Max to automatically rename bones for you so it prevents getting screwed up. What I always do is rename Mario's polygons (for bone names, you have to be more careful about them, I recommend merging two .max files together.

If you want to hide Mario's model, right click on all of Mario's polygons (Mario's head has more than one of them, click them, hold “CTRL” to select more than one), and click “Hide Model”. An easier way to select models is to hit “H”. This window pops up



Select the Mario-related polygons (another reason to rename them), hold CTRL to select multiple of them, press OK and hide them.



If you want to unhide Mario, just right click and select "Unhide All". You do need Mario's head anyway, so you can scale your Koopa in proportions.

Then select your model (Koopa Troopa for the sake of this example), delete ANY bones it used to have. Be careful to not delete any of Mario's bones.





Then, go to the right, select on the icon that looks like a rainbow.



First I delete the Skin modifier it used to have.





Create a new modifier under the drop down window, and select “Edit Mesh”.



You have several options: you can select by vertices, by edge, by face, by polygon or by element. If the model needs to be resized, make sure your Edit Mesh modifier is active. Select by vertices, then right click on the model and hit “Scale”. Now, you want your model to be on scale everywhere without any distortions, click and hold on the center of the triangle and resize it.







Considering that the Koopa Troopa model is not exactly facing where you want it to, right click on the model, and click "Rotate". But instead of manually rotating, I'll use values for more exact and precise rotation. So click on the small black window next to "Rotate" instead.





To get Koopa rotated where you want it, under "Offset World" to the right, FIRST, type 90 under the Z value, THEN type 180 under X. If you followed it exactly, it should look like this.



Use your model manipulation tools to your fullest. Right click on what factor you want to change (move, scale, and rotate), and make it fit over Mario's head!



Not so final result.

Once your placement and size is satisfactory, you can rig it! The size should be around the same proportions around Mario's head. Since we're making a head, select by either polygon or element, depending on how complex the model is. If the model appears to be composed of "parts", then selecting by element gets the job done quicker as you can select each individual part. If not, select by polygon and select the faces. Remember, hold CTRL to select multiple parts. This example is selected by element.





Right click, and click “detach”, so now your body is detached from the head.





Of course, move it somewhere else and Hide It cause you'll need it later.



Fixing Various Issues
Some models may come with issues that may look bad. It's totally optional to fix some of them, if they have any but I strongly recommend it if you want your model to look good!

Textures
Textures add color and life to your model, all your models require them. I don't know if it's really necessary but for safe measures, I make sure the texture names match the original files. To apply textures, click and drag textures from your Windows Explorer window and release them over your desired model.





Smoothing problems
Some imported models may look like origami or really faceted.



That's not good.

Either the Smooth modifier or the Vertex Weld modifier (both from the same drop-down as Edit Mesh) to fix this. Picking the first smooth group of the Smooth modifier should fix it.



If not, use Vertex Weld instead. Set your threshold to be...about .1 or so and play around with it until you get the desired result. You should use Vertex Weld only if Smooth doesn't fix your problem



Fixing Normals
You may also need to fix the normals in some models. Normals control where the model gets lighted from, and it may look off, especially around the eyes and the face. Here's a visual example, with a different character since the Koopa I'm using apparently doesn't have Normals problems.



Note the inconsistent and faulty lighting around the eyes and mouth.

You can average the normals by using an Edit Normals modifier (from the same drop-down as Edit Mesh). Select all polygons and drop-down to "Edit Normals".





Now that Baby Luigi looks like a pin-cushion. Don't get confused by the "Normals" modifier, it's not the same thing. If you accidentally clicked "Normals" instead of Edit Normals, your character will look dark.

Select one of the blue "pins", and then CTRL + A to select all of them. They should all turn red like this. Make sure you have all polygons selected.



Check "Unify/Break to Average" and, below, "Use Threshold", like in the pic above. Then click on the "selected" tab...and....



Looks good now!

UVs
UVs tell the model where to map textures. Models ripped from New Super Mario Bros. Wii and Mario Kart Wii have the issue of mirroring the texture UV tileset, which doesn't export properly and show up badly in 3DS Max (for example, Mario shows up one-eyed most likely). Here's an example of what I'm talking about.



Yikes. Baby Luigi became a cyclops. You either have to use Unwrap UV or add a mirror version to the images. That is actually do-able in Paint: just grab the affected texture, make room for it, copy, paste, and flip it accordingly.







The more complex route, but means that you don't have to flip all textures, (and you have to do this at some point), comes to UnWrap UVW. Selected the affected polygon, and add an UnWrap UVW modifier.



Then, go under Parameters and hit "Edit" until a new window shows up.



Then go to the drop-down window "Map# "texture_name.ext"" and select the one of your textures.



Manipulating UVs has similar controls to manipulating models, except you're on a 2D plane instead of a 3D plane. You can switch between different manipulations with right clicking. Try each one out and see what they do: they range from move, rotate, scale, and freeform gizmo. What appears, as always, is that the textures don't tile mirrored and instead repeat. Trial and error can reveal with areas are affected, but to a trained eye like mine, these are the ones that are bad.



Make the window like this, by the way, so you can see the textures in the model being affected at the same time.



It appears I need to mirror those points horizontally. Here's what you need to do: go to Tools and click "Mirror Horizontal". Don't mistaken it for Flip Horizontally, it's not the same thing!!!







Now I'm not going to show every step. But here's what I did in order to get the result:

1. Selected all, Flip Horizontally

2. Used Freeform gizmo, scaled it via corners of the box



Once done, right click on the stack of modifiers, and click “Collapse All”. A warning will pop up, say yes. Make sure to save!!!





Rigging your Model
Once done and you're satisfied with your model, it's time to skin it! Skinning means assigning vertices to a manipulator (called a bone). It is used to ease the process of animating, so if you want to move only the head, you assign the head vertices to the appropriate bone. Well the head is extremely easy to skin in this game, considered that it is a separate object from the body. Just click on ALL head polygons, then click “Skin”.



Now, go to the right, first click "Edit Envelopes" and click “Add” in Add bones. Add Mario's head bone.



Annnnnd that's it! Since there's only one bone, all of your polygons will be automatically rigged to that one bone. It's ready to be exported. Select your skinned head polygons and the Mario head bone, and export it as an Autodesk Collada .dae. Make sure you select “Export Selected” and select the only polygons you want exported (that being the head), you really don't want to export everything else.



Once you exported it, make sure your model is scaled to centimeters instead of inches. That's because you'll have scaling issues and therefore, you'll model will appear miniscule in the game if not scaled to the proper units!



NOTE: The propeller suit head has TWO bones. One for the head, the other for the animating propeller. I will make a section for this.

Rigging Bodies
Now, time to rig the body. Open a new scene in 3DS Max, import your vanilla body, and Merge the scene with your body you want (the one where you saved it with your head, preferably) instead of importing it.



Select the scene with the body. And merge your needed parts into the scene.

(fastforward because Koopa Troopa's UVs are seriously messed up and I fixed them. You can fix UVs using the method I have stated earlier. A way to track down bad UVs is to click on the affected vertices and look at the texture map to see where it's selected)



Now, you want Koopa in the origin. Just as I rotated with exact values earlier, I will move using exact values. Like selecting "Rotate", click the black box next to "Move" instead of the move selection itself. A window should pop up, and then, in "Absolute World", type 0 for all values, except the Z value. It will move Koopa to the origin.



Unfortunately, Koopa's arms aren't T-posed so I have to select their arms by element and put them into T-pose. Most characters don't need to solve this so, I'll skip that as well. Keep in mind I selected this by vertices, and rotated his arm so it fits Mario's arms.

A tip I will share: if you want to make Mario's model see-through, right click on Mario's polygon, select "Object Properties" and check "See-Through".







Once you're done, delete Mario's model.

Now, select your body polygon, and apply the Skin modifier the same manner you did for the head. Now, as you did for head, click "Add" and Add all bones you see in the list.



Now click on Edit Envelopes and make sure "vertices" is checked. It's tougher to rig the body because once you select your bones, your vertexes will be rigged in undesirable areas, as demonstrated by the red highlight on the neck, where the chest is. The red highlight means that it will move with that particular bone, so you have bad looking vertices poking out of areas you don't want to. To fix this, go to the right, in Skin modifier, scroll down, and select on the wrench icon, which will bring up the Weight editor (weights just mean the degree the vertex is rigged to the bone).



Depending on the bone selected, a region or so will be colored red (it's red from strongest influence to blue to nothing to weakest by default). Select ALL vertices (CTRL + A), and, using the small window on the upper left part of the screen, rig them to a single bone, typically the Waist Bone for me. How to rig? Click on the 1 square once your vertices are selected. It tells all vertices to move with this bone completely....so theoretically, if it animates, it will be in this one static pose.



Now, either start with the arm or leg bone, either choice is fine. I will start with the arm, though. Select the arm (except for the part where the arm meets the body, like the joint where the shoulder is...before you do that, be sure to uncheck "Select by Element" so you unselect only the vertices you don't want. Reminder that if you want to deselect, hold ALT as you would use CTRL to add vertices), and rig it to the arm bone. To ease with selecting the arm, IF your model's arm is separated into "parts", you can check "Select Element" to select only the arms.





If not, you have to manually select the arm vertices.

Here's a pic of what it should look like, alongside some of my guidelines. The forearm bone is called arm_l1 in this case. It's coded, of course, with "L" being left arm.



Then, from elbow to the hand, rig it to the arm bone; deselect vertices in the forearm, by holding ALT and deselecting unwanted vertices.



Rig the hand to the hand bone, and continue with the process of holding ALT to deselect any unwanted vertices.



If you still don't understand, try copying the results from my images.

The same thing applies to the legs. First select the legs, either by element or not, leave the very tip top of the thigh alone, rig it to leg bone,



then select from knee to foot, rig to knee bone



then select the foot, rig to foot bone.



Repeat the same process for the other side. After that, make sure you test your rig by hitting H, selecting bones, and rotating them. If you see any bad rigs, you have to fix them. If it doesn't work, experiment around a bit. But make sure you undo your alterations to the bones...make sure your model ends up T-posed and before you rotated the bones whenever you're done testing it.



Not exactly perfect but considering you're using another character's build, it's not too bad at all.

While in the rigging process, for characters with any sort of symmetry, you may like using the Mirror tool. The Mirror tool under the Skin modifier can mirror your skin weights for one side. Make sure you rig just one side (e.g. only the left arm and leg; rigging the entire waist is fine.) Scroll down, click on "Mirror Mode" and either click "Paste Blue to Green Verts" or "Paste Green to Blue Verts" depending on which side of your model is rigged.

This saves SO much time rigging most models, as you will need to rig only half the character most of the time.

Once you're done, save it and export it as a Autodesk Collada .dae, the same way you've done the head. You're done rigging!

Importing your model into BrawlBox
This is a relatively simple process. Open your *character*.arc file with BrawlBox. Then, expand g3d, expand model.brres. Right click on the proper mdl0 file (for this example, it's MB_model) and click "Replace".



A window will pop up. Make sure your settings are the same as on the screen (don't worry about off-screen stuff, if it's default, it should be fine)



Now...



Not bad! Since my model uses the exact same texture name as the one here, it "borrows" from it. Let's change it, shall we? We don't want a Koopa looking like THAT in the game, right? Scroll down until you found the proper texture.



It's this one.

Right click on it, and click "Replace"



Find the texture you want to replace, and this window will pop up.



The settings here are default and they should be fine. Press OK, and it should replace properly, so you get good-looking textures in BrawlBox



Do the same steps for the head, and this should be the result.



Save it, but be sure to keep back-ups first! Now you need to undertake more steps.

Tweaks, Shaders, Colors, and Other Things
Now here's the part where you want your model looking good or making sure it works in New Super Mario Bros. Wii. Having a vanilla file helps lots for this, as it helps you reference a general template for what you want to do when you make shaders.

Copy my values I wrote down in the following images for your shaders and material files.

Materials Values




(note: lm_01p, lm_02p, and star_env all share the same values)

Shaders Values








I'd also like to point out that duplicating what I wrote in the Shaders and Materials files also enables transparency, so you can do a lot of things, like hide the model, give different model differences to fire and ice characters, and even interchange in between the Toads! Be wary of the filesize though, as if your model is too complex, the game may not load properly, especially if you're playing Newer Super Mario Bros. Wii and trying to access World 8.

Another useful thing is to tinker with your CullMode parameters in your material file. If you select "Cull_None", both sides of your model should show. On default, it's set to "Cull_Inside", but if your model requires two faces to be shown due to a flat texture, enable "Cull_None" instead.

Any troubleshooting or suggestions, feel free to post in this thread.