Pack into a BMD/BDL file

Contents


  1. Required tools
  2. Basic conversion
  3. Material and Texture data addition
  4. --rotate flag
  5. --nosort flag
  6. Other flags
  7. Model is very bright in game


Required tools


Go to Resources for download links.



Prerequisites




Basic conversion


SuperBMD is a very powerful and not very well understood CLI program (Command Line Interface). One uses it blindly for conversion between DAE/FBX and BMD/BDL filetypes to be able to import new 3D models in game. It is the only program as of now that can manipulate in a very effective manner BDL files for SMG (and for other games as well). And it is epik.

It has some command options that I don't even know what they are for >:] (because I lack of skill mostly). Learning how to use its basic features is extremely necessary for SMG modding. So lets get into the point of the tutorial.

As you've already seen in Extract everything from a BMD/BDL file there is a file among the SuperBMD files named SuperBMD.exe. If you drag and drop a BMD/BDL file into this EXE file you will get its extracted contents. However these contents aren't really the original contents of the BMD/BDL but rather the conversion of all the information on the BMD/BDL into files that one can actually read and modify (DAE, PNG and JSON files, Fig. 1).

Image could not be loaded.

(Fig. 1 - Mario.bdl extracted files with SuperBMD)


Image could not be loaded.

(Fig. 2 - Mario.dae opened on Blender without its textures loaded)


Image could not be loaded.

(Fig. 3 - Mario's model material JSON opened on Blender)


Image could not be loaded.

(Fig. 4 - Mario's model texture JSON opened on Blender)


Image could not be loaded.

(Fig. 5 - Mario's model hierarchy JSON opened on Blender)



The files that are strictly needed to build a BMD/BDL file with SuperBMD are:

if any of those is missing SuperBMD will fail to build a BMD/BDL model.

If you want to convert your FBX/DAE model into a BMD just drag and drop the file into SuperBMD.exe (be sure the FBX/DAE texture images are in the same place the FBX/DAE model is). This process will result in a BMD that will have default Material/Texture settings on the model (Figs. 6 and 7).

Image could not be loaded.

(Fig. 6 - Mario.bmd created with only the Mario.dae and the PNG textures)


Image could not be loaded.

(Fig. 7 - Mario.bmd opened on j3dview)



NOTE 1: the default model output of SuperBMD is BMD. To specify SuperBMD to build a BDL you need to use the CMD and use the --bdl command line option: path\to\SuperBMD.exe path\to\model.[dae/fbx] --bdl

NOTE 2: default Material/Texture settings are defined by the SuperBMD authors.



Material and Texture data addition


To specify SuperBMD to use material and texture data (from JSONs) you use the command line options --mat and --texheader as follows (Figs. 8, 9 and 10):

path\to\SuperBMD.exe path\to\model.[dae/fbx] --mat path\to\material.json --texheader path\to\texture.json

Image could not be loaded.

(Fig. 8 - Command to build BMD with texture's and material's JSONs)


Image could not be loaded.

(Fig. 9 - Output BMD file)


Image could not be loaded.

(Fig. 10 - Custom texture's and material's JSONs BMD opened in j3dview)


If the material/texture JSON does not contain material/texture information for some materials/textures on the model then SuperBMD will use default settings on that material/texture (I don't know exactly what are these default settings). Also, you can ommit either of the JSONs and SuperBMD will still output a BMD.


NOTE 3: Notice how this model (Fig. 10) looks brighter/better than the one with the default material/texture data (Fig. 7).

NOTE 4: you can get material/texture data from any model from SMG and use it on another model safely, just be sure to copy the material/texture data into their respective JSON (keeping the structure of a JSON, Figs. 11, 12 and 13) and either rename the material/texture for it to match the material/texture data name or rename the material/texture data name so it is applied to your custom named material/texture.

Image could not be loaded.

(Fig. 11 - Basic structure of a material/texture JSON)


Image could not be loaded.

(Fig. 12 - A block of a material's data in a material JSON)


Image could not be loaded.

(Fig. 13 - A block of a texture's data in a texture JSON)




--rotate flag


This flag is used to rotate the model on the X axis -90 degrees so it is facing correctly in game. The purpose of this flag is to be able to import models from Z up 3D software (like Blender) into SMG (that is Y up) so that the model looks on game as how it was designed in the Z up 3D software (Figs. 11, 12 and 13).

Image could not be loaded.

(Fig. 14 - Example model in Blender)


Image could not be loaded.

(Fig. 15 - Example model in j3dview without using the --rotate flag)


Image could not be loaded.

(Fig. 16 - Example model in j3dview using the --rotate flag)



NOTE 5: the --rotate flag is a bit weird with models that have an skeleton (3D animations are played as if the model was not rotated). In those cases, just manually rotate the model -90 degrees on the X axis and export the DAE/FBX like that.



--nosort flag


I personally recommend the usage of this flag when doing models. In the past (and only a few times) I've got weird effects with textures not being in the place they should (when converting a BDL to DAE and back to BDL) and these effects were fixed if I use this flag. I don't know if those errors are still a thing in newer versions of SuperBMD but just in case something happens you can try this flag (I was not able to replicate the errors I got so it might've been fixed).

The description provided by the author of SuperBMD of this flag is:

"If --nosort is set, disable naturalistic sorting of meshes by name. (Sorting makes sure so that e.g. mesh-0 appears before mesh-1 in the model)"



Other flags


Other flags that can be used in this program can be found on the GitHub repository of SuperBMD. They are scattered around the README and also in the description of each new release of SuperBMD (i.e. the releases page).



Model is very bright in game


Unfortunately SuperBMD has an issue when either creating a BMD or a BDL. The problem is only noticed when importing the output model in SMG and what happens is that the model is very bright in game when it is not supposed to.

To bypass this issue, open the model converted from SuperBMD in j3dview and then go to File > Save Model As... and change the extension of the model file to save to be .bdl (to save as a BDL and because SMG natively uses BDL instead of BMD).

See this issue for more information.



NOTE 6: BDL is a newer version of BMD that incorpores a section with more material data. For more information see this link.