POV-Ray include file exporter plug-in for milkshape 3D
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 original 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 (version 1.1 now supports non BMP textures)
- 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.
Note: as of Milkshape 3D 1.6.7 and later, the POV-Ray exporter is included as part of the installer. If you choose to install 3rd party plugins, the exporter will be installed for you. Thanks Mete!
- msPOV-Ray35Exporter_v1.1.zip (v1.1) (2556 downloads)
A short tutorial in HTML format and sample rendering scenes are included in the zip file.
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.
License / Disclaimer
You are allowed to distribute software on this page 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.
This software is experimental. I, the author, 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.
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.