Kuribo64
Views: 22,889,025 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
10-04-24 06:50 PM
Guest:

0 users reading [Tutorial] How to Replace Mario's Model with a Custom Model | 1 bot

Main - General SM64DS hacking - [Tutorial] How to Replace Mario's Model with a Custom Model Hide post layouts | New reply

Pages: 1 2 3
Fiachra
Posted on 04-24-15 07:12 PM (rev. 3 of 12-24-15 11:05 AM) Link | #59200
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"

These steps are shown in the below video:


Model used in video available here.

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:

<library_visual_scenes>
    <visual_scene id="Scene" name="Scene">
        <node id="Armature" name="Armature" type="NODE">
            <matrix sid="transform">1 0 0 0 0 -1.62921e-7 -1 0 0 1 -1.62921e-7 0 0 0 0 1</matrix>
            <node id="mario_all_root" name="mario_all_root" sid="mario_all_root" type="JOINT">
                <matrix sid="transform">1 -9.51965e-15 -3.66557e-16 0 9.51965e-15 0.9970391 0.07689647 0 -3.66557e-16 -0.07689647 0.9970391 0 0 0 0 1</matrix>
                <node id="skl_root" name="skl_root" sid="skl_root" type="JOINT">
                    <matrix sid="transform">3.50105e-9 1.19209e-7 1 0 0.9970391 -0.07689647 5.58793e-9 6.162535 0.07689647 0.997039 -1.11759e-7 2.98023e-8 0 0 0 1</matrix>
                    <node id="leg_l1" name="leg_l1" sid="leg_l1" type="JOINT">
                        <matrix sid="transform">-1.62921e-7 -1 -2.56388e-14 0.1032715 1 -1.62921e-7 3.06565e-7 0.3071288 -3.06565e-7 2.38626e-14 0.9999999 1.443848 0 0 0 1</matrix>
                        <node id="leg_l2" name="leg_l2" sid="leg_l2" type="JOINT">
                            <matrix sid="transform">-1 -1.69462e-8 1.47515e-7 1.49012e-8 -1.79383e-8 0.9999999 -1.64553e-7 2.871583 -1.50996e-7 2.07352e-7 -0.9999999 0 0 0 0 1</matrix>
                            <node id="ankle_l1" name="ankle_l1" sid="ankle_l1" type="JOINT">
                                <matrix sid="transform">-1 -4.25397e-7 1.5695e-7 0 -4.27441e-7 1 1.86308e-7 2.0083 -1.50996e-7 1.94179e-7 -1 1.19209e-7 0 0 0 1</matrix>
                            </node>
                        </node>
                    </node>
                    <node id="leg_r1" name="leg_r1" sid="leg_r1" type="JOINT">
                        <matrix sid="transform">-2.8213e-7 -1 8.30269e-8 0.1032715 1 -2.8213e-7 3.06565e-7 0.3071291 -3.06565e-7 8.3027e-8 0.9999999 -1.443847 0 0 0 1</matrix>
                        <node id="leg_r2" name="leg_r2" sid="leg_r2" type="JOINT">
                            <matrix sid="transform">-1 -1.2851e-7 1.42553e-7 1.49012e-8 -1.27639e-7 1 -1.54143e-7 2.871583 -1.50996e-7 -2.29128e-7 -1 0 0 0 0 1</matrix>
                            <node id="ankle_r1" name="ankle_r1" sid="ankle_r1" type="JOINT">
                                <matrix sid="transform">-1 -1.78907e-7 1.47026e-7 -1.49012e-8 -1.75169e-7 0.9999999 -7.67597e-8 2.008301 -1.50996e-7 5.73345e-9 -1 0 0 0 0 1</matrix>
                            </node>
                        </node>
                    </node>
                    <node id="spin" name="spin" sid="spin" type="JOINT">
                        <matrix sid="transform">1 0 3.02245e-9 0.9724116 6.19806e-16 1 0 -1.49012e-7 -3.02245e-9 0 1 -1.15921e-7 0 0 0 1</matrix>
                        <node id="arm_l1" name="arm_l1" sid="arm_l1" type="JOINT">
                            <matrix sid="transform">-1 4.86882e-7 9.74673e-8 2.949951 9.74673e-8 -7.54979e-8 1 -0.03271472 4.86882e-7 0.9999998 7.54978e-8 2.262451 0 0 0 1</matrix>
                            <node id="arm_l2" name="arm_l2" sid="arm_l2" type="JOINT">
                                <matrix sid="transform">1 -4.86882e-7 1.56237e-7 -9.53674e-7 -5.33514e-9 1 -7.10543e-14 1.95874 -1.55627e-7 -8.54135e-9 1 0 0 0 0 1</matrix>
                                <node id="wrist_l1" name="wrist_l1" sid="wrist_l1" type="JOINT">
                                    <matrix sid="transform">1.80034e-7 6.49116e-8 0.9999999 0 0.9999999 -3.17892e-8 -3.5734e-7 1.875 2.34442e-8 1 -6.40763e-8 -5.96046e-8 0 0 0 1</matrix>
                                </node>
                            </node>
                        </node>
                        <node id="arm_r1" name="arm_r1" sid="arm_r1" type="JOINT">
                            <matrix sid="transform">-1 -4.86881e-7 -1.40951e-7 2.949951 1.40951e-7 4.87336e-8 -1 -0.03271466 4.86882e-7 -0.9999998 -4.87335e-8 -2.262451 0 0 0 1</matrix>
                            <node id="arm_r2" name="arm_r2" sid="arm_r2" type="JOINT">
                                <matrix sid="transform">1 -1.13138e-7 -4.60833e-8 0 -9.56599e-9 1 -8.52651e-14 1.95874 4.29678e-8 3.71467e-9 1 0 0 0 0 1</matrix>
                                <node id="wrist_r1" name="wrist_r1" sid="wrist_r1" type="JOINT">
                                    <matrix sid="transform">-4.27059e-7 7.5498e-8 -1 -9.53674e-7 1 6.35783e-8 -3.04356e-7 1.875001 6.72929e-8 -1 -7.37623e-8 0 0 0 0 1</matrix>
                                </node>
                            </node>
                        </node>
                        <node id="face_1" name="face_1" sid="face_1" type="JOINT">
                            <matrix sid="transform">7.54979e-8 -1 4.37114e-8 4.276611 1 7.54979e-8 6.81461e-8 1.49012e-7 -6.81461e-8 4.37114e-8 1 -2.60352e-7 0 0 0 1</matrix>
                        </node>
                    </node>
                </node>
            </node>
        </node>
        <node id="mario_all_root-node" name="mario_all_root-node" type="NODE">
            <translate sid="location">0 0 0</translate>
            <rotate sid="rotationZ">0 0 1 0</rotate>
            <rotate sid="rotationY">0 1 0 0</rotate>
            <rotate sid="rotationX">1 0 0 0</rotate>
            <scale sid="scale">1 1 1</scale>
            <instance_controller url="#Armature_mario_all_root-node-skin">
                <skeleton>#mario_all_root</skeleton>
                <bind_material>
                    <technique_common>
                        <instance_material symbol="mat_body_001-material" target="#mat_body_001-material"/>
                    </technique_common>
                </bind_material>
            </instance_controller>
        </node>
    </visual_scene>
</library_visual_scenes>

After copying from original Mario model:

<library_visual_scenes>
    <visual_scene id="Scene" name="Scene">
        <node id="mario_all_root" name="mario_all_root" sid="mario_all_root" type="JOINT">
            <translate sid="translate">0 0 0</translate>
            <rotate sid="rotationZ">0 0 1 0</rotate>
            <rotate sid="rotationY">0 1 0 0</rotate>
            <rotate sid="rotationX">1 0 0 0</rotate>
            <scale sid="scale">1 1 1</scale>
            <node id="skl_root" name="skl_root" sid="skl_root" type="JOINT">
                <translate sid="translate">0 6.144287 -0.473877</translate>
                <rotate sid="rotationZ">0 0 1 90</rotate>
                <rotate sid="rotationY">0 1 0 0</rotate>
                <rotate sid="rotationX">1 0 0 90</rotate>
                <scale sid="scale">1 1 1</scale>
                <node id="leg_l1" name="leg_l1" sid="leg_l1" type="JOINT">
                    <translate sid="translate">0.1032715 0.3071289 1.443848</translate>
                    <rotate sid="rotationZ">0 0 1 180</rotate>
                    <rotate sid="rotationY">0 1 0 0</rotate>
                    <rotate sid="rotationX">1 0 0 -180</rotate>
                    <scale sid="scale">1 1 1</scale>
                    <node id="leg_l2" name="leg_l2" sid="leg_l2" type="JOINT">
                        <translate sid="translate">2.871582 0 0</translate>
                        <rotate sid="rotationZ">0 0 1 0</rotate>
                        <rotate sid="rotationY">0 1 0 0</rotate>
                        <rotate sid="rotationX">1 0 0 180</rotate>
                        <scale sid="scale">1 1 1</scale>
                        <node id="ankle_l1" name="ankle_l1" sid="ankle_l1" type="JOINT">
                            <translate sid="translate">2.008301 0 0</translate>
                            <rotate sid="rotationZ">0 0 1 -90</rotate>
                            <rotate sid="rotationY">0 1 0 0</rotate>
                            <rotate sid="rotationX">1 0 0 0</rotate>
                            <scale sid="scale">1 1 1</scale>
                        </node>
                    </node>
                </node>
                <node id="leg_r1" name="leg_r1" sid="leg_r1" type="JOINT">
                    <translate sid="translate">0.1032715 0.3071289 -1.443848</translate>
                    <rotate sid="rotationZ">0 0 1 180</rotate>
                    <rotate sid="rotationY">0 1 0 0</rotate>
                    <rotate sid="rotationX">1 0 0 -180</rotate>
                    <scale sid="scale">1 1 1</scale>
                    <node id="leg_r2" name="leg_r2" sid="leg_r2" type="JOINT">
                        <translate sid="translate">2.871582 0 0</translate>
                        <rotate sid="rotationZ">0 0 1 0</rotate>
                        <rotate sid="rotationY">0 1 0 0</rotate>
                        <rotate sid="rotationX">1 0 0 180</rotate>
                        <scale sid="scale">1 1 1</scale>
                        <node id="ankle_r1" name="ankle_r1" sid="ankle_r1" type="JOINT">
                            <translate sid="translate">2.008301 0 0</translate>
                            <rotate sid="rotationZ">0 0 1 -90</rotate>
                            <rotate sid="rotationY">0 1 0 0</rotate>
                            <rotate sid="rotationX">1 0 0 0</rotate>
                            <scale sid="scale">1 1 1</scale>
                        </node>
                    </node>
                </node>
                <node id="spin" name="spin" sid="spin" type="JOINT">
                    <translate sid="translate">0.9724121 0 0</translate>
                    <rotate sid="rotationZ">0 0 1 0</rotate>
                    <rotate sid="rotationY">0 1 0 0</rotate>
                    <rotate sid="rotationX">1 0 0 0</rotate>
                    <scale sid="scale">1 1 1</scale>
                    <node id="arm_l1" name="arm_l1" sid="arm_l1" type="JOINT">
                        <translate sid="translate">2.949951 -0.03271484 2.262451</translate>
                        <rotate sid="rotationZ">0 0 1 -126.5625</rotate>
                        <rotate sid="rotationY">0 1 0 -90</rotate>
                        <rotate sid="rotationX">1 0 0 -53.4375</rotate>
                        <scale sid="scale">1 1 1</scale>
                        <node id="arm_l2" name="arm_l2" sid="arm_l2" type="JOINT">
                            <translate sid="translate">1.95874 0 0</translate>
                            <rotate sid="rotationZ">0 0 1 0</rotate>
                            <rotate sid="rotationY">0 1 0 0</rotate>
                            <rotate sid="rotationX">1 0 0 -180</rotate>
                            <scale sid="scale">1 1 1</scale>
                            <node id="wrist_l1" name="wrist_l1" sid="wrist_l1" type="JOINT">
                                <translate sid="translate">1.875 0 0</translate>
                                <rotate sid="rotationZ">0 0 1 0</rotate>
                                <rotate sid="rotationY">0 1 0 0</rotate>
                                <rotate sid="rotationX">1 0 0 0</rotate>
                                <scale sid="scale">1 1 1</scale>
                            </node>
                        </node>
                    </node>
                    <node id="arm_r1" name="arm_r1" sid="arm_r1" type="JOINT">
                        <translate sid="translate">2.949951 -0.03271484 -2.262451</translate>
                        <rotate sid="rotationZ">0 0 1 -110.2149</rotate>
                        <rotate sid="rotationY">0 1 0 90</rotate>
                        <rotate sid="rotationX">1 0 0 69.78516</rotate>
                        <scale sid="scale">1 1 1</scale>
                        <node id="arm_r2" name="arm_r2" sid="arm_r2" type="JOINT">
                            <translate sid="translate">1.95874 0 0</translate>
                            <rotate sid="rotationZ">0 0 1 0</rotate>
                            <rotate sid="rotationY">0 1 0 0</rotate>
                            <rotate sid="rotationX">1 0 0 180</rotate>
                            <scale sid="scale">1 1 1</scale>
                            <node id="wrist_r1" name="wrist_r1" sid="wrist_r1" type="JOINT">
                                <translate sid="translate">1.875 0 0</translate>
                                <rotate sid="rotationZ">0 0 1 0</rotate>
                                <rotate sid="rotationY">0 1 0 0</rotate>
                                <rotate sid="rotationX">1 0 0 0</rotate>
                                <scale sid="scale">1 1 1</scale>
                            </node>
                        </node>
                    </node>
                    <node id="face_1" name="face_1" sid="face_1" type="JOINT">
                        <translate sid="translate">4.276611 0 0</translate>
                        <rotate sid="rotationZ">0 0 1 90</rotate>
                        <rotate sid="rotationY">0 1 0 0</rotate>
                        <rotate sid="rotationX">1 0 0 0</rotate>
                        <scale sid="scale">1 1 1</scale>
                    </node>
                </node>
            </node>
        </node>
        <node id="mario_all_root-node" name="mario_all_root-node" type="NODE">
            <translate sid="location">0 0 0</translate>
            <rotate sid="rotationZ">0 0 1 0</rotate>
            <rotate sid="rotationY">0 1 0 0</rotate>
            <rotate sid="rotationX">1 0 0 0</rotate>
            <scale sid="scale">1 1 1</scale>
            <instance_controller url="#Armature_mario_all_root-node-skin">
                <skeleton>#mario_all_root</skeleton>
                <bind_material>
                    <technique_common>
                        <instance_material symbol="mat_body_001-material" target="#mat_body_001-material"/>
                    </technique_common>
                </bind_material>
            </instance_controller>
        </node>
    </visual_scene>
</library_visual_scenes>

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:

    <image id="mario_eye_2-img" name="mario_eye_2-img">
        <init_from>mario_eye_2</init_from>
    </image>
    <image id="mario_eye_3-img" name="mario_eye_3-img">
        <init_from>mario_eye_3</init_from>
    </image>
    <image id="mario_eye_4-img" name="mario_eye_4-img">
        <init_from>mario_eye_4</init_from>
    </image>
  • 2. Next are the materials, locate the line "<library_materials> and add definitions for any missing materials, for Mario's head this will be:

    <material id="mat_eye_2" name="mat_eye_2">
        <instance_effect url="#mat_eye_2-effect" />
    </material>
    <material id="mat_eye_3" name="mat_eye_3">
        <instance_effect url="#mat_eye_3-effect" />
    </material>
    <material id="mat_eye_4" name="mat_eye_4">
        <instance_effect url="#mat_eye_4-effect" />
    </material>
  • 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:

    <effect id="mat_eye_2-effect">
        <profile_COMMON>
            <newparam sid="mario_eye_2-img-surface">
                <surface type="2D">
                    <init_from>mario_eye_2-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_eye_2-img-sampler">
                <sampler2D>
                    <source>mario_eye_2-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_eye_2-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>flip flip</tex_tiling>
                    <tex_scale>2 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>
    <effect id="mat_eye_3-effect">
        <profile_COMMON>
            <newparam sid="mario_eye_3-img-surface">
                <surface type="2D">
                    <init_from>mario_eye_3-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_eye_3-img-sampler">
                <sampler2D>
                    <source>mario_eye_3-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_eye_3-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>flip flip</tex_tiling>
                    <tex_scale>2 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>
    <effect id="mat_eye_4-effect">
        <profile_COMMON>
            <newparam sid="mario_eye_4-img-surface">
                <surface type="2D">
                    <init_from>mario_eye_4-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_eye_4-img-sampler">
                <sampler2D>
                    <source>mario_eye_4-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_eye_4-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>flip flip</tex_tiling>
                    <tex_scale>2 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>

Continued in next post >>>

Fiachra
Posted on 04-24-15 07:15 PM Link | #59201
>>> Continued from above:

A full example library_images, library_materials and library_effects is given below:

<library_images>
    <image id="mario_eye_1-img" name="mario_eye_1-img">
        <init_from>mario_eye_1</init_from>
    </image>
    <image id="mario_eye_2-img" name="mario_eye_2-img">
        <init_from>mario_eye_2</init_from>
    </image>
    <image id="mario_eye_3-img" name="mario_eye_3-img">
        <init_from>mario_eye_3</init_from>
    </image>
    <image id="mario_eye_4-img" name="mario_eye_4-img">
        <init_from>mario_eye_4</init_from>
    </image>
    <image id="mario_head-img" name="mario_head-img">
        <init_from>mario_head.png</init_from>
    </image>
</library_images>
<library_effects>
    <effect id="mat_eye-effect">
        <profile_COMMON>
            <newparam sid="mario_eye_1-img-surface">
                <surface type="2D">
                    <init_from>mario_eye_1-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_eye_1-img-sampler">
                <sampler2D>
                    <source>mario_eye_1-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_eye_1-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>flip flip</tex_tiling>
                    <tex_scale>2 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>
    <effect id="mat_eye_2-effect">
        <profile_COMMON>
            <newparam sid="mario_eye_2-img-surface">
                <surface type="2D">
                    <init_from>mario_eye_2-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_eye_2-img-sampler">
                <sampler2D>
                    <source>mario_eye_2-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_eye_2-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>flip flip</tex_tiling>
                    <tex_scale>2 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>
    <effect id="mat_eye_3-effect">
        <profile_COMMON>
            <newparam sid="mario_eye_3-img-surface">
                <surface type="2D">
                    <init_from>mario_eye_3-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_eye_3-img-sampler">
                <sampler2D>
                    <source>mario_eye_3-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_eye_3-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>flip flip</tex_tiling>
                    <tex_scale>2 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>
    <effect id="mat_eye_4-effect">
        <profile_COMMON>
            <newparam sid="mario_eye_4-img-surface">
                <surface type="2D">
                    <init_from>mario_eye_4-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_eye_4-img-sampler">
                <sampler2D>
                    <source>mario_eye_4-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_eye_4-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>flip flip</tex_tiling>
                    <tex_scale>2 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>
    <effect id="mat_head-effect">
        <profile_COMMON>
            <newparam sid="mario_head-img-surface">
                <surface type="2D">
                    <init_from>mario_head-img</init_from>
                </surface>
            </newparam>
            <newparam sid="mario_head-img-sampler">
                <sampler2D>
                    <source>mario_head-img-surface</source>
                </sampler2D>
            </newparam>
            <technique sid="common">
                <phong>
                    <emission>
                        <color sid="emission">0 0 0 1.0</color>
                    </emission>
                    <ambient>
                        <color sid="ambient">0.5176471 0.5176471 0.5176471 1.0</color>
                    </ambient>
                    <diffuse>
                        <texture texture="mario_head-img-sampler" texcoord="UVMap" />
                    </diffuse>
                    <specular>
                        <color sid="specular">0 0 0 1.0</color>
                    </specular>
                    <transparency>
                        <float sid="transparency">1</float>
                    </transparency>
                </phong>
            </technique>
            <extra>
                <technique profile="SM64DSe">
                    <lights>1 0 0 0</lights>
                    <environment_mapping>0</environment_mapping>
                    <double_sided>0</double_sided>
                    <tex_tiling>repeat repeat</tex_tiling>
                    <tex_scale>1 1</tex_scale>
                    <tex_rotate>0</tex_rotate>
                    <tex_translate>0 0</tex_translate>
                </technique>
            </extra>
        </profile_COMMON>
    </effect>
</library_effects>
<library_materials>
    <material id="mat_eye" name="mat_eye">
        <instance_effect url="#mat_eye-effect" />
    </material>
    <material id="mat_eye_2" name="mat_eye_2">
        <instance_effect url="#mat_eye_2-effect" />
    </material>
    <material id="mat_eye_3" name="mat_eye_3">
        <instance_effect url="#mat_eye_3-effect" />
    </material>
    <material id="mat_eye_4" name="mat_eye_4">
        <instance_effect url="#mat_eye_4-effect" />
    </material>
    <material id="mat_head-material" name="mat_head">
        <instance_effect url="#mat_head-effect" />
    </material>
</library_materials>

You're now finally ready to import your model. If the game doesn't crash then congratulations, you've successfully imported your model!

Seemario65
Posted on 09-26-15 02:36 AM (rev. 2 of 09-26-15 02:38 AM) Link | #64441
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.

____________________
is not a bad signature

Fiachra
Posted on 09-26-15 07:39 PM Link | #64450
Posted by Seemario65
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.

Seemario65
(post deleted) #64559

pacmainia&luigi
(post deleted) #65466

LarryKoopaIsAwesome
Posted on 11-17-15 04:02 AM Link | #65719
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

LarryKoopaIsAwesome
Posted on 11-19-15 07:27 AM Link | #65744
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

Fiachra
Posted on 11-19-15 10:21 PM (rev. 2 of 11-19-15 10:29 PM) Link | #65770
File>User Preferences>Emulate Numpad

That'll treat the numbers above the letters the same as the numpad ones.

If you still can't get it, I'll take a look.

First thing you need to do is to attach the skeleton to the mesh (start at bullet point #5).

LarryKoopaIsAwesome
Posted on 11-19-15 11:48 PM Link | #65774
I don't know how to attach the skeleton to the mesh or how to find the bullet points and stuff like that, im very new to blender

Fiachra
Posted on 11-20-15 07:48 PM Link | #65785
I meant the bullet point in the tutorial above. Here it is working. You need to read and carefully follow each step.

LarryKoopaIsAwesome
Posted on 11-21-15 02:26 AM Link | #65793
when i tried to patch the file, everytime, no matter what patcher i use, it always crashes when i click apply patch.

Fiachra
Posted on 11-21-15 09:36 AM Link | #65800
Just import the DAE models.

LarryKoopaIsAwesome
(post deleted) #65807

pacmainia&luigi
Posted on 12-13-15 04:09 PM Link | #66294
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.........

Fiachra
Posted on 12-17-15 08:45 PM Link | #66381
/ARCHIVE/arc0.narc/data/player/mario_model.bmd

pacmainia&luigi
Posted on 12-25-15 09:29 PM (rev. 4 of 12-29-15 11:22 PM) Link | #66592
It's working! For some strange reason, he's smaller than he should be. Is there a way to fix this?[thumbnail]

____________________
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.........

Fiachra
Posted on 12-26-15 03:17 PM Link | #66600
You need to import the model with a larger scale (try 4). You'll have to scale not only the model but the animations as well. To do this:
  • Make a copy of your DAE model
  • Open the animation editor and open the Toad model and his first animation.
  • Export to DAE
  • Open the exported model in a text editor and copy the <library_animations> element into your copied Pianta model.
  • Import the copy into the animation editor with a scale of ~4.
  • Repeat all above steps for Toad's second animation.

pacmainia&luigi
(post deleted) #66604

pacmainia&luigi
Posted on 12-26-15 10:30 PM (rev. 5 of 02-19-16 06:20 PM) Link | #66605
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.........
Pages: 1 2 3

Main - General SM64DS hacking - [Tutorial] How to Replace Mario's Model with a Custom Model Hide post layouts | New reply

Page rendered in 0.191 seconds. (2048KB of memory used)
MySQL - queries: 30, rows: 237/237, time: 0.009 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.