PDA

View Full Version : Import Directx models


Beau_M
04-23-2009, 10:07 AM
I noticed there are a few directx model exporters floating around, but couldn't find any importers (which is what I needed at the time). So I decided to write one. Found it quite simple to import the mesh data, but decided I wanted the surfaces too, so it takes care of that while it's at it (with some limitations, see below). I've only tested this on 9.6 (32 and 64 bit), so I have no idea what else it would run on.

Currently does:
- Import all mesh data
- creates as many surfaces as required and assigns them to each poly

Limitations:
- ONLY works on 32bit txt models (You can tell by reading the first line of the model. If the last two digits are 32, it's fine. I will possibly add support for 64bit later)
- Will not read binary, tzip or bzip models
- Will NOT read files that contain multiple mesh data sections... (wasn't an issue for what I needed and didn't think of it until just now actually)
- just about anything else you can think of that I didn't list it can actually do

ToDo: These might happen, probably won't though
- Retrieve textures and assign them
- Weight maps
- UV mesh (if I can figure it out...)
- Animation data to morphs
- Normals

Download:
http://www.arendedwinter.com/downloads/LW/Directx_Import.zip

This could probably be written better, I wouldn't suggest trying to change anything without a lot of experience with pure chaos :) (although it is pretty well commented, kinda)

jwiede
04-23-2009, 02:11 PM
Any chance you'd be amenable to releasing the source so others could build it for Mac, and perhaps add some of the missing features?

Beau_M
04-23-2009, 06:34 PM
It's an uncompiled lscript, so shouldn't be a problem to open (although I'm not familiar with Mac) :) If you wish to make a Mac version, go for it!

I have a feeling something funny is going on with the surfaces. Seems a bit odd to have, say, an eye with the same surface name as a foot... Then again maybe it's right, I don't know just yet...