Search Wiki:
Project Description
The XAML export script for Blender allows the popular free 3D modeler to be used to create content for WPF applications. 3D scenes created in Blender are exported to .xaml files which can be dynamically loaded or compiled into your WPF applications.

XamlExporter_ScreenShot.png

Installation Instructions
  • Install the version of Blender indicated in the release notes. Blender is available from http://www.blender.org
  • Copy the xaml_export.py file to Blender's scripts directory. On Windows this is typically located at one of the following locations:
C:\Program Files\Blender Foundation\Blender\.blender\scripts
C:\Documents and Settings\<YourUserName>\Application Data\Blender Foundation\Blender\.blender\scripts

  • Restart Blender. If the installation was successful you should see a new entry under Blender's ~File~Export menu for "Xaml (.xaml)..."

Usage
After composing your 3D scene is Blender choose the ~File~Export~Xaml menu. This will display Blender's standard file dialog. Enter the name of your scene and press the "Export Xaml" button.

The exported Xaml can be viewed in the WPF Model Viewer, which is included in the 3D Tools project. Alternatively, you can dynamically load the Xaml into your WPF application using XamlReader.Load(fileStream).

Known Issues
  • The ImageSource property is exported as a fully qualified path as it appears in Blender (e.g., "D:\MyModels\Ballmer.png").
  • If you add a texture, you will need to go into the UV editor and add texture coordinates. The exporter does not export the "default" UV coordinates that Blender displays when a mesh has no UV coordinates assigned.
  • The Windows Presentation Foundation does not have an image codec for Targa (*.tga) files. If you export a model which uses Targa files you will need to convert these by hand to a format supported by the WPF (e.g., PNG) and fix the exported .xaml by hand.
  • Diffuse materials are exported as a simple texture if applicable or a solid color if no texture is available. Other types of materials are not currently supported.
  • Blender uses different lighting equations than the WPF. As a result, exported lighting is approximate. Only "Sun", "Lamp", and "Spot" light types are supported.
  • There is currently no support for animation or support for geometry types other than meshes. The recommended workflow is to use Expression Blend to create the animations.
Last edited Jun 18 at 9:00 PM  by TheRHogue, version 16
Comments
TheRHogue wrote  Dec 28 2007 at 10:54 PM  
I'm using Blender 2.45, and I can create models and setup the U,V's using the xaml exporter v0.42, and this is all I really need. Since Zam3D has been released, it is no longer free. Zam3D costs about $200. Students can use blender with the current xaml exporter to create xaml models and setup texture coordinates. So, the exporter is still very useful in its current state, and much thanks to Dan for creating it :)

Once you get the model into xaml, you can use other tools like Expression to do your animations, add lights and move things around...of course, you can also write the xaml or code by hand :) Some of the Beta's were free.

To see a lot of video tutorials on Blender, go to http://www.gryllus.net/Blender/3D.html . This is an actual course for students, and it is very well done. You can learn how to create a model and how to create a texture via the UV Editor, and this is what you need to export your model into useful Xaml. All you need to do is watch about 10 minutes of video. After you create your object, like a cube, watch the videos on UV Textures Part 1-5, and you will be able to export xaml 3D objects with proper UV coordinates via the xaml exporter.

adamtaub wrote  Feb 12 at 9:11 PM  
This latest version has a small typo @ line 847. It should read:
warn("Skipping unsupported object type in scene: '" + childType + "'")
instead of
warn("Skipping unsupported object type in scene: '" + child.GetType() + "'")

skjhaveri wrote  Mar 27 at 8:53 PM  
On Vista, .blender script location is
C:\Users\<user name>\AppData\Local\VirtualStore\Program Files\Blender Foundation\Blender\.blender\scripts

Updating...