Daily Tip: How to import 3D model to WPF from 3D Max

31 במרץ 2009

I want to present very useful feature “XAML exporter for 3D Studio Max”. This feature contains number of MAX-Script files with code that allows exporting 3D scenes from 3D Studio Max to XAML files. “Max2Xaml” Project on Codeplex website: http://max2xaml.codeplex.com.

I’ll try to present a simple guide for this feature with some useful example.

Software requirements for this guide: 3D Studio Max 2007 or later (I use 3D Studio Max 2009), Microsoft Expression Blend 2.0 (Final Release).
SDK and Framework requirements: Microsoft .Net 3.0 or 3.5.

Let’s start:

(1) Download ZIP File from here and extract it to some directory on your hard drive.


(2) Open/build scene with 3D objects in 3ds Max.


(3) Ensure that each object has definition of material (this required by “Max2Xaml”).


(4) Go to “MAXScript” sub-menu and click on “Run Script … ”.


(5) Select “Main.ms” script file from extracted directory and click on “Open”.


(6) Click on “Export” in dialog-box.


(7) Type file name (with “xaml” extension) and click on “Save”.


(8) This is “MAXScript” Editor window with XAML output of current scene:


The output contains XAML code for “ResourceDictionary” that contains data for definitions of all scene models/objects,




and other data.


(9) Open/create new WPF project in Blend.


(10) Add existing item to project tree.


(11) Selected created XAML file and click “Open”.


(12) After addition of new resource dictionary merge it with resource dictionary in target window.


(13) Add “Viewport3D” object into main grid (this object is used to display 3D scenes/objects).


(14) Added “Viewport3D” already contains default camera. Add “ModelVisual3D” objects for each 3D model from the scene.


(15) Link each model’s geometry to resource from merged dictionary.



(16) Material of each model can be linked to resource from merged dictionary.


(17) Probably we’ll not see the 3D models.


(18) We can adjust camera’s position and other parameters, and then we’ll see the models.


(19) If models are black or still invisible, add new “ModelVisual3D” with light (can be “DirectionalLight”) that will “radiate” on scene objects.


(20) After some adjustments of camera and light we’ll see imported models from 3ds Max.


The example project with code can be downloaded from hereimage025.

Summary: Some WPF projects require complex 3D models in 3D scenes, these complex models can be made in 3D modeling software like 3ds Max and imported into WPF. This post shows how to port 3D models from 3ds Max to WPF. See next post(s) with guide for porting 3D models from “Blender” to WPF.

I’m not responsible for any damage that may be caused by using this post or its content. Any materials in this post were provided AS IS without any changes and other meanings.

Add comment
facebook linkedin twitter email

Leave a Reply to Guess Cancel Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



  1. Steve K.1 באפריל 2009 ב 11:49

    You've kicked a really good thing!
    I've been looking for this feature for a long time.
    Many Thanks 🙂

  2. flucrallusy4 באפריל 2009 ב 3:11

    Great site this blogs.microsoft.co.il and I am really pleased to see you have what I am actually looking for here and this this post is exactly what I am interested in. I shall be pleased to become a regular visitor 🙂

  3. Shooneenig10 באפריל 2009 ב 21:56

    great site this blogs.microsoft.co.il great to see you have what I am actually looking for here and this this post is exactly what I am interested in. I shall be pleased to become a regular visitor 🙂

  4. TheCat2 במאי 2009 ב 17:55

    Hi, Max!
    Thank you for suggestion.
    Can you post a simple but detailed example,
    done using Kit3D INSTEAD OF WPF?

    Using Kit3D, I have discovered that there are some little subtle bugs/problems with XAML markup.
    I'm not sure I can simply copy and paste this code, "as is".
    Thanks in advance

  5. Maxim3 במאי 2009 ב 0:52

    Hi "TheCat",
    The "Kit3D" doesn't support (yet) the XAML, means that all programming can be done (for now) in code-behind (C# or VB.Net).
    You're right, you can't copy-paste the code for WPF to Silverlight-Kit3D. I hope I'll get some time to write post about porting 3ds models into "Kit3D", that I do for now: I copy mesh-geometry data (Positions, Texture Coords and other stuff) from output-XAML file into some resource dic. and compile them into XAP pachage, see my future post about this issue.
    Here some example of "Kit3D" using 3ds models: http://www.segevsystems.tv/test/handball/ .

  6. Helge6 במאי 2009 ב 14:19

    It seems not to work with Multi/Sub Materials. It says "Unknown property diffuseMap".

  7. boy9 בנובמבר 2009 ב 11:39


    why my model for export Xaml is error

    "Type error : call need function or class got : undefined"

    my mail Supachoke_boy@hotmail.com

  8. david stubbs22 בדצמבר 2009 ב 15:16

    I've found exporting a scene from 3ds Max as an OBJ (Maya Preset Export settings) and then importing it into Blend to be very competent. Blend has an inbuilt Obj->XAML converter which works pretty much on par with any exporter I've seen.

  9. Maxim23 בדצמבר 2009 ב 22:38

    david stubbs,
    of course you can import 3d models by using OBJ files.
    months ago i uploaded a post about this option: http://blogs.microsoft.co.il/blogs/maxim/archive/2009/05/24/daily-tip-how-to-import-3d-model-to-wpf-in-couple-clicks.aspx

  10. Robinson15 בינואר 2010 ב 21:14

    What about animations? Actually, I've got an animation that keys in a bend modifier, as well as rotation. Is there any way I can `flatten' the animation in 3ds, so that it's just changing mesh vertices and then export the animation as xaml? I'm presuming that the xaml converter doesn't know anything about modifiers!

  11. cue16 באפריל 2010 ב 9:59

    Please someone help me solve this problem. I got this while exporting.

    "–Unknown property "name" in undefined"

    another error when i export the second time.
    "–Type error: closeRolloutFloater requires RolloutFloater, got :undefined"


  12. oqoelksr@gmail.com24 באוקטובר 2012 ב 1:19

    Appreciate your this content. I tried this specific and yes it beautifully worked well.

  13. Sidharth_P17 בדצמבר 2012 ב 2:22

    Really great article thanks a lot… keep posting..!!

  14. Lambert30 בדצמבר 2012 ב 4:32

    One place that you can check would be on the internet. This episode introduces three people who
    are embracing creative solutions to the looming shortage of drinking water
    – be it desalinating the ocean, catching rainwater or cleaning up our rivers.

    Chlorine and volatile organic compounds, or "VOCs" are not removed
    in steam distillation, because they vaporize at a lower temperature than
    water does, and they end up in the condensation chamber along with the steam.

  15. Mclendon13 בינואר 2013 ב 1:29

    Hi to every body, it's my first pay a quick visit of this web site; this website carries amazing and actually good stuff for readers.

  16. Matheson5 בפברואר 2013 ב 11:39

    Find all of your favorite designs and designers only at Lollipop – Moon.
    This day, minimum of 100 lamps and maximum of 1 lakh lamps are lighted.

    Favorite thing about the Holidays.