Time for a small technical article for our fellow XNA programmers.
A few days ago I read about exporting Opaque Data from 3ds max/Maya to XNA (link). Till now, we interpreted the names of the objects in Blender for special objects (for example the spawn point of the player would be named spawn_player). The drawback is that the length of the name is limited, and the names will get very messy when using multiple tags.
When looking around in Blender I found that there is the option to give each object in the scene some properties. These options are located under the Logic Panel (F4). And looks like this:

Object Properties in Blender
As you can see, I’ve added a boolean property with the name “spawnpoint” and the value true to the object. Now I’ve modified the the FBX exporter modified for XNA to also export these properties (download available at the bottom of the post). All types, except for the timer, are supported.
Now I can import this model in XNA using a Custom Model Processor. The code for this example should look something like this:
[ContentProcessor]
public class CustomModelProcessor : ModelProcessor
{
public override ModelContent Process(NodeContent input,
ContentProcessorContext context)
{
Vector3? spawnpoint = null;
for (int i = 0; i < input.Children.Count; i++)
{
NodeContent child = input.Children[i];
if (child.OpaqueData.ContainsKey("spawnpoint"))
{
bool isSpawnpoint = (bool)child.OpaqueData["spawnpoint"];
if (isSpawnpoint)
{
spawnpoint = child.Transform.Translation;
input.Children.Remove(child);
}
}
}
ModelContent model = base.Process(input, context);
if (spawnpoint != null)
{
model.Tag = (Vector3) spawnpoint;
}
return model;
}
}
Also, Blender’s Y-axis is XNA’s Z-Axis, and vice-versa. The exporter can also rotate the model, so up in Blender is up in XNA. I’ve just commented out the line, just edit the exporer script with your favorite text editor and uncomment (remove the ‘#’) the following line:
# GLOBAL_MATRIX = GLOBAL_MATRIX * RotationMatrix(-90, 4, ‘x’)
Download the exporter script: HERE
(Windows users: Put it in your %APPDATA%\Blender Foundation\Blender\.blender\scripts folder).
Special thanks to Lynch3 at #xna on EFnet for helping me out with the FBX file syntax.