Milkshape POV-Ray 3.5 include File Exporter - v 1.0
Copyright (C)2003 Neil Jedrzejewski
(Email)
NOTES/LICENSE
This plug-in is free and should be distributed without cost. However, if you find this plug-in useful and would like to say thank you, please feel free to make a small donation via PayPal - even a dollar is appreciated.
You are allowed to distribute this plug-in freely as long as it is not for profit and this documentation is intact and unmodified. If you do decide to distribute it, please let me know as I'd like to know who's using it.
If you have any problems or find any bugs please let me know
DISCLAIMER
This software is experimental. I, Neil Jedrzejewski, assume no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
About
Having made models using Milkshape for a while, I was always kind of jealous of the 3D Studio Max users who could produce great looking preview renders of their work using the Brazil Rendering system to give nice diffuse models with soft shadows. Not having money to burn, I wondered if their was a free renderer I could use and decided to use POV-Ray with its diffuse lighting option.
However, the default POV-Ray file exporter in Milkshape doesn't produce anything useable by POV-Ray 3.5 so it didn't look good. My first sucessful attempt required me to export from Milkshape in OBJ format and then convert it to a POV-Ray file using a 3rd party tool. The output was ok, but still required a lot of editing of the files to make them work.
Realising I wasnt the only person in the world who wanted to do the exact same thing as me, I downloaded the Milkshape SDK and tried to figure out how to write a plug-in. The ironic thing is, I cant program in C++. I do however use a lot of other C++'like languages so after a bit of hacking I had something that works. Originally I was only interested in exporting meshes with bitmap textures but I expanded on it to export other model attributes. I figured this would make the plug-in more useful to more people.
So here it is, my first plug-in, my first C++ program and hopefully something you can use.
What does it export?
The plug-in generates a POV-Ray 3.5 include file which, obviously, you can include into POV-Ray scenes. The output include file is broken down as follows:
- Milkshape groups are exported as individually ID'd smooth_mesh objects with uvw mapping co-ordinates.
- Materials are exported as indiviually ID'd materials with the following parameters:
- Ambient colour
- Diffuse colour (not exported for meshes with bitmap textures)
- Specular colour and highlight strength (colour is greyscale, based on the red component)
- Transparency (doesn't support the alpha bitmap option)
- Texture (assumes bitmaps are BMP format, you can edit the INC file to use other formats)
- Meshes and textures are bound together as individual POV-Ray objects with their own ID's
- Sub-groups are joined together using "union" into one model with the ID "milkshape_model"
You can choose to just insert the final model into your scene or add individual objects, meshes and textures as you wish.
Installation
Copy the file "msPOVRay35Exporter.dll" into you MilkShape program folder and start/restart Milkshape. If all is well you should see "POVRay 3.5 include File..." under the Export list in the File menu.
Using the Exporter
I've created a step-by-step tutorial on using Milkshape, POV-Ray and the plug-in to produce previews of models. You can find the tutorial here.