Pages

Google Search

Sunday, September 27, 2009

Google SketchUp Xaml exporter

I wanted to build a WPF 3D application, that will present models. I didn't want to include code that loads different formats and creates WPF models at runtime, and I wanted an easy-to-use, free modeler.Blender is free, but I find it very cumbersome. Google SketchUp is very easy to use, but was lacking a way to export to XAML.Fortunately, SketchUp has a very easy-to-use RubyAPI that I could use to build an exporter.It currently exports the meshes separated by materials, and grouped together in geometry groups according to the same hierarchy structure of the model. Materials include front faces only (i.e. no BackMaterials) and support solid color and textures. If no material is given, a solid white material is used.While it's not perfect, it does a pretty good job. Feel free to use and please send feedback,http://cid-8fbcae0caa96d592.skydrive.live.com/self.aspx/.Public/xamlExporter.rb

14 comments:

I also have a problem- how to export sketchip model to XAML? I downloaded: http://cid-8fbcae0caa96d592.skydrive.live.com/self.aspx/.Public/xamlExporter.rb- but do not understand, how can I use it??? Can you tell me?

Just copy the .rb file to the Skethup plugins folder(C:\Program Files\Google\Google SketchUp 7\Plugins, or something similar)You will see a new menu - plugins, under which there will be a sub menu 'XAML', under which you will see "Export to XAML..."Select a file name and press Save.

Jubei,Thanks for your interest in XamlExporter.I have only tested it on rather simple models that I needed for an application I was writing.I'd be glad to improve the script given more complex models.Please send such a model to my email (itaibh at gmail dot com), and I'll see what I can do.

Hello Gareth. Thank you for trying Skethup Xaml Exporter.The exported XAML files contain a 3DGroup element, which must be placed inside a 3DViewPort.You need to create a 3DViewPort in your XAML application, and place the content of the exported file there. You may also try to link to it, but this is more advanced topic and I suggest you look it up on Google or Bing.

Hi Phil.Seems like there is a problem with grouped elements. I tried "exploding" the model, then "exploding" a key sub-model and then that key showed up in the XAML.I'll take a look why that problem happens, but it might take a while. In the mean time try to use the workaround I written above.

About Me

I am a professional software developer and architect with latest experience in C#/.Net and web technologies.
Most professional work includes development of infrastructures and C4I systems, but I also had some experience related to gaming, and currently doing full stack development which includes ASP.NET servers, HTML5 UI and some backbone supporting applications.
I love to code as a hobby, when I find the time. In my personal projects I use mostly PHP for web development, and C# for small tester apps. I tried doing some personal mobile development, but unfortunately I don't have anything to show.