This post will explain the steps required to replace Mario or any character/enemy model keeping their skeletons and animations in-tact. The limitation is that the new character will need to have approximately the same structure. This is due to a current (can it be fixed?) limitation in the editor where joints defined as matrices can't be converted correctly to separate scale, rotation and translation values as required by the BMD and BCA formats.
This tutorial will assume that you're using Blender.
For the four main characters eg. Mario the head and body are two (3) separate models - the body, the head with a hat and the head without a hat. We'll start with the body.
The first step is to export Mario's model as DAE. We'll need this is for the bone structure.
Next, import the model into Blender and delete the mesh.
If you haven't already done so, import the model that you wish to replace Mario with. Note, that it should be a mesh only ie. no skeletal structure attached.
Position your model over the skeleton so that the size and location match up
Ensure nothing is selected then select your mesh followed by the skeleton - the order of selection matters
Press Ctrl + P and select "Armature Deform" > "With Empty Groups". This attaches the skeleton to your model
Next, assign vertices to each bone to match approximately how Mario's were assigned. Note that you may only assign a weighting of 1 (assign to bone) or 0 (don't assign to bone) due to restrictions in the BMD format.
Once finished, select your model and the skeleton, "Object > Apply > Rotation". Then rotate both on the X axis by -90 degrees (type "R X -90") and apply rotation again. Then rotate on X axis by +90 degrees (R X 90) but do not apply rotation.
Export your model to DAE, ensuring to check the option "Include Material Textures"
The following steps are shown but not well explain:
When importing models into SM64DS textures are vertically flipped. To get around this, it is suggested that you create a vertically flipped copy of each texture and ensure that your DAE model references this. The simplest way is to use Irfanview's batch conversion feature and copy the flipped images into a separate folder, keeping the image names the same as the originals and simply pointing all textures within the DAE to within this separate folder.
Also ensure that all texture names within the DAE are relative eg. if your image is located at "c:/Model/Textures/Tex01.png" and your model located in "c:/Model/Model.DAE", then the texture name within the DAE model would be "./Textures/Tex01.png"
Next, you'll need the original Mario model DAE that was exported at the beginning. Open it in a text editor and locate the line "<library_visual_scenes>".
Locate the same line in your exported model. You'll see a number of <node> elements, two of which should contain "type="NODE"". If it is the case that there is more than one with type set to NODE then you've done something wrong.
The first <node> of type "NODE" should have an ID of something like "Armature" and contain a tree of child <node> elements with "type" set to "JOINT". The second <node> of type "NODE" should not contain any child <node>s and should contain an <instance_controller> which should contain a <skeleton> element.
We now need to replace the first <node> of type "NODE" with the skeleton structure in the original Mario model. Select the Armature node and all its child nodes, ensuring that you select all the closing tags (</node>). You should now have only one <node> left - the one with the <instance_controller>.
The original Mario model will contain only one <node> of type "NODE", select everything other than this node and paste it into your exported model at the location you have just deleted the Armature <node> from.
An example of replacing the joints data is given below:
Before, after exporting from Blender:
If the character you're replacing doesn't have any BTP files (texture sequence animation eg. eyes blinking) associated with it eg. Mario's body, then you can stop here and import your model, otherwise eg. for Mario's head, keep reading.
In order to work, the texture, palette and material names in your model must match those found in the BTP files used with the model meaning there are two choices: 1) ensure that the textures in your model to be imported match the original or 2) modify every BTP file so that its material, texture and palette names match those in your model. If there's only one or two BTP files, option 2 is probably best, otherwise if there are quite a few as is the case with Mario, then you should use option 1. Option 1 is explained below.
First, when importing textures into SM64DSe, palette names are generated by appending "_pl" to the end of the texture name - this matches the convention that Nintendo have followed and allows option 1 to work for most models. The exception is the model for Luigi's body, you'll need to use this modified BTP file.
Mario's head has four matierals and four textures whose names must match exactly (you're allowed to have other materials and textures as well):
material: mat_eye, mat_eye_2, mat_eye_3, mat_eye_4
textures: mario_eye_1/mario_eye_1_pl, mario_eye_2/mario_eye_2_pl, mario_eye_3/mario_eye_3_pl, mario_eye_4/mario_eye_4_pl
You can get these fromt the BTP/texture editor - they won't all show up in the exported model.
In order to ensure that you have a texture name, name your replacement eye textures as above eg. "mario_eye_1" - note the lack of extension - this is important.
Open your exported head model in a text editor. You'll notice that Blender appends "-material" to the end of material names. Ensure that you have a material called "mat_eye" - use find and replace.
Next, we need to add the other three materials and textures:
1. Starting with the iamges, locate the line <library_images> and add definitions for any missing textures, making sure that the texture name (filename) matches the BTP file:
3. Now the effects, we need to add <effect>s for each of the new materials (specify material settings). Add new effects for each of the missing materials, referencing the <image> elements that we've created:
do we need to be an admin to "edit with notepad", or does windows 8.1 not work? I do not use an admin account because I am afraid I might delete something really important.
do we need to be an admin to "edit with notepad", or does windows 8.1 not work? I do not use an admin account because I am afraid I might delete something really important.
No, right-click on the file > "Open with" > select notepad. I would recommend you find a better text editor like Notepad++ though.
Newcomer Banned for being a total noob and a smartass
Level: 8
Posts: 1/9
EXP: 1537
Next: 650
Since: 11-16-15
From: dwight
Last post: 3239 days ago
Last view: 3001 days ago
i need help with my hack, i made a little bit of the blender stuff here - https://drive.google.com/open?id=0Bzebmq1lTBScbEZKMmlIRHdBd2c, but its most likely screwed up, i completely do not understand the tutorial very much, i put my file into the game and the screen turns white, so i deleted the file and got a new rom. I just cannot seem to get this, i need alot of help replacing mario for larry koopa here
Newcomer Banned for being a total noob and a smartass
Level: 8
Posts: 2/9
EXP: 1537
Next: 650
Since: 11-16-15
From: dwight
Last post: 3239 days ago
Last view: 3001 days ago
I just realized that I cannot do it, I lack a numpad, therefore I cannot do the selecting stuff, Can someone PLEEEEEZZZZZ help me out with the rest of the blender stuff and the text editor stuff, My model+the blender project i started is herehttps://drive.google.com/open?id=0Bzebmq1lTBScNjZ4Rzg2ZHNLZVE
Since: 10-29-15
From: The Grandfather Paradox Time Loop
Last post: 1979 days ago
Last view: 1618 days ago
your tutorial is great, but where is mario's model (body) actually located?
____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka.........
Since: 10-29-15
From: The Grandfather Paradox Time Loop
Last post: 1979 days ago
Last view: 1618 days ago
It's working! For some strange reason, he's smaller than he should be. Is there a way to fix this?
____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka.........
Since: 10-29-15
From: The Grandfather Paradox Time Loop
Last post: 1979 days ago
Last view: 1618 days ago
All I see is a head sticking out of a skirt when I do not scale the animation. This tutorial works so well!
Would it be possible to make the colors of the piantas vary?
____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka.........