Blender Export MD3 Tutorial

Installation

Just copy all those scripts to your Blender scripts/ folder and they should work using the menu. http://xreal.svn.sourceforge.net/viewvc/xreal/trunk/xreal/blender/

/!\ Note: In q_shared.py is a global variable named

GAMEDIR = '/opt/XreaL/base'

which is necessary to get materials working properly. If you don't want to create models for XreaL under Linux then is that one required to change to where your game and mod dir resists. It might look like:

GAMEDIR = 'C:/XreaL/base/'

or

GAMEDIR = 'C:/Quake3/baseq3/

Materials are imported and exported using the Q3A virtual filesystem path also known as QPATH. Notice the forward slashes. Those are probably not necessary, but the forward slash is your friend.

Model Creation

Create a work directory in your QPATH where you want to put your model into. We will call this directory [model]. If we want to create a Lightning gun model our [model] directory is:

models/weapons/lightning/

/!\ Make sure the material name (shown as MA: texturename when you select the ball looking button in your buttons list) matches the texture name. If the path to the file is models/weapons/lightning/f_lightning.jpg you need the name to read MA: f_lightning The material name will be concatenated at export.

MD3 surface material shader path results:

models/weapons/lightning/lightning           ([model] + lightning) = chassis material
models/weapons/lightning/f_lightning         ([model] + f_lightning) = weapon flash material

Tags

Tags can be realised by Empty Objects that have a "tag_" prefix in their name.

Exporting The Model

When you're ready to export, save your .blend file inside your [model] work directory.

Go to the menu: File -> Export -> Quake3 (.md3). Choose an appropiate filename for your exported model inside your [model] directory and click on "Export Quake3 MD3".

/!\ Note: The exporter exports only selected objects.

/!\ Note: To export a MD3 with animation set the "Current Frame" of Blender to the upper limit of your animations.

Material Shaders

Write material shaders if needed. The engine will look for [model] + [material] + image suffixes like .tga or .jpg. If it can't find a proper material or those images then you will get the default shader.

For our Lighting gun model example the XreaL/base/materials/weapon_lightning.mtr contains:

models/weapons/lightning/lightning
{
        {
                stage diffuseMap
                map models/weapons/lightning/lightning.tga
                rgbGen lightingDiffuse
        }
        bumpMap models/weapons/lightning/lightning_norm.tga
        specularMap models/weapons/lightning/lightning_spec.tga
}

models/weapons/lightning/f_lightning
{
        sort additive
        twoSided
        
        {
                map models/weapons/lightning/f_lightning.tga
                blend add
        }
}

As you can see those match the names that were concatenated at the export.

Your textured model should now show in-game without an issue.

XreaLWiki: BlenderExportMD3 (last edited 2008-01-10 20:34:19 by RobertBeckebans)

SourceForge.net Logo