Exporting models from Blender

Digital content creation tools provide great features, and talented artists are able to create whatever they imagine. While these tools enable creators to make cool things, we need to think about the channel that leads from the tool used for creating the 3D geometry and animations to our engine. This is why we will step through the following tasks to learn how to use the Chicken Exporter plugin for Blender, so we are able to close the gap between the content creation tool and the Panda3D engine.

Getting ready

Exporting model data from Blender requires the Chicken Exporter plugin. Follow the instructions of the preceding recipe (Setting up the Blender export plugin) to get ready.

How to do it...

Follow these instructions to export a model from Blender:

  1. Select all parts of the scene you wish to export.
  2. Click File | Export | Chicken R91 (.egg).
    How to do it...
  3. The last step opened the dialogue shown in the following screenshot. Enter the name of the exported file and click Export.
How to do it...

How it works...

The first thing we have to remember when using the Chicken Exporter is to select everything we want to export. The plugin does not export the current scene, but only the objects that were selected prior to launching the plugin. Although we are able to change our selection even after the plugin has been activated, we need to press the Update Selection button for Chicken Exporter to register our changes.

Besides the ability to update the selection of objects to export, Chicken Export has some more two-state buttons for toggling options that need some explanation. Force Relative Tex makes the plugin use relative paths for texture references, for example. So instead of specifying the path to these files starting from the file system root (C: on Windows or / on Unix based systems), file paths are used to describe the way from the directory that contains the model to the directory that contains the texture files.

Make Octree and Collision Octree enable optimization measures for bigger scenes. If these flags are active, geometry and collision shapes respectively, are split up and prepared to be stored in a hierarchical spatial data structure that allows the engine to dynamically cull parts of the level that cannot be seen by the player.

Panda3D supports normal mapping, a technique that allows us to make surfaces appear more detailed by putting an extra texture layer onto a model. This additional texture contains specially encoded surface normals that add fine surface details, like bumps and creases, without the use of any additional polygons. Normal mapping has become a standard technique in video games and if you want to learn more about it, there's plenty of material available on the internet if you search for the terms "normal mapping" and "dot3 bump mapping". To make models suitable for this technique when exporting from Blender, we need to export tangents and binormals, which we enable by activating Tangents & Binormals.

Lastly, there's a row of small buttons at the bottom of the Chicken Exporter screen. These two-state buttons enable or disable various tools to be called after the model data was exported. egg2bam converts the model to the binary .bam format, pview starts the Pview tool that lets us preview what the model will look like when loaded into the engine. pzip compresses the model file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset