Jump to content

Blender Addon - Export MDL 3.0


SpiderPig
 Share

Recommended Posts

Been working on this exporter for Blender 4.0 during the latter half of this week.  It's not fully completed yet but I kind of need feedback now to see where it can be improved.

io_mesh_ultra_v020.zip

Things left to do:

  • Embeded Colliders
  • Calculate & Export Tangents & BiTangents
  • Animation

Issues:

  • Won't export a mesh that has no material assigned

 

These are the current default settings:

MDL_Settings.png.4fe2f245ccdaa59512d7ae66a326b949.png

  • Export Position
    • False (Default) - will not export the objects position.  This will be exported as 0,0,0
    • True - will export position
  • Use Object Name
    • False (Default) - Uses the file name written in the file save dialog to name the exported MDL file
    • True - Uses the object name in blender as the MDL file name
  • Export LODS
    • True (Default) - will search the scene (selected objects or not) for any LOD objects
      • E.g.  If you select a model named "Cube", it will search for and export objects that are named;
      • "Cube_LOD1"
      • "Cube_LOD2"
      • etc...
    • False - Does not export LODS
  • Export Collider
    • True (Default) - Searches the scene for an object with a suffix of _PHY
      • E.g.  If you select a model named "Cube", it will search for an object named "Cube_PHY" and export that mesh as a collider file.  (Embedded colliders coming soon)
    • False - Does not export Collider
  • Convert Textures
    • This is a WIP.  It should work, but it is slow sometimes depending on how many and how large your textures are.  So if blender hangs and goes non responsive for a few minutes that could be why.
    • False (Default) - will copy textures that the blender materials use to the target directory where you have specified to save the MDL file too.
    • True - Will first convert any non DDS files to DDS with the correct compression, saving them in the same folder as the source image, before then copying the new DDS file over to the target directory where you have specified to save the MDL file too.
    • All DDS file are renamed to the material name appended with the appropriate slot name
      • E.g. If the material name is "Cube"
      • Diffuse textures will be named "Cube_DIFF.dds"
      • Normal textures will be named "Cube_NORM.dds"
      • Ambient occlusion, roughness and metalness maps will be combined into one DDS file name "Cube_AO_ROUGH_METAL.dds"

 

Ultimate the only object you need to select when exporting is the root object.  E.g. the LOD0 object.  Doesn't currently work if the root object is named LOD0 though.  Has to be "Cube" not "Cube_LOD0".  I can add support for this if it's needed.

 

You can also batch export be default.  All you need to do is select all the root objects that you want to export and it will export them all to the same folder.  Best to set "Use Object Name" to true when batch exporting other wise the file names will conflict and each selected object will just overwrite the previous one.

 

Materials are exported to the same directory as the specified MDL path.  Here is the only node setup that will be able to collect and export the textures.  Please excuse the low resolution image - not sure how I can get blender to render to an image larger than the screen!  I'll add some better images later.

You don't need all of these images loaded to export the material correctly.  From top to bottom on the left hand side, DIFFUSE, AO, METAL, ROUGH & NORM.

MaterialNode_Setup.thumb.png.120c9868a02e585aaf8ec2ecf485ee2d.png

Love to hear feed back with this and thoughts on how it should be improved!  I have had MDL files straight from Blender working in the editor :D

Link to comment
Share on other sites

To install this, extract the Zip file contents to Blender/4.1/scripts/addons, then in Blender select the Edit > Preferences > Addons menu, search for "MDL" to find this plugin, and check the box to enable it.

@SpiderPig Since our PBR materials system is derived from glTF, this page might be useful to you:  

https://docs.blender.org/manual/en/2.80/addons/io_scene_gltf2.html

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Download updated with support for exporting children.

  • Only need to select the root object.
  • All child objects will automatically be exported if they are parented to the root object and export option "Export Children" is set to true.
  • Empties can also be exported as a child.  Ultra treats them as a Model without LODs / Meshes.
Link to comment
Share on other sites

The physics properties in Blender have some rigid body shapes that map closely to Newton. Might be interesting to you:
image.thumb.png.306c403bdf22c66156e35d1264ec7845.png

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...