Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tomb Editor

Reply
 
Thread Tools
Old 18-09-20, 15:03   #1
not again!
Member
 
not again!'s Avatar
 
Joined: Feb 2008
Posts: 1,145
Default Open Blender To Tomb Editor Workflow Thread

Name:  blender_logo.png
Views: 64
Size:  8.7 KB

to
TOMB EDITOR



Welcome to the open Blender to Tomb Editor workflow thread! The place to post about road bumps you have encountered, or ideal workflows you have found on your quest to get things from Blender over to Tomb Editor and into your level.



Win 8, 10, 11: Blender 4.0.2 Installer /// Portable ZIP

Win 7: Blender 2.92 Installer /// Portable ZIP





You can find all older version of Blender (both portable and installer) here: Blender's index of releases

The portable ZIP versions are incredibly useful if you want to use different versions of Blender simultaneously on the same computer. The installer versions overwrite each other, so you can only have one version at a time installed.
The last version to support Win 7 is Blender v. 2.92!


The Blender online manual. Down in the left corner of the site you can select the Blender version and you can also choose between several languages. Note that you can also download the manual as either PDF file or HTML pages.


ESSENTIAL ADD-ONS



WAD Blender by Bergus

TRF thread for the addon with download
Github page for the addon

note: the plugin will not work with Blender versions newer than 3.1.2! For your convenience, here's a link to the required Blender version:
Blender3.1.2

This amazing add-on lets you import Wads directly into Blender. The Wad has to be in the old, classic .wad file format; WadTool's .wad2 is not supported.

You can select whether you would like to import
- Lara with all animations
- Lara's Outfit
- All Moveables (with their respective animations if they have any)
- All Statics
- Everything

There is also the option to select one specific item from a drop-down menu labeled Choose Object.




Installation




Opening a Wad in Blender




View animations and edit shine and opacity of models




Import Adobe Mixamo animations to Tomb Editor WadTool




You can use this model for the process shown in the video above:
https://drive.google.com/file/d/1A3s...ew?usp=sharing


--------------------------------------------



TRLE addons by Sapper

GitHub page for the addon
Tutorial on sapper's blog

Caring about backwards compatibility is always a good thing, so if you'd like your models to be compatible with the classic tools and the old Wad format there's sapper's plugin that lets you bake the textures of UV-unwrapped models over to the classic texturing format following a method that was developed by teme9 (the original thread outlining the technique)









Optional Addons


MQO Import

This is mostly useful for a backwards compatible workflow if you want to use the old Wad file format!

For Blender 2.8 and newer

GitHub page for the addon by 50thomatoes50 and Sapper

The plugin can import MQO models from both editwad and Strpix (and naturally Metasequoia itself) without textures, but the meshes will have kept their texturing if you import them back into Strpix, depending on your changes (deleting vertices and faces is likely to mess up the texturing)


For Blender 2.79b

mqo_script_268 (I haven't been able to find out who wrote the plugin)
mediafire backup link

This addon can import models with textures, including Skin_Joint_Checks exported from editwad, provided the textures are in the same folder as the MQO. The textures can be extracted with TextureAdd. Make sure to export them as individual images and not as texture page.

Last edited by not again!; 20-02-24 at 14:40.
not again! is offline   Reply With Quote
Old 18-09-20, 15:07   #2
not again!
Member
 
not again!'s Avatar
 
Joined: Feb 2008
Posts: 1,145
Default

A few random findings I can share / update: the info is now obsolete; preserving it for archaeological purposes behind spoiler tags:

there are several older Blender versions that are of interest because they can import .3ds files exported from WadViewer with correctly placed object origins, which is the key factor in ensuring that a model will be correctly assembled when importing it into WadTool (speaking mainly of moveables with more than one mesh). Newer versions of Blender will laugh at your request to import object origins correctly.

Blender 2.73a (imports .3ds files of enemy characters and creatures flawlessly and with textures)
Blender 2.79b (imports statics and moveables that consist of only one mesh with textures)

Blender 2.49b might be useful too, but that needs more investigation (it imports traps that are composed of multiple meshes like stargate, plough, sentry gun, etc. better than other versions, but the models still would need manual corrections.



Scale and setting up Blender to work with large models:

A level editor building block (one square, 4 clicks high) in its original size is 1024 x 1024 x 1024 default units in Blender. At the default settings Blender will not display a model of that size without clipping, but using scale 1:1 means there's one thing less to remember and worry about when importing & exporting.

To set up Blender's view port to display large models you have to adjust the clipping distance:



Hit N on your keyboard to bring up the tool panel where you can edit the clipping values.
There's the option to save your changes to a startup file so you don't have to repeat those steps everytime.

I would not recommend trying to work on exported room geometry at scale 1:1 though, that's certainly going to push Blender's view port capabilities.
But it's perfectly practical for WAD objects.

Last edited by not again!; 07-01-21 at 00:15.
not again! is offline   Reply With Quote
Old 18-09-20, 15:45   #3
Lwmte
Member
 
Lwmte's Avatar
 
Joined: Aug 2010
Posts: 1,810
Default

It seems that Blender 2.91 will restore 3ds importer, at least that's what they declare in the issue tracker here. In this case, you will be able to directly export models/animations from wadviewer/trviewer to latest Blender and reimport into WadTool using fbx/collada/obj/whatever.
Lwmte is offline   Reply With Quote
Old 18-09-20, 18:51   #4
AshySlashy
Member
 
AshySlashy's Avatar
 
Joined: Dec 2019
Posts: 213
Default

Congrats on the grand opening.

Since I'm a beginner, I've got little to add here yet, but still.

Speaking of scale

When I was searching through posts here trying to find something about "Blender to TRLE tutorials" I've bumped into this tutorial. It focuses on importing UV mapped models into classic wads, but I think it may be useful for TE either (I haven't tested it yet, unfortunately). It also contained a tip for how to set up the grid in Blender to match TRLE block (idk if it's well-known ).

So, the settings are:



Result:





I use .obj format to export models, so the import settings in WadTool should be these:



Now I'm using this method to import models and it works like a charm.
There may be an easier way, however. If someone knows one, I'd be happy to learn more.
I guess, it's the most convenient way when you create a model from scratch, since you don't have to mess with distance view and huge meshes.
AshySlashy is offline   Reply With Quote
Old 18-09-20, 18:53   #5
SrDanielPonces
Member
 
SrDanielPonces's Avatar
 
Joined: Apr 2012
Posts: 10,346
Default

^ i use these exact values too
SrDanielPonces is offline   Reply With Quote
Old 19-09-20, 14:38   #6
not again!
Member
 
not again!'s Avatar
 
Joined: Feb 2008
Posts: 1,145
Default

@ Ashy Slashy - thank you, that's very useful info (it was new to me)

@ Lwmte - this is great news! It would be a dream come true if the new plugin could also import the animation data stored in the .3ds file


I was about to make a tutorial thread for the workflow below, but now I think it's better to wait for the new .3ds Blender plugin, otherwise the tutorial is going to be outdated pretty quickly again. I'll just drop all the relevant info what the workflow currently entails into this thread in the meantime.

Importing NPCs and Creatures into WadTool

As stated in the previous post you'll need Blender 2.73a (portable ZIP) for this.


1. Export the model as .3ds from WadViewer

2. Import into Blender 2.73. If you get an error message and the model shows up like this in Blender:



then go back to WadViewer and export the model again, picking a different animation from the drop-down. Blender can't import the animation stored in the 3ds file either way, but some animations apparently trip the importer up while others don't. In the dog's case animation #003 worked.

3. Save as .blend file

4. load the model into the latest version of Blender for the actual editing and re-modelling

5. as last and most crucial step before exporting select the root mesh (M000) to make it the active mesh, then hit A to select all meshes (the root mesh should now be a brighter shade of orange than the others), press the right mouse button and select Snap > Selection to Active. This will reset the coordinates of all object origins to zero, collapsing the model into a heap of body parts.

6. export as .obj

7. import into WadTool selecting the Replace Model option and using the 3ds Max OBJ preset (at the bottom of the dropdown list)
And don't forget that depending on what scale you were using in Blender you will have to adjust the scale accordingly.

8. test ingame




The entire process from WadViewer to testing ingame takes less than three minutes. It's incredible how modifying TRLE models has gone from very time consuming and cumbersome to so quick and straightforward.

Last edited by not again!; 19-09-20 at 15:40.
not again! is offline   Reply With Quote
Old 19-09-20, 15:45   #7
Lwmte
Member
 
Lwmte's Avatar
 
Joined: Aug 2010
Posts: 1,810
Default

I want to contribute here as well and clarify certain points.

Very often people ask "how do I apply shiny and blending modes to models that I import into WadTool, since WadTool itself doesn't allow doing that?"

It is very easy, because WadTool reads material properties from loaded model, so you can assign these properties right inside Blender.

To adjust shiny effect, you need to edit Sheen attribute in material properties:


NOTE: if you are exporting to OBJ format, shiny attribute won't be correctly exported. Some people have found a workaround by manually editing .mtl file, but I don't know much about this, maybe Lore can elaborate. So I recommend exporting to COLLADA (.dae) format or something else, especially because COLLADA will also export vertex colours (you may want to use those if you want to make a static mesh with baked-in shading).

To make texture appear semi-transparent (additive blending), you need to edit Alpha attribute in same material properties. Just reduce the value from 1.0 to anything less than 1.0, and texture will be semi-transparent:


Other blending modes are currently not supported, but of course you may use true alpha channel on your textures, it will be imported correctly in WadTool.

PLEASE NOTE that if you want to apply either shininess or additive blending only to certain faces in your model, you should use separate material for this. I am not that familiar with Blender, maybe not again! or someone else will cover this in the future

Last edited by Lwmte; 19-09-20 at 15:47.
Lwmte is offline   Reply With Quote
Old 19-09-20, 17:07   #8
AshySlashy
Member
 
AshySlashy's Avatar
 
Joined: Dec 2019
Posts: 213
Default

Quote:
Originally Posted by Lwmte View Post
NOTE: if you are exporting to OBJ format, shiny attribute won't be correctly exported. Some people have found a workaround by manually editing .mtl file, but I don't know much about this, maybe Lore can elaborate. So I recommend exporting to COLLADA (.dae) format or something else, especially because COLLADA will also export vertex colours (you may want to use those if you want to make a static mesh with baked-in shading).
Yeah, I'm working with .obj format, and shine effect is always messed up, although I zero all the material parameters in Blender.
To anyone who may encounter unexpected shininess on object in game:

1. Open object-related .mtl file in text editor.
2. Alter the Ns parameter (0 = no shiny effect). Should be something like this:

Code:
# Blender MTL File: 'sobek_door01.blend'
# Material Count: 1

newmtl Material.002
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd door02.png
Maybe it really is time to turn to .dae.

Quote:
Originally Posted by Lwmte View Post
To make texture appear semi-transparent (additive blending), you need to edit Alpha attribute in same material properties. Just reduce the value from 1.0 to anything less than 1.0, and texture will be semi-transparent
@Lwmte, thank you so much. Lately I was wondering if I can texture a part of an object with semi-transparent textures to have the desired effect (and without using Strpix). Time for some experimenting.
AshySlashy is offline   Reply With Quote
Old 19-09-20, 19:21   #9
not again!
Member
 
not again!'s Avatar
 
Joined: Feb 2008
Posts: 1,145
Default

It's actually Roughness which corresponds to the Ns value in the .mtl - you would expect it to be Specualr or Shine, but it's Roughness for some reason

I'll borrow the code you provided:
Quote:
Originally Posted by AshySlashy View Post

Code:
# Blender MTL File: 'sobek_door01.blend'
# Material Count: 1

newmtl Material.002
Ns 0.000000
Ka 1.000000 1.000000 1.000000

edit: to clarify - Roughness needs to be set to maximum to get rid of any unwanted shine, and set it to zero for extra shinyness. The Tomb Raider sprite for shine will only be applied to meshes that were set in Blender to smooth shading
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd door02.png
the corrseponding shader sliders in Blender for the .mtl material settings are:

Ns => Roughness
Ka => ?
Kd => Base Color
Ks => Specular
Ke => Emission
Ni => IOR (index of refraction)
d => Alpha

the bold ones are the two we need.

edit: The Tomb Raider sprite for shine will only be visible on meshes that were set to smooth shading in Blender, tho.

Last edited by not again!; 19-09-20 at 19:58.
not again! is offline   Reply With Quote
Old 19-09-20, 19:57   #10
Lwmte
Member
 
Lwmte's Avatar
 
Joined: Aug 2010
Posts: 1,810
Default

Yeah, it's weird that blender exports roughness as shininess for obj format... Sadly we can't do much about that, it's clearly an issue on either blender or assimp library side (TE uses it to import 3D models).
Lwmte is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 17:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.