Author Topic: Tutorial - Exporting a map from Blender.  (Read 7267 times)

m4gnificent_b4st4rd

  • Guest
Tutorial - Exporting a map from Blender.
« on: November 12, 2009, 09:21:23 pm »
This tutorial is designed for Blender modellers who want to see how a model looks in the game, but don't know how to use Gtkradiant.

Blender comes with a quake3 .map exporter (File > Export > Quake3 .map) which can also be used to make Tremulous maps. This can export suitable meshes as brushes, Blender lights as game lights and it can export empties with the right logic properties to everything else required. Since I want this tutorial to be accessible to inexperienced Blender users I'll put as much detail in as possible.


1. Settings

First, it's worth changing a few settings in Blender to make your job easier. Open the View menu and select view properties



and set grid spacing to 32, which is roughly equivalent to a Tremulous meter.



Then use the View menu again and select orthographic and Top view.



Next put the cursor at the top edge of the 3D window (just under File, Add, Timeline etc), click it and drag it down to reveal the settings. Then select Grab/move in the Snap to grid options. When working on the meshes that will be exported to brushes this will help keep everything lining up correctly and so prevent leaks.



Delete the default cube, light and camera that were in Blender's 3D window when you opened it. Now we are ready to start mapping.


2. Brushwork

Add a cube (space > add > mesh > cube).
Make sure you are in top view (View > Top).
Go into edit mode (Tab).
Select the vertices of each corner in turn (press B) and then move them (press G) till you have a 16x16 square like so.



Return to object mode (Tab) and create another cube.
Repeat the above process, but this time make a wall that is the height of 8 grid spacings.



Keep doing this till you have all the walls and the ceiling, which will surround an "airtight" 16x16x8 room.



At this point it's worth switching to wireframe view (press Z) so that you can see what you are doing inside the room.

You can leave these meshes separate, but I like to join turn them into a single mesh by selecting them all (press A) and then joining the selected meshes (press ctrl J). The script can still tell the individual component "brushes" apart as long as you don't remove duplicated vertices.


3. Lights

This is fairly simple, just add a light in the centre of the box (space > add > lamp > lamp). Next set the buttons window to show the shading options (press F5) and adjust it's Distance to 1000. You can also change the colour of the light by clicking on the white box.



Later on you will probably want to experiment with multiple lights to light your model in a more interesting fashion, but this will do for now. Note that the md3 model I'll be using in this tutorial


4. Empties

Everything else in the game is exported by giving logic properties to empties.
For this tutorial we need to create a model reference and the basics to make the work in the game.

Create an empty (Space > Add > Empty).

These can be a bit difficult to see so I'll share some tips on how to improve their visibility.
Press F9 to bring up the editing options in the buttons window.
Set the Empty display to "single arrow".



Then in the 3D window bring up the "transform properties" box (press N), change the name of this first empty to _player_intermission and scaleX to 128, scaleY to 128 and scaleZ to 32. This will give you clearly visible empties.



Now make 3 copies of the first empty and rename them to _human_spawn, _alien_spawn and _stasis_model.

To give the export script the information it needs, we must assign logic properties to each of these empties.
Press F4 to bring the logic option to the buttons menu.
Select the _player_intermission empty and then give it these properties in the logic window.


Give the _human_spawn empty these.


Give the _alien_spawn empty these.


Give the _stasis_model empty these.

The model reference was too long to be fully shown in the box, but it was models/mapobjects/stasis/stasis.md3

Now position your 4 empties as shown in these pictures.





The _human_spawn, _alien_spawn and _player_intermission are set to 32 units (1 grid space) above the ground, but in the game they will be placed on the ground. Models are placed exactly were they are in the map, so I put _stasis_model only 1 unit above the ground. I did this by manually typing the LocZ (z location = height) value in the "transform properties" box (press N).


5. Exporting

Everything should be ready to export to a map now, so go to the top left hand corner of your screen and select File > Export > Quake3 .map.



Use the file browser to choose the export directory and give your map a name.



Click EXPORT MAP.

Now you should have a small options box.
Set the scale to 1.
Set the Null texture (the one that will be used for your brushes) to whatever you want. I used arachnid2/e8cretefloor01c. Remember not to start the texture with the word texture or any \s. Just arachnid2/e8cretefloor01c (or whatever texture you like).



Now click the OK box and your map file should be exported ready for compiling.  :)



Afterword

I hope this tutorial was helpful. If there was anything I didn't make clear, please let me know and I'll put it in.

Huge thanks to Bissig from tremcentral.com

Thankyou.


EDIT - This page is now up on the wiki too. LINK.
« Last Edit: December 08, 2009, 08:00:25 am by m4gnificent_b4st4rd »

MitSugna

  • Guest
Re: Tutorial - Exporting a map from Blender.
« Reply #1 on: November 13, 2009, 05:52:43 am »
Well DONE! For the images, you can use tinypic (register an account)

Demolution

  • Posts: 1198
  • Turrets: +157/-64
Re: Tutorial - Exporting a map from Blender.
« Reply #2 on: November 13, 2009, 06:22:37 am »
Great tutorial. Sticky please!

Clan [AC] - For all your air conditioning needs please visit: http://s1.zetaboards.com/AC_NoS/index/
my brain > your brain.
and i am VERY stupid.

fleash eater

  • Posts: 408
  • Turrets: +25/-33
Re: Tutorial - Exporting a map from Blender.
« Reply #3 on: November 14, 2009, 04:40:47 pm »
if i can get around to it ill host em, and also good job...but what did you use to export?




and i reposted this tut at my webpage for anyone who wants to  learn there, and i properly accredited you
http://nomnomclan.org/index.php?topic=693.msg6658#msg6658
« Last Edit: November 14, 2009, 04:44:42 pm by fleash eater »
for Chaos info, contributing, and Community events go to chaos.Nomnomclan.org

crazyamerican

  • Posts: 9
  • Turrets: +0/-0
Re: Tutorial - Exporting a map from Blender.
« Reply #4 on: June 27, 2010, 07:51:31 am »
Now how do you get the map into the game? It needs a .bsp file, doesn't it? I don't know how to compile a .map file into a .bsp file for gameplay. I am running Ubuntu 10.04 Lucid. Please help.
:tyrant::tyrant:
:tyrant::tyrant:
:tyrant::tyrant:      :battlesuit: Come on!
:tyrant::tyrant:

DraZiLoX

  • Posts: 844
  • Turrets: +24/-24
Re: Tutorial - Exporting a map from Blender.
« Reply #5 on: June 27, 2010, 10:08:20 am »
Now how do you get the map into the game? It needs a .bsp file, doesn't it? I don't know how to compile a .map file into a .bsp file for gameplay. I am running Ubuntu 10.04 Lucid. Please help.
Maybe reading whole tutorial could help!

Demolution

  • Posts: 1198
  • Turrets: +157/-64
Re: Tutorial - Exporting a map from Blender.
« Reply #6 on: June 27, 2010, 07:17:35 pm »
Now how do you get the map into the game? It needs a .bsp file, doesn't it? I don't know how to compile a .map file into a .bsp file for gameplay. I am running Ubuntu 10.04 Lucid. Please help.

You know, using the search function isn't that difficult... :)

Check the bottom post here:
http://tremulous.net/forum/index.php?topic=3413.0

Apparently you have to export your blender model(s) to .ASE, but there are a lot of issues still.

Clan [AC] - For all your air conditioning needs please visit: http://s1.zetaboards.com/AC_NoS/index/
my brain > your brain.
and i am VERY stupid.