Ad placeholder

Modding:Creating and Exporting Meshes in Blender: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:


[[File:ScreenshotHowToImportIt.webp|thumb|This should show up in your File> Import menu if you have the addon installed correctly.]]
[[File:ScreenshotHowToImportIt.webp|thumb|This should show up in your File> Import menu if you have the addon installed correctly.|225x225px]]
In this tutorial we will assume you are generally knowledgable about how to use 3d software, so this will focus on things specific to Baldur’s Gate 3 exporter made by Norbyte. Remember, there are many general youtube tutorials about how to weight paint and edit meshes in Blender.
In this tutorial we will assume you are generally knowledgable about how to use 3d software, so this will focus on things specific to Baldur’s Gate 3 exporter made by Norbyte. Remember, there are many general youtube tutorials about how to weight paint and edit meshes in Blender.


Line 13: Line 13:


==Extracting a model to work with==
==Extracting a model to work with==
[[File:NewBodyBlenderScreenshotImported.webp|thumb|Imported meshes.]]Now open your modder’s multitool. Click ‘Search Index’. Filter by .GR2. Search something like HUM_F_ARM_ and browse the in game meshes available to regular size humanlike females. You may also wish to consult this table- [https://docs.google.com/spreadsheets/d/16uyC9UIJUmg1ciwsFfjdhsAbJAz320g2ei65BUGrnZg/edit#gid=1726617676 Clothing and Armor models by Saku]. (This lists HUM F only but most outfits fit male and other races as well)
[[File:NewBodyBlenderScreenshotImported.webp|thumb|Imported meshes.|187x187px]]Now open your modder’s multitool. Click ‘Search Index’. Filter by .GR2. Search something like HUM_F_ARM_ and browse the in game meshes available to regular size humanlike females. You may also wish to consult this table- [https://docs.google.com/spreadsheets/d/16uyC9UIJUmg1ciwsFfjdhsAbJAz320g2ei65BUGrnZg/edit#gid=1726617676 Clothing and Armor models by Saku]. (This lists HUM F only but most outfits fit male and other races as well)


You should at least extract HUM_F_NKD_Body_A (or whatever nude you are basing your outfit on) to fit your new outfit around.
You should at least extract [[Modding:Body Models|HUM_F_NKD_Body_A]] (or whatever nude you are basing your outfit on) to fit your new outfit around.


When you have found a t-posing model to your liking. Click the extract file/open folder. You should find the mesh in .GR2 and .dae form on your computer. Use the .dae- the Blender importer likes .dae format a lot more than it likes .gr2. [[File:MeshImportsWithLODSS.webp|thumb|A mesh importing. It has only 1 Lod.]]'''You generally cannot import a modded-in mesh without the plugin crashing Blender.''' Hopefully are sensible and you save your own work often and can re-export it from there, and have obtained permission to edit all the modded items you want to import anyway.
When you have found a t-posing model to your liking. Click the extract file/open folder. You should find the mesh in .GR2 and .dae form on your computer. Use the .dae- the Blender importer likes .dae format a lot more than it likes .gr2. [[File:MeshImportsWithLODSS.webp|thumb|A mesh importing. It has only 1 Lod.]]'''You generally cannot import a modded-in mesh without the plugin crashing Blender.''' Hopefully are sensible and you save your own work often and can re-export it from there, and have obtained permission to edit all the modded items you want to import anyway.
Line 21: Line 21:
==Importing==
==Importing==
It will be a fairly standard rig with an Armature modifier (see Modifier tab).Your armatures will import in at 90 degrees. This will cause it to export flat to the floor and follow a naked character around like a weird windsock, so you need to fix it. '''[Object Mode] Object > Apply> All Transforms''' on the armature, until the coordinates for its location all read '''0, 0, 0'''. You may need to do the same thing on the mesh as well.
It will be a fairly standard rig with an Armature modifier (see Modifier tab).Your armatures will import in at 90 degrees. This will cause it to export flat to the floor and follow a naked character around like a weird windsock, so you need to fix it. '''[Object Mode] Object > Apply> All Transforms''' on the armature, until the coordinates for its location all read '''0, 0, 0'''. You may need to do the same thing on the mesh as well.
[[File:UrMeshImported90.webp|thumb|Your mesh will likely import this way- note 90 degree angle.]]
[[File:UrMeshImported90.webp|thumb|Your mesh will likely import this way- note 90 degree angle.|276x276px]]
The mesh will import in with 1 or more LODS. These are level of detail meshes, intended to be viewed at a distance so they are lower poly. You only need the best quality one as we are making new LODs later, so delete anything that has LOD in the name.
The mesh will import in with 1 or more LODS. These are level of detail meshes, intended to be viewed at a distance so they are lower poly. You only need the best quality one as we are making new LODs later, so delete anything that has LOD in the name.


Line 31: Line 31:
The UV map may seem bare when you tab into the UV slide, but BG3 meshes have an odd habit of not being on the actual UV square itself, as the UV tiles. So you may need to scroll out quite far to see the full UV. You can drag it back ('''Snap to Vertex''' can be useful with this) or keep it there, it usually does not matter.
The UV map may seem bare when you tab into the UV slide, but BG3 meshes have an odd habit of not being on the actual UV square itself, as the UV tiles. So you may need to scroll out quite far to see the full UV. You can drag it back ('''Snap to Vertex''' can be useful with this) or keep it there, it usually does not matter.


[[File:Screenshot Uv and colour map imports.webp|thumb|Your UV map and Colour maps, found in Object Data tab.]]Depending on what type of mesh you imported, it will not have all the bones- circlets for example may only import in with the head bone.  
[[File:Screenshot Uv and colour map imports.webp|thumb|Your UV map and Colour maps, found in Object Data tab.|227x227px]]Depending on what type of mesh you imported, it will not have all the bones- circlets for example may only import in with the head bone.  
If making a new full body mesh, it is generally a good idea to parent your mesh to a naked body, which does have all the bones, as this can avoid weighting issues.
If making a new full body mesh, it is generally a good idea to parent your mesh to a naked body, which does have all the bones, as this can avoid weighting issues.


Remember that genitals are attached later via lsx code and aren't a part of the body mesh.
Remember that genitals are attached later via lsx code and aren't a part of the body mesh.
==Vertex Paint==
==Vertex Paint==
[[File:BlenderVertexPaintUnderwearExample.webp|thumb|This underwear has its green vertex paint, which tells it to vanish when a top is equipped.|171x171px]]
Tab into '''Vertex Paint''' mode to look at the naked body.   
Tab into '''Vertex Paint''' mode to look at the naked body.   


The game’s armour system works by vertex paint. It uses this, in combination with the .lsx code, to tell it what to hide and what to show. For example, an armour mesh may unload the torso as it will not be shown. The bottom half of a pant leg may not show when boots are equipped. You can use existing meshes as a reference for this.   
The game’s armour system works by vertex paint. It uses this, in combination with the .lsx code, to tell it what to hide and what to show. For example, an armour mesh may unload the torso as it will not be shown. The bottom half of a pant leg may not show when boots are equipped. You can use existing meshes as a reference for this.   
[[File:BlenderVertexPaintUnderwearExample.webp|thumb|This underwear has its green vertex paint, which tells it to vanish when a top is equipped.]]
 
[[Modding:VertexColorMaskSlots|Check here for a resource and Hex codes for the vertex paint.]]  
[[Modding:VertexColorMaskSlots|Check here for a resource and Hex codes for the vertex paint.]]  


Line 51: Line 52:


If you intend to use part of an underwear mesh on an outerwear outfit, make sure you paint it black in Vertex Paint or it will hide when it’s not supposed to.  
If you intend to use part of an underwear mesh on an outerwear outfit, make sure you paint it black in Vertex Paint or it will hide when it’s not supposed to.  
[[File:How2ViewVertyPaint.webp|thumb|How to view Vertex Paint in Object Mode]]
[[File:How2ViewVertyPaint.webp|thumb|How to view Vertex Paint in Object Mode|307x307px]]


== How to Vertex Paint Sleeves and Pant Legs ==
== How to Vertex Paint Sleeves and Pant Legs ==
Line 71: Line 72:


==Fixing meshes that import in wrong==
==Fixing meshes that import in wrong==
[https://www.youtube.com/watch?v=NCDGhz3RSr8 See this video] for how to fix meshes that import in with messed up normals like a blue/red checkerboard, and export looking like see through checkerboards. Sometimes meshes will import in stuck together, usually on skirt meshes. This is because the verts were too close together and the importer made a hiccup. You can also fix with '''[Edit Mode] Mesh> Clean Up> Merge By Distance''', and then put a solidify modifier at 00.1 thickness.
[[File:BlenderTutAlfiraBustedNormals.webp|thumb|203x203px|Fixing Meshes that import in wrong: Sometimes the normals of skirts import this way- unusable in game.]]
Sometimes meshes will import in with broken shading and stuck together, usually on skirt meshes. This is because the verts were too close together and the importer made a hiccup. This is often an issue with the normals as well.
[https://www.youtube.com/watch?v=NCDGhz3RSr8 See this video] for how to fix meshes that import in with messed up normals like a blue/red checkerboard, and export looking like see through checkerboards. You can also fix with '''[Edit Mode] Mesh> Clean Up> Merge By Distance''', and then put a solidify modifier at 00.1 thickness.
[[File:How2ViewFaceorientationoverlay.webp|thumb|291x291px|How to view face orientation overlay on Blender. Blue is outside, red is inside. Red will be invisible in-game, unless you set up a 2 sided shader in your LSX code later.]]
==Physics==
==Physics==
Physics are set with red vertex paint. Hot pink vertex paint counterbalances the physics. You may need to delete the cloth mesh your mesh imported with, as it can cause to export badly.
Physics are set with red vertex paint. Hot pink vertex paint counterbalances the physics. You may need to delete the cloth mesh your mesh imported with, as it can cause to export badly.
Line 105: Line 109:


If you parented your mesh to the nude body armature, remember to delete the nude body!
If you parented your mesh to the nude body armature, remember to delete the nude body!
[[File:BlenderTtut3.6ExportSettings.webp|thumb|Default export settings for Blender 3.6]]
[[File:BlenderTtut3.6ExportSettings.webp|thumb|Default export settings for Blender 3.6|445x445px]]


==Testing in Game==
==Testing in Game==
Line 115: Line 119:
It is not only possible but very recommended to hotload meshes, it enables you to fix them in action. [[Modding:Hotloading|See here for how.]]
It is not only possible but very recommended to hotload meshes, it enables you to fix them in action. [[Modding:Hotloading|See here for how.]]


== Tutorials by Others ==
== BG3 Tutorials and Resources ==
Be sure to watch [https://www.youtube.com/watch?v=IbivHL2lPrc&list=PLG6GyipNkD2ptAp16VXs8BiTNEaMlgKhO&index=1 this video series] by Druu using the Blender plugin and follow along. It is older but still very relevant and helpful.
Be sure to watch [https://www.youtube.com/watch?v=IbivHL2lPrc&list=PLG6GyipNkD2ptAp16VXs8BiTNEaMlgKhO&index=1 this video series] by Druu using the BG3 Blender plugin and follow along. It is older but still very relevant and helpful.
 
== General Blender tutorials ==
If you don't understand how to use Blender, start with [https://www.youtube.com/@blenderguru Donut tutorial by BlenderGuru].
 
You may also find [https://www.youtube.com/@TheRoyalSkies/playlists TheRoyalSkies short videos on Blender] to be helpful.
 
== Modders Resources ==
[https://www.nexusmods.com/baldursgate3/mods/2973 High Heel Feet by LazyIcarus]
 
[https://www.nexusmods.com/baldursgate3/mods/3683 Outfit Builder by LazyIcarus]- uses shapekeys to edit a mesh to a different body type- useful if you want to make an outfit for different body types.
 
[https://www.nexusmods.com/baldursgate3/mods/4310 Volno texture toolbox]- for previewing textures on the mesh.

Navigation menu