Skip to main content

3D Studio Max => Valve Source SDK & Hammer

3D Studio Max => Valve Source SDK & Hammer

I've started a little project once again and once again it's an exporter for 3D Studio Max. I've seen that there is an exporter for models, yet there is none for maps. After all my experience with Hammer, i have to say i'm surprised nobody tried that yet. Hammer isn't really what i would call "intuitive" and the low number of beautyful user-maps so far sorta proves my point (at least to me).

Nevertheless, i started my own exporter script. So far it's kinda not even alpha, but i guess the results are promising. I can export all objects that can be converted to mesh objects (like boxes, cylinders, polygons, meshes of course, etc...).

Download MapExporter.zip

Hook Nr. 1: It only works as far as these objects are convex (just like in Hammer). A concave objects (like say a pipe) has to be created out of convex objects. I'm working on a solution of that problem.

Hook Nr. 2: The UV-coordinates in the map-file are in world space, while in max they are stored in UV-space. This is a major pain in the ass to convert, the moment a face is in an arbitrary position (both in the world and in uv-space) there has to be a lot of math shit evaluated to get to a conversion matrix. So far my poor little artist brain can't handle the pressure, therefore i integrated a generic uv format so far. It looks alright for general texturing, so i'll put that back in priority.

Hook Nr. 3: The geometry shouldn't be too detailed. I've exported a normal sphere with 16 segments as a test and the result was... "okay". The problem comes from two issues: For once 3D Studio MAX gives no proper access to UV-data via Poly's, so i have to use Meshes. This mostly doubles the amount of faces, which isn't a problem most of the time, as Source works with planes. Only if loads of planes connect in a single point, you will encounter some problems for sure.

Anyway, take a look of my results so far:

For that last picture i created a temporary light to have some contrast. So far i don't export lights, but that's next on my list.

EDIT:

Okay, lot of progress, by now the exporter is (at least on my machine :-D) in a quite workable state, as these images prove:

For these images i didn't have to start Hammer at all, everything from modelling to lighting to exporting was done purely through my script. Of course for finishing and setting up entities i'll still rely on the Valve-editor, but hey, at least some of the more tedious work is eased :-D