Jump to content


Photo

Exporting models from Blender into TDM

blender lwo export

34 replies to this topic

#26 chedap

chedap

    Member

  • Member
  • PipPip
  • 87 posts

Posted 31 May 2018 - 05:16 PM

It's two models snapped together.



#27 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1527 posts

Posted 09 June 2018 - 12:41 PM

Hey chedap, I love the .ase exporter, it defaults to sensible options and gets the material right and outputs smaller files. I exported a new sword model I made, its not that small (around 4k) and it handled that beautifully. However, when I tried bringing in other models I was working on, I got this error while dmapping: "unknown token. 'MESH_FACE10000:' while parsing MESH_FACE_LIST". Obs pointed out it should be something with the exporter, and indeed, changing back to the previous one I was using, the models load in game without problems. Check out his post: http://forums.thedar...328#entry422955 .

If it makes a difference, the models I was importing were on the heavy side, each had several separate meshes and the tris count ranged from around 5k to 15k (they are groups of trees).

 

Hopefully this isnt difficult to fix? Thanks for this, its great work. 


Edited by RPGista, 09 June 2018 - 12:42 PM.

  • chedap likes this

#28 chedap

chedap

    Member

  • Member
  • PipPip
  • 87 posts

Posted 10 June 2018 - 06:24 AM

Yep, was a 10k+ tris formatting hiccup, should be fixed now.

Gotta say though, "heavy" trees would seem like prime candidates for lwo. Or are you using tricks like egg-shaped custom normals?


  • RPGista likes this

#29 Samson-

Samson-

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 28 June 2018 - 03:28 PM

Hi guys - I'm getting my feet wet with modeling, and was hoping maybe someone could help with a couple of questions.

 

I was starting with some base models from D3 to experiment.  I was originally using one of the default blender .lwo export scripts, which did not seem to ever set smoothing on export, so unless i edited the materials to use the renderbump command, the models were faceted in game.  I switched to the script referenced earlier in this post, and smoothing is definitely now set in the exported .lwo ( Yeah! ), but now I'm having a different issue - I can't seem to set a hard edge.  Even if I select a portion of the model and split it off ( select faces then 'Y' to split ), the engine still smooths across that edge.  The only way I could find to stop the behaviour was to assign the same material with a different name to the split portion of the mesh.  Anyone experience this before?  Using Blender 2.77 fwiw.  Remove doubles is NOT set on the export script - just the smoothing option is set.

 

My second question is about baking normals ( which is turning out to be a pretty interesting rabbit hole ).  I was trying to model a simple cup - ( styrofoam coffee cup ).  I made high and low poly models, and baked the normal from the high to the low, and it generally seems to work.  The issue I'm having is the seam where the normal map wraps around the cup.  Where the halves of the map meet, the normals look obviously inverted on the model in game.  I tried splitting the model in half, unwrapping the UV's for half the model to the full texture space,  mirroring the half to complete the model, welding the halves together, moving the mirrored UVs off the 0-1 UV map, baking the normal map, then moving the mirrored UVs back.  This looks better, but the normals still seem to be wrong when looking at the model from different angles in game.  I feel like I'm missing something here, any ideas would be appreciated. Thanks!



#30 chedap

chedap

    Member

  • Member
  • PipPip
  • 87 posts

Posted 29 June 2018 - 12:05 AM

Even if I select a portion of the model and split it off ( select faces then 'Y' to split ), the engine still smooths across that edge.

That would happen if you forgot to remove renderbump command from your material definition.

The issue I'm having is the seam where the normal map wraps around the cup.  Where the halves of the map meet, the normals look obviously inverted on the model in game.  I tried splitting the model in half, unwrapping the UV's for half the model to the full texture space,  mirroring the half to complete the model, welding the halves together, moving the mirrored UVs off the 0-1 UV map, baking the normal map, then moving the mirrored UVs back.  This looks better, but the normals still seem to be wrong when looking at the model from different angles in game.

TDM uses DirectX normal maps (Y-). So if you had Blender bake Y+ ones you could see weirdness at the seams, while at a glance it would seem the map is doing its job.
Other than that, could be different things, hard to guess without pictures. Try on a simple sphere: does the issue persist?

#31 Samson-

Samson-

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 29 June 2018 - 04:48 PM

That would happen if you forgot to remove renderbump command from your material definition.

 

You know, when I first read this comment, I thought to myself 'man, what kind of idiot does this guy think I am? I checked the material def a bunch of times!'.  Turns out you know exactly what kind of idiot I am - I was editing the wrong material def. :)  Fixed it  and problem resolved.

 

 

TDM uses DirectX normal maps (Y-). So if you had Blender bake Y+ ones you could see weirdness at the seams, while at a glance it would seem the map is doing its job.

So in blender is it as simple as switching +Y to -Y under bake/swizzle?  ( does D3 also use -Y?)

 

Thanks a ton for the help - saved me lots of frustration!



#32 chedap

chedap

    Member

  • Member
  • PipPip
  • 87 posts

Posted 01 July 2018 - 04:43 AM

Glad it helped, both were guesses on my part.

So in blender is it as simple as switching +Y to -Y under bake/swizzle?

Yes, but you don't even have to re-bake the whole thing, just inverting the green channel on an exported image gives the same result (e.g. in IrfanView "Image>Negative>Green channel").
And yes, Doom 3 also uses Y-.

Edited by chedap, 01 July 2018 - 04:45 AM.


#33 panel123

panel123

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 08 July 2018 - 08:27 AM

I’m glad that you shared this useful info with us. thank you


Edited by panel123, 08 July 2018 - 08:28 AM.


#34 Samson-

Samson-

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 14 July 2018 - 04:19 PM

Hey, another quick question - does anyone have a link to the current/appropriate .ase import/export script for blender/TDM/D3?  Did a quick search but maybe I missed it.

 

Thanks again!



#35 chedap

chedap

    Member

  • Member
  • PipPip
  • 87 posts

Posted 15 July 2018 - 09:02 AM

Look through the thread, I've modified an existing exporter.
Haven't had the time to dig into importers yet (there are at least 3 out there). Haven't properly tested them either, but I don't think either works with Blender 2.7+

Edited by chedap, 15 July 2018 - 09:02 AM.




Reply to this topic



  



Also tagged with one or more of these keywords: blender, lwo, export

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users