====== Using L3DT with Blender ======
^ Author | [[user>Aaron]] |
^ Date | 13th of April 2008 |
^ PDF | {{:tutorials:blender:aaron:blendertutorial.pdf|551kB}} |
This tutorial is now obsolete. To export to Blender in L3DT v2.9 build 26 or later, use the '//File->Export->Export optimised mesh//' menu option ([[bundydocs>l3dt:userguide:io:export:mesh|see user guide]]). With this option you can export the terrain mesh and texture as a COLLADA '.dae' file, which can be then imported into Blender with no further work.
===== 1. Getting the software =====
^ Program ^ Download from: ^
| L3DT | [[http://www.bundysoft.com/L3DT/downloads/]] |
| Blender | [[http://www.blender.org/download/get-blender/]] |
===== 2. Generating the map in L3DT =====
If you don't know how to generate a map in L3DT, I recommend you use the 'walk-through guide', which is activated by using the '//Help->Walk-through guide//' menu option. Alternatively, more adventurous users may wish to follow the [[tutorials:l3dt:fjord|designing a fjord tutorial]].
If you have any questions about how to generate maps in L3DT, please use the [[http://www.bundysoft.com/phpBB2/viewforum.php?f=4|help and support forum]].
===== 3. Exporting the heightfield from L3DT =====
Select '//File->Export map//' in the menu:
| {{:tutorials:blender:aaron:exportmapmenu.png|:tutorials:blender:aaron:exportmapmenu.png}} |
^ The 'export map' menu option. ^
In the 'select map' dialog box, select 'Heightfield':
| {{:tutorials:blender:aaron:exportmapdlg.png|:tutorials:blender:aaron:exportmapdlg.png}} |
^ The 'select map' dialog box. ^
In the 'export map' wizard, select the 'OBJ (wavefront)' format, and enter your filename (or use the 'browse' button):
| {{:tutorials:blender:aaron:exportwizardhf.png|:tutorials:blender:aaron:exportwizardhf.png}} |
^ The 'export map' wizard. ^
Click OK and the heightmap will be exported.
===== 4. Inverting the texture map =====
To use this section of the tutorial, you will need L3DT version 2.5.3.11 or later, which was released on the 20th of April 2008. Earlier versions may not be able to invert the texture properly. If this affects you, I suggest you either update to the latest version, or export the texture and invert it in another image program.
For [[bundydocs>l3dt:faq:io#why_is_the_y-axis_inverted_in_my_map_file|various technical and historical reasons]], L3DT uses an image coordinate space that is 'upside-down' relative to Blender. This means we have to flip the texture before exporting it. To do this, use the '//View->Show map//' menu option to select the texture, and then use the '//Extensions->atRotate->Mirror active map (y-axis)//' menu option:
| {{:tutorials:blender:aaron:atrotatemirrory.png|:tutorials:blender:aaron:atrotatemirrory.png}} |
^ Inverting the texture map. ^
This will flip the map in the vertical axis, ready for export to Blender.
===== 5. Exporting the texture map =====
Select '//File->Export map//' in the menu again:
| {{:tutorials:blender:aaron:exportmapmenu.png|:tutorials:blender:aaron:exportmapmenu.png}} |
^ The 'export map' menu option. ^
In the 'select map' dialog box, select 'Texture map':
| {{:tutorials:blender:aaron:exportmapdlg2.png|:tutorials:blender:aaron:exportmapdlg2.png}} |
^ The 'select map' dialog box. ^
In the 'export map' wizard, select the 'JPG' format, and enter your filename (or use the 'browse' button):
| {{:tutorials:blender:aaron:exportwizardtx.png|:tutorials:blender:aaron:exportwizardtx.png}} |
^ The 'export map' wizard. ^
Click OK and the texture will be exported.
===== 6. Importing the OBJ file into Blender =====
When you open Blender, it should look like this:
| {{:tutorials:blender:aaron:blenderstart.png|:tutorials:blender:aaron:blenderstart.png}} |
^ Blender, when first started. ^
The first thing to do is to press the 'x' key, to delete the default box in the middle of the scene. Blender will ask you to confirm the delete (as below). Press OK.
| {{:tutorials:blender:aaron:blenderconfirmdelete.png|:tutorials:blender:aaron:blenderconfirmdelete.png}} |
^ Deleting the default box. ^
Now we want to import the OBJ file. To do this, select the '//File->Import->Wavefront OBJ//' menu option:
| {{:tutorials:blender:aaron:blenderimportobjmenu.png|:tutorials:blender:aaron:blenderimportobjmenu.png}} |
^ The import OBJ file menu option ^
Now, select the file and press the 'import a Wavefront OBJ' (at top right):
| {{:tutorials:blender:aaron:blenderimportobj.png|:tutorials:blender:aaron:blenderimportobj.png}} |
^ Selecting the OBJ file. ^
After pressing 'import a Wavefront OBJ', you will be presented with some import options (see below). You don't need to change these, so press OK.
| {{:tutorials:blender:aaron:blenderimportobj2.png|:tutorials:blender:aaron:blenderimportobj2.png}} |
^ Importing the OBJ file. ^
Once you click OK, Blender will import the terrain OBJ:
| {{:tutorials:blender:aaron:blenderwithobj.png|:tutorials:blender:aaron:blenderwithobj.png}} |
^ The imported OBJ file. ^
To center the terrain, press the 'g' key and move the mouse until the terrain is centred:
| {{:tutorials:blender:aaron:blenderwithobj2.png|:tutorials:blender:aaron:blenderwithobj2.png}} |
^ The imported OBJ file (centred). ^
To check that everything is OK, you may now want to use the '//Render->Render current frame//' menu option:
| {{:tutorials:blender:aaron:renderframemenu.png|:tutorials:blender:aaron:renderframemenu.png}} |
^ The imported OBJ file. ^
This option will open Blender's renderer window, which will eventually show something like this:
| {{:tutorials:blender:aaron:blenderrender.png|:tutorials:blender:aaron:blenderrender.png}} |
^ The terrain OBJ rendered in Blender. ^
That's it for the OBJ import.
===== 7. Importing the texture JPG into Blender =====
To render the terrain with a texture in Blender, we must first create a //material//. To do this, press the 'F5' key to open the materials panel (as shown below). Note: you may need to bash the F5 key a few times to get it to show the right panel.
| {{:tutorials:blender:aaron:blenderlinksandpipeline.png|:tutorials:blender:aaron:blenderlinksandpipeline.png}} |
^ Creating a new material using the 'links and pipeline' panel. ^
In the 'links and pipeline' area, press the 'add new' button to create a new material. This will open the full material panel (see below).
In the far-right 'texture' area, press the 'add new' button to add a texture to the material.
| {{:tutorials:blender:aaron:blendermaterialpanel.png|:tutorials:blender:aaron:blendermaterialpanel.png}} |
^ The material panel, where we want to add a new texture (far right). ^
Now press F6 to open the 'texture' panel (see below).
| {{:tutorials:blender:aaron:blendertexturepanel.png|:tutorials:blender:aaron:blendertexturepanel.png}} |
^ The texture panel. ^
In the 'texture' area, set the 'texture type' to image. This will open the full texture panel (shown below). In the 'image' area, press the 'load' button, and select the texture image your exported from L3DT earlier.
| {{:tutorials:blender:aaron:blenderloadtexture.png|:tutorials:blender:aaron:blenderloadtexture.png}} |
^ Loading the texture in Blender. ^
Once the texture image is loaded properly, the texture panel in Blender should look like this:
| {{:tutorials:blender:aaron:blendertextureloaded.png|:tutorials:blender:aaron:blendertextureloaded.png}} |
^ The texture, now loaded in Blender. ^
If you've got this far, then everything should ready for rendering. Select the '//Render->Render current frame//' option to open Blender's renderer window, which should show something like this:
| {{:tutorials:blender:aaron:blenderrender2.png|:tutorials:blender:aaron:blenderrender2.png}} |
^ The terrain OBJ rendered in Blender with the JPG texture. ^
You may now want to tinker with Blender's camera position, or adjust the lighting settings. I have no idea how to do that, so I suggest you consult [[http://www.blender.org/education-help/tutorials/getting-started/|Blender's Getting Started guide]].
I hope this has helped.
----
// Back to [[:tutorials|tutorial index]]//