Help:Replacing models: Difference between revisions

 
(13 intermediate revisions by 2 users not shown)
Line 8: Line 8:
*[https://github.com/KillzXGaming/Switch-Toolbox/releases Switch Toolbox] (Yes, even if you are using WiiU or Cemu)
*[https://github.com/KillzXGaming/Switch-Toolbox/releases Switch Toolbox] (Yes, even if you are using WiiU or Cemu)
*A 3D modeling program of your choice (common choices are 3ds Max and Blender)
*A 3D modeling program of your choice (common choices are 3ds Max and Blender)
*(optional) The [https://github.com/Aaaboy97/BotW-Tools/tree/master/CSV%20Exporting CSV export] script
*(optional) If you are using 3ds Max, the [https://github.com/Aaaboy97/BotW-Tools/tree/master/CSV%20Exporting CSV export] script
*(optional) If you are using 3ds Max, the [https://www.vg-resource.com/thread-29836.html BFRES importer] MaxScript may be helpful. (expand the "Wii U & Nintendo Switch - BFRES importer (originally by ItsEasyActually)" to find it)
*(optional) If you are using 3ds Max, the [https://www.vg-resource.com/thread-29836.html BFRES importer] MaxScript may be helpful. (expand the "Wii U & Nintendo Switch - BFRES importer (originally by ItsEasyActually)" to find it)
*(optional) [https://github.com/Shadsterwolf/BotWUnpacker/releases BotWUnpacker]
*(optional) [https://github.com/Shadsterwolf/BotWUnpacker/releases BotWUnpacker]
Line 16: Line 16:
===Obtaining a Rig===
===Obtaining a Rig===
[[File:ModelReplacement_obtainRig.png|alt=Obtaining a rig|thumb|The red box shows what to click to extract a model.]]
[[File:ModelReplacement_obtainRig.png|alt=Obtaining a rig|thumb|The red box shows what to click to extract a model.]]
[[File:ModelReplacement VertexBuffers.png|thumb|Select the object (left) and read the vertex buffers (right)]]
<blockquote>Summary: Export a model from the SBFRES you want to use, using Switch Toolbox. Take note of the skin count and the vertex buffers and formats.</blockquote>A "rig" or "skeleton" is a set of "bones" that animations use. Every model is made up of several pieces: objects (which tells the game how to make the model in 3D), materials (which tell the game what the model should look like), and the rig (which tells the game how the model moves during animations). If you were to consider a door, the objects would be the rectangle for the main door and sphere of the knob, the materials would be the wood grain and brown coloring of the door and silver reflective surface of the knob, and the rig would be what tells the game that the knob rotates and the door swings inward.
<blockquote>Summary: Export a model from the SBFRES you want to use, using Switch Toolbox. Take note of the skin count and the vertex buffers and formats.</blockquote>A "rig" or "skeleton" is a set of "bones" that animations use. Every model is made up of several pieces: objects (which tells the game how to make the model in 3D), materials (which tell the game what the model should look like), and the rig (which tells the game how the model moves during animations). If you were to consider a door, the objects would be the rectangle for the main door and sphere of the knob, the materials would be the wood grain and brown coloring of the door and silver reflective surface of the knob, and the rig would be what tells the game that the knob rotates and the door swings inward.
In order to obtain a rig, you should find the SBFRES archive for the model you wish to use a rig from. Most models are contained in the game files in the content\Model folder. Once you've chosen your SBFRES, copy it to a safe place away from the game files, so you don't accidentally modify any of the original game's files.
In order to obtain a rig, you should find the SBFRES archive for the model you wish to use a rig from. Most models are contained in the game files in the content\Model folder. Once you've chosen your SBFRES, copy it to a safe place away from the game files, so you don't accidentally modify any of the original game's files.
Line 26: Line 27:


===Import the Original to Your Workspace===
===Import the Original to Your Workspace===
[[File:ModelReplacement_importModel.png|alt=Import the Original Model|thumb|Click on 1 to expand the menu, then click on 2 (or highlight 2 and click on 3) to import.]]
[[File:ModelReplacement_importModel.png|alt=Import the Original Model|thumb|Click on 1 to expand the menu, then click on 2 (or highlight 2 and click on 3) to import. Blender's layout for this step is almost identical.]]
<blockquote>Summary: Import the DAE into a shared workspace with your model, so that the object list has your objects, the original objects, and the original skeleton.</blockquote>Open your 3D modeling program of choice, and bring your replacement model into the workspace. Delete your model's skeleton from the object list, if it has one. Then, go to File -> Import, and import the DAE model you extracted. If you exported multiple models, only import the model you are currently working with. For example, if you exported an entire armor, you should only import the legs (as they are generally the simplest to do). Once you have finished the "Export Your Rigged Model" step, return here to repeat the process for other models.
<blockquote>Summary: Import the DAE into a shared workspace with your model, so that the object list has your objects, the original objects, and the original skeleton.</blockquote>Open your 3D modeling program of choice, and bring your replacement model into the workspace. Then, go to File -> Import, and import the DAE model you extracted from the SBFRES. If you exported multiple models, only import the model you are currently working with. For example, if you exported an entire armor, you should only import the legs (or whatever part you are working with). Once you have finished the "Export Your Rigged Model" step, return here to repeat the process for other models.
You may get errors when you import - this is normal, you can ignore them.
You may see errors when you import with 3ds Max - this is normal, you can ignore them. Blender suppresses these errors, so you won't see them.
Combine the original model's objects, roughly along the lines of how your objects are. For example, if the original model has separate fingers, hands, and arms, and your model has separate hands and arms, combine the fingers with the hands. Or if your model is only a single object, combine all the original model's objects into a single object. In 3ds Max, you can do this with Command Panel -> Modify -> Edit Geometry -> Attach, and selecting the object to attach the selected object to. In Blender, you can do this by selecting multiple objects with Ctrl+click in Object mode, then right-clicking and selecting Join.


In your object list, you will now see the original model's objects along with your objects. You will also see the original model's skeleton, which is important to have and you should generally not touch it.
In your object list, you will now see the original model's objects along with your objects. You will also see the original model's skeleton, which is important to have and you should generally not touch it.
Line 35: Line 37:
[[File:ModelReplacement_alignModel.png|alt=Align Your Model|thumb|Select your model (1), select the mesh (2), select the type of thing to modify (3), and select how to modify it (4).]]
[[File:ModelReplacement_alignModel.png|alt=Align Your Model|thumb|Select your model (1), select the mesh (2), select the type of thing to modify (3), and select how to modify it (4).]]
<blockquote>Summary: Get your objects to match up with the original ones, as close as possible. Anything delicate is important: feet, hands/fingers, waists, necklines, handles of weapons, etc.</blockquote>In all likelihood, your model will differ greatly from the original you just imported. Using the Move, Rotate, and Scale tools, make sure your model lines up with the original's - the closer the better.
<blockquote>Summary: Get your objects to match up with the original ones, as close as possible. Anything delicate is important: feet, hands/fingers, waists, necklines, handles of weapons, etc.</blockquote>In all likelihood, your model will differ greatly from the original you just imported. Using the Move, Rotate, and Scale tools, make sure your model lines up with the original's - the closer the better.
If your model has more objects than the original, delete unnecessary objects - for example, the torso and head, if you are modeling the legs right now - and combine necessary objects until you have the same number of objects.
There are also plenty of tools in 3ds Max's Edit Poly/Mesh modes, or Blender's Sculpt mode for helping move the model around. In 3ds Max, you can right click on the Edit Mesh/Poly to convert between them. In Blender, one of Sculpt mode's tools is the Pose tool, which is quite good for moving limbs into place if you're modifying an armor.


If your model has fewer objects, do not worry, you'll be fine. Simply pick a few of the original objects to align with, and ignore the rest.
Rename your objects to something close to the original's, so that you can easily figure out which of your objects corresponds to which original object. This will help both during this step and later, during the "Replace the Original Model with Yours" step. For example, if you have an object for hair, it's encouraged to name it <code>Hair_###__Mt_Hair_###</code>, where ### is the number of the armor you might be working with, and Mt_Hair_### is the name of the material you want to use with it. Including the name of the material in the object is helpful so that when you need to reassign materials in Switch Toolbox (which you may have to do often, depending on how much trouble you have) you will be able to tell, straight away, which object needs which material.
 
Rename your objects to something close to the original, so that you can easily figure out which of your objects corresponds to which original object. This will help both during this step and later, during the "Replace the Original Model with Yours" step.


Note: If you need help with this step, there are many great tutorials on YouTube.
Note: If you need help with this step, there are many great tutorials on YouTube.




===Copy the Rig from the Original to Your Model===
===Apply the Rig from the Original to Your Model===
[[File:ModelReplacement_copyRig.png|alt=Copy the Rig|thumb|Select the original object (1), right click on the Skin modifier and copy it (2), select your replacement object (3), and right click in the modifier area and paste the Skin modifier there (4).]]
[[File:ModelReplacement_copyRig.png|alt=Copy the Rig|thumb|Select the original object (1), right click on the Skin modifier and copy it (2), select your replacement object (3), and right click in the modifier area and paste the Skin modifier there (4).]]
<blockquote>Summary: Copy the rig from the original object(s) to your object(s). Set maximum limit for bones to affect vertices to the object's skin count.</blockquote>Select the original object's rig (called the Skin modifier in 3ds Max) in the modifier list, then copy it. Select your object, then paste the rig onto it. If all has gone well, you're done with this step. Most modeling programs use one or more of a series of algorithms to map the rig of one object onto the rig of another object automatically, and they're generally pretty good about it.
<blockquote>Summary: Apply the rig from the original object(s) to your object(s). Set maximum limit for bones to affect vertices to the object's skin count.</blockquote>For 3ds Max: Select the original object's Skin modifier in the modifier list, then copy it. Select your object, then paste the rig onto it. If all has gone well, you're done with this step. 3ds Max uses one or more of a series of algorithms to map the rig of one object onto the rig of another object automatically, and it's generally pretty good about it.
After pasting the rig onto an object, set the limit for the number of bones to affect each vertex to the original skin limit. In 3ds Max, you can do this by scrolling the modifier rollout on the right side down to the bottom, expanding Advanced Parameters, and setting the number in the Bone Affect Limit box. Other programs will have different ways of setting this limit.
For Blender:
 
* Click and drag the object on top of the original object's Armature (the one with the orange upside-down triangle next to it), while holding shift and alt. This will assign the object to that armature, instead. Then, select the object in Object mode, go to the Modifiers tab (which looks like a diagonal wrench, in the bottom right area), and in the box that says Armature at the top, click on the box next to Object, and select the armature of the original model. If there is no box that says Armature at the top, click on Add Modifier and select Armature. There is now a box that says Armature at the top.
If you get the model into the game and the animations deform the model in strange ways, you'll need to come back and manually adjust the rigging, which is a very time-consuming process, documented in a number of excellent tutorials on YouTube.
* Select your object in Object mode. In the bottom right, click on the upside-down green triangle. If there is anything in the Vertex Groups tab, delete it all with the - button. Then, Ctrl+click the original object that most closely matches its location. Go into Weight Paint mode, click on the Weights button in the top left, and select Transfer Weights. In the bottom left, expand the new small tab there, if it is not already. For Vertex Mapping, select Nearest Face Interpolated. For Source Layers Selection, select By Name. For Destination Layers Matching, select All Layers.


After applying the rig onto an object, set the limit for the number of bones to affect each vertex to 4. In 3ds Max, you can do this by scrolling the modifier rollout on the right side down to the bottom, expanding Advanced Parameters, and setting the number in the Bone Affect Limit box. In Blender, you can do it with the Limit Total option, found right under the Transfer Weights option described earlier. Other programs will have different ways of setting this limit.


You also want your weights to be normalized. In 3ds Max, the weights are normalized by default. In Blender, in Weight Paint mode, you need to click on the screwdriver-and-wrench icon in the middle of the right side, expand Options, and select Auto Normalize.


If you get the model into the game and the animations deform the model in strange ways, you'll need to come back and manually adjust the rigging, which is a very time-consuming process, documented in a number of excellent tutorials on YouTube.


===Delete the Original Model's Objects===
===Delete the Original Model's Objects===
[[File:ModelReplacement_deleteObjects.png|alt=Delete Original Objects|thumb|The workspace has been cleared of the painted object, leaving only the custom, unpainted one and the skeleton.]]
[[File:ModelReplacement_deleteObjects.png|alt=Delete Original Objects|thumb|The workspace has been cleared of the painted object, leaving only the custom, unpainted one and the skeleton.]]
<blockquote>Summary: Delete the original model's objects, leaving just your objects and the original skeleton. Rename your objects to the originals' names.</blockquote>Delete all the objects from your workspace that you don't want to be imported to the game. This includes any secondary objects not part of your final model, your model's skeleton (but not the original model's skeleton), and the original model's objects.
<blockquote>Summary: Delete the original model's objects and your model's skeleton (if any), leaving just your objects and the original skeleton. Rename your objects.</blockquote>Delete all the objects from your workspace that you don't want to be imported to the game. This includes any secondary objects not part of your final model, your model's skeleton (but not the original model's skeleton), and the original model's objects.
It's also a good idea to rename the your objects to the names of the objects they're replacing. Though this isn't strictly necessary to get the replacement model to work, it can really help smooth things out later.
It's also a good idea to rename the your objects to names that describe what they are for. In Blender, renaming the upside-down orange triangle doesn't do it, you have to expand that and rename the upside-down green triangle. Though this isn't strictly necessary to get the replacement model to work, it can really help smooth things out later.




Line 66: Line 69:
===Export the Model from Your Modeling Program===
===Export the Model from Your Modeling Program===
[[File:ModelReplacement_exportModel.png|alt=Export Model|thumb|212x212px|Select the File menu (1), then click on export (2), or hover over it and click on Export (3).]]
[[File:ModelReplacement_exportModel.png|alt=Export Model|thumb|212x212px|Select the File menu (1), then click on export (2), or hover over it and click on Export (3).]]
<blockquote>Summary: Fairly simple, export your model. DAE is probably best.</blockquote>Using File -> Export, export your model as whatever type you wish. Switch Toolbox, as of writing this guide, only handles DAE properly. However, it has options for FBX and OBJ as well, and as it receives updates regularly, FBX and OBJ may become properly handled at any time.
<blockquote>Summary: Fairly simple, export your model. DAE is probably best.</blockquote>Using File -> Export, export your model as whatever type you wish. Switch Toolbox, as of writing this guide, only handles DAE properly. It has an option for FBX as well, and as it receives updates regularly, FBX or other formats may become properly handled at any time.
It also has an option for importing via CSV (which is not a model type) that is explained in the optional step, below.
It also has an option for importing via CSV (which is not a model type) that is explained in the optional step, below. CSV is only recommended if your exporter cannot export DAE or FBX for whatever reason.


If exporting in the DAE format with Blender, to maintain and enable the usage of correct weightings it is preferred that you use [https://softfamous.com/autodesk-fbx-converter/ Autodesk FBX Converter] as shown in [https://www.youtube.com/watch?v=OsjLow2OHcU&feature=emb_logo this guide].
Switch Toolbox now handles DAE's from Blender just fine, so there is no longer any need to use Autodesk FBX Converter, as was originally described here.


====Export the Model using CsvExportRewrite====
====Export the Model using CsvExportRewrite====
Line 80: Line 83:
A dialog window of import options will appear. The picture to the right contains settings for most armors, but you should generally match the formats you copied down in the first step of this tutorial.
A dialog window of import options will appear. The picture to the right contains settings for most armors, but you should generally match the formats you copied down in the first step of this tutorial.


Red box: Generally leave these unchecked. If your textures look all funky, try reimporting with Flip UVs. If you import and the model is not looking at you, but is instead face-down, reimport with Rotate -90 degrees checked. If you import and the model is face-up, use Rotate 90 degrees. If you modified the skeleton, use Import Bones. (It's possible that skeletons exported from Blender may not import correctly if you don't use Autodesk FBX Converter from [[https://zeldamods.org/wiki/Help:Replacing_models#Export_the_Model_from_Your_Modeling_Program #Export the Model from Your Modeling Program]].)
Red box: Generally leave these unchecked. If your textures look all funky, try reimporting with Flip UVs. If you import and the model is not looking at you, but is instead face-down, reimport with Rotate -90 degrees checked. If you import and the model is face-up, use Rotate 90 degrees. If you modified the skeleton, use Import Bones. (It's possible that skeletons exported from Blender may not import correctly if you don't export as FBX.)


Orange box: Keep Original Skin Count will be disabled by default in order to help avoid model stretching issues, but if your weights did not change then you can check this box to help solve some issues. Always check Map Original Materials. If you are importing from DAE or FBX, then you should check Use Original Attributes and Use Original Attribute Formats. If you checked those boxes and changed the names of the objects from the original model, pay special attention to the teal box instructions below. If you check those two boxes, then you can ignore the green and yellow box instructions below.
Orange box: Keep Original Skin Count will be disabled by default in order to help avoid model stretching issues, but if your weights did not change then you can check this box to help solve some issues. Always check Map Original Materials. If you are importing from DAE or FBX, then you should check Use Original Attributes and Use Original Attribute Formats. If you checked those boxes and changed the names of the objects from the original model, pay special attention to the teal box instructions below. If you check those two boxes, then you can ignore the green and yellow box instructions below.
Line 102: Line 105:


==Troubleshooting==
==Troubleshooting==
{{empty section}}
 
===General===
 
====Does this work for TitleBG.pack models?====
Yes. There's no functional difference between resident actors (those in TitleBG.pack, denoted by their presence in Bootup.pack's ResidentActors.sbyml file) and normal actors, save that resident actors are always loaded in memory, so they can be displayed without loading delays. This also means that if you've done something wrong, you'll notice the crashing at the title menu or first loading screen, instead of during gameplay.
 
====Why does the lighting on my model look weird?====
If you obtained your model - that is, the modded one that you are adding to the game - by extracting it using Switch toolbox as a DAE, then Blender versions from before Sept 24 2022 will fail to read vertex normals on import, and instead generate new ones. This is almost always undesirable, and will result in weird, splotchy shadows on your model. To fix this, update Blender.
 
If you really don't want to update Blender for whatever reason, use the latest AutoDesk FBX Converter (available [https://aps.autodesk.com/developer/overview/fbx-converter-archives here], yes the latest version is from 2013) to convert the DAE to FBX first.
 
Not that it's not necessary to convert the rig model, because you delete it. You only need to convert the final model that you will be importing.
 
Note that once the vertex normals are messed up, converting to FBX won't fix anything. You have to convert it before the first time you transfer the working model from Switch Toolbox to your modeling program.


===Object Placement Issues===
===Object Placement Issues===


====My eyes are in the model's head, but they aren't in game!====
====My eyes are in the model's head, but they aren't in game!====
Eyes are placed inside the model's head by animations, not vertex positions. You need to place eyes in a very strange position in your modeling program in order to make them appear properly in game. Look at Link's model in Link.sbfres to see the location for Link. Other characters have similar placement for their eyes, relative to their head.
Splitting the eyes into two different objects may help to fix this. If not...
 
Eyes are very strange. Link's original eyes are placed correctly, but exporting them will cause them to be placed incorrectly in any 3d modeling program, and reimporting unchanged eyes will cause them to appear in a different place. However, the game will load them as if they were in the correct place. It is generally not advised to move the eyes unless absolutely necessary, as there is no single way to make them work consistently.
[[Category:Guides]]
[[Category:Guides]]
autopatrol, editnews
232

edits