Jump to content
The Dark Mod Forums

Importing custom model. Wiki outdated. Please help!


Kerry000

Recommended Posts

All I want to do is import a basic, static model into the editor. 
The model is in .lwo format, the polygons are all triangles, the UV's are all mapped correctly. I am not a modelling noob.
The textures are all square, and in .dds format.
The model does not need a collision mesh or a shadow mesh. It is just a small teddy bear.

The problem is that I do not know how to associate a material with this custom model in DR. And in the wiki, which is so out of date now, there is a page that specifically deals with this issue but the example images do not load!

Does anyone have the example images from this page? https://wiki.thedarkmod.com/index.php?title=Model/Texture_Guidelines

Because I see that I need the path info for the model textures to be embedded in the .lwo mesh file, but the example of the path I'm supposed to use does not load in the wiki.

Or maybe someone could please just give me a short description of how to import custom models into DR? I am an experienced modeler and texture artist, so no need to ELI5, it's just associating the custom model with a material file in DR that I cannot find any info on. 

EDIT: Is it something to do with entity .def files? https://wiki.thedarkmod.com/index.php?title=DEF_Files

Edited by Kerry000
New info
Link to comment
Share on other sites

You don't need an entity def for a static model. Defs are only required for entities which "do things", e.g. a candle which spawns a flame and a flickering light.

To import a textured LWO model you need to do two things:

  1. Create a material file to construct the texture out of individual images (diffuse map, bump map etc).
  2. Set the name of your material (e.g. textures/darkmod/stone/brick/redbrick_with_mortar from the linked page) as the object's material name in your modelling application.

If you have problems I suggest breaking this down:

  • Define your material and apply it to a simple brush in DR, then view it in game. This proves your material definition is correct.
  • Set your model's material name to a known-good material from the core mod, e.g. one of the brick or stone textures, then import the model and confirm that the model appears with the chosen material. This proves that your model is exported correctly and you have set the material name in the correct place.
Link to comment
Share on other sites

7 minutes ago, OrbWeaver said:

You don't need an entity def for a static model. Defs are only required for entities which "do things", e.g. a candle which spawns a flame and a flickering light.

To import a textured LWO model you need to do two things:

  1. Create a material file to construct the texture out of individual images (diffuse map, bump map etc).
  2. Set the name of your material (e.g. textures/darkmod/stone/brick/redbrick_with_mortar from the linked page) as the object's material name in your modelling application.

If you have problems I suggest breaking this down:

  • Define your material and apply it to a simple brush in DR, then view it in game. This proves your material definition is correct.
  • Set your model's material name to a known-good material from the core mod, e.g. one of the brick or stone textures, then import the model and confirm that the model appears with the chosen material. This proves that your model is exported correctly and you have set the material name in the correct place.

Thank you, @OrbWeaver. I'll give it a try.

Edited by Kerry000
Link to comment
Share on other sites

@OrbWeaver, does the material name in the modeling application need to include the folder path, or just the name itself? (ie. redbrick_with_mortar versus textures/darkmod/stone/brick/redbrick_with_mortar)

 

EDIT: Never mind, I figured it out 🙂

Edited by Kerry000
Link to comment
Share on other sites

3 hours ago, Kerry000 said:

@OrbWeaver, does the material name in the modeling application need to include the folder path, or just the name itself? (ie. redbrick_with_mortar versus textures/darkmod/stone/brick/redbrick_with_mortar)

It needs to be the full material name, including any parent "folders".

Note that material names are actually just arbitrary strings, which do not need to correspond to on-disk paths, and the "folders" are only used for organisation in DarkRadiant. It is not a requirement that they start with "textures" or "models", or even have any folders at all. You could use "Material.001" as your material name, or "/my/really/weird/path", and it would work fine as long as it was correctly matched by the model file's material name.

Link to comment
Share on other sites

40 minutes ago, OrbWeaver said:

It needs to be the full material name, including any parent "folders".

Note that material names are actually just arbitrary strings, which do not need to correspond to on-disk paths, and the "folders" are only used for organisation in DarkRadiant. It is not a requirement that they start with "textures" or "models", or even have any folders at all. You could use "Material.001" as your material name, or "/my/really/weird/path", and it would work fine as long as it was correctly matched by the model file's material name.

Got you. Thanks again for the help. Have just decided to use ASE model, rather than .lwo, in order to simplify the whole process.

Link to comment
Share on other sites

1 hour ago, Kerry000 said:

Got you. Thanks again for the help. Have just decided to use ASE model, rather than .lwo, in order to simplify the whole process.

Nothing wrong with that, if you find ASE easier to work with.

However for ASE the requirements are rather similar: the *BITMAP line needs to contain the full TDM material path. The advantage of ASE is that you can edit the file after export in a text editor, whereas with LWO you have to get it right in the original modelling tool.

Link to comment
Share on other sites

OK almost there. I imported the model into DR and it looks perfectly fine.  But it doesn't show up in-game. I've tried checking for warnings, restarting TDM, deleting map files and re-running dmap, etc..

TDM Community Github: https://github.com/thedarkmodcommunity

My fan missions: The Hare in the Snare, Part 1

The Lieutenant Series: In Plain Sight  High Expectations Foreign Affairs

Link to comment
Share on other sites

31 minutes ago, Frost_Salamander said:

OK almost there. I imported the model into DR and it looks perfectly fine.  But it doesn't show up in-game. I've tried checking for warnings, restarting TDM, deleting map files and re-running dmap, etc..

 

Where have you saved the model?  Are you using a pk4 for your custom files? You can point DR to look in specific folders, but TDM wants the model in [darkmod folder]/models unless you have put it into a pk4 and installed that.

Link to comment
Share on other sites

1 minute ago, Springheel said:

 

Where have you saved the model?  Are you using a pk4 for your custom files? You can point DR to look in specific folders, but TDM wants the model in [darkmod folder]/models unless you have put it into a pk4 and installed that.

it's in fms/<mymap>/models/darkmod/decorative/toys

However I've since been informed it might be a different issue that we're trying next, so will report back

TDM Community Github: https://github.com/thedarkmodcommunity

My fan missions: The Hare in the Snare, Part 1

The Lieutenant Series: In Plain Sight  High Expectations Foreign Affairs

Link to comment
Share on other sites

7 hours ago, Kerry000 said:

Got you. Thanks again for the help. Have just decided to use ASE model, rather than .lwo, in order to simplify the whole process.

I use .lwo exclusively and there's nothing more simple than that, just give the model surfaces materials, in the 3D editor, the name of the engine materials they need and that's that, example  textures/somefolder/materialname. 

textures/folder/materialname   <----- this is the full material name "path" you want to use
{
	blend blend
	map textures/somefolder/someTEXTUREname
}

 If you can export .lwo IMO it is a better format, because is a binary format and not a text based format, in theory, making .lwo faster to load than ASE files, plus you need to always edit the bitmap option, in the ASE file by hand, before being able to use it, while .lwo is a "export and forget" format, but that's my opinion. 

Edited by HMart
  • Like 2
Link to comment
Share on other sites

17 minutes ago, HMart said:

I use .lwo exclusively and there's nothing more simple than that, just give the model surfaces the name of the materials they need and that's that, example  textures/somefolder/materialname. 


textures/folder/materialname   <----- this is the full material name "path" you want to use
{
	blend blend
	map textures/somefolder/someTEXTUREname
}

 If you can export .lwo IMO it is a better format, because is a binary format and not a text based format, in theory, making .lwo faster to load than ASE files, plus you need to always edit the bitmap option, in the ASE file by hand, before being able to use it, while .lwo is a "export and forget" format, but that's my opinion. 

Okay, thank you. Sorry, I have no experience with DR. I suspect it's an issue that occurs when converting the fbx to either an ase or a lwo. We've now tried it with a lwo converted from the fbx in Lightwave, and as a ase converted from the fbx in Blender. It looks great in the editor, but then never runs in-game. The textures work (@peter_spy tried them on a different mesh), it's just the model. Something must be getting lost during the conversion from fbx

 

Link to comment
Share on other sites

When I made conversions like that this is what's sometimes happened to me, one the uvmap was missing, meaning the model was white after conversion, two, in my case, I use Modo and sometimes, depending on the format coming in, it would create a extra uvmap for the model, next to the default one and because the game engine, doesn't support more than one uvmap the model would get all messed up ingame.  

Other times, I would just forget to triangulate the model, .lwo supports exporting quad's not only triangles, so if is the case, you need to remember to triangulate the models at export time, in my case Modo doesn't do that automatically when exporting .lwo, don't know if blender does it, so I just have a macro/button that does the final export, it cleans the model of any extra useless layers and it triangulates the model for me. 

Edited by HMart
  • Like 1
Link to comment
Share on other sites

12 minutes ago, HMart said:

When I made conversions like that this is what's sometimes happened to me, one the uvmap was missing, meaning the model was white after conversion, two, in my case, I use Modo and sometimes, depending on the format coming in, it would create a extra uvmap for the model, next to the default one and because the game engine, doesn't support more than one uvmap the model would get all messed up ingame.  

Other times, I would just forget to triangulate the model, .lwo supports exporting quad's not only triangles, so if is the case, you need to remember to triangulate the models at export time, in my case Modo doesn't do that automatically when exporting .lwo, don't know if blender does it, so I just have a macro/button that does the final export, it cleans the model of any extra useless layers and it triangulates the model for me. 

Understood, and thank you again. So, @peter_spysolved the problem in the interim. It was a few bad lines in the .ase (the programmer that wrote the plugin for Blender included things like "who cares" in his definitions, lol) but we have now got it all to work.
I had already ensured the model was triangulated and exported with correct UV's. 

  • Like 1
Link to comment
Share on other sites

4 minutes ago, OrbWeaver said:

Which Blender ASE exporter are you using?

I just did a search for "WHO" in the one I maintain and didn't find anything, so you might give it a try if you are having problems with a different exporter.

It was this one:

https://github.com/DarklightGames/io_export_ase

But I am so switching to yours from now on!

Edited by Kerry000
Link to comment
Share on other sites

@OrbWeaverGetting the following error when installing your .ase export script (the other two import scripts installed okay). This is in Blender v2.80 and using the correct version (for 2.80) from the page you linked...

ase_exporter_error.jpg

Link to comment
Share on other sites

1 hour ago, Kerry000 said:

@OrbWeaverGetting the following error when installing your .ase export script (the other two import scripts installed okay). This is in Blender v2.80 and using the correct version (for 2.80) from the page you linked...

ase_exporter_error.jpg

Oops, that's an error on my part. I was messing around with the ID names but discovered that using a full address like that didn't work and thought I reverted the change, but I must have only reverted it in one script and not the other. You can work around it by searching for the string "com.thedarkmod.export.ase" and changing it to "export.ase", which is what it was originally.

Link to comment
Share on other sites

3 hours ago, OrbWeaver said:

Oops, that's an error on my part. I was messing around with the ID names but discovered that using a full address like that didn't work and thought I reverted the change, but I must have only reverted it in one script and not the other. You can work around it by searching for the string "com.thedarkmod.export.ase" and changing it to "export.ase", which is what it was originally.

Got it, thank you 👍

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.

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.

  • Recent Status Updates

    • Sotha

      WIP mission name confirmed: "The Last Offering"
       
      · 5 replies
    • Sotha

      Today I started writing readables for my WIP mission.
      I wrote my usual text and then crammed it into AI and boom, high quality stuff comes out.
      I used to say that clipper is the mappers best friend, but now it seems it is more like "AI is the mappers best friend."
      · 2 replies
    • The Black Arrow

      Just saw further into 2.13 development, or is it 2.14? Anyway, proper Parallax Mapping...Absolutely fuck yes, please!
      · 2 replies
    • nbohr1more

      Happy Halloween! "Gem of Souls" is out:
       
      Psst, someone let Darkfate know...
      · 1 reply
    • The Black Arrow

      Is there a thread for "Moving Day 2: Look Who's Moving Now"? If not, could someone hint me on what is Dick's birthday? This mission is quite enjoyable on its disturbing creepy implications.
      · 3 replies
×
×
  • Create New...