Jump to content

DFF Exporter (3ds Max plugin)


seggaeman

Recommended Posts

Here's a DFF exporter I wrote myself. Supports GTA III, GTA VC and GTA SA models (PC only). The binaries were developed with the 3ds max C++ SDK and can be accessed through File > Export.

 

DOWNLOAD LINK

 

(This is temporary. Files haven't yet been approved on gtagarage whatsthat.gif Updated on 13 May 2012 to fix light export problem pointed out by blaster_nl).

 

Sample screenshot:

 

user posted image

 

(The vehicle in the screenshot has already been released & is available at gtainside. )

 

This tool doesn't offer major breakthroughs. Kam's scripts and Zmodeler2 have been around for a while and most of the stuff they can't do has since been made possible through tools like DexX's SAGFX, Deniska's Maxscripts or Steve M's CollEditor 2. Well MOST but not everything.

 

So here's some of the new stuff you can do with this tool:

(a) Export non-zero vertex alpha. Applies for both normal and night vertex colors.

(b) Store face data as Tristrip. Two algorithms supplied.

© No need to waste time manually detaching smooth groups to ensure that hard edges aren't lost in the model. The tool does all the dirty work while leaving the original objects in your scene intact. You can also leave the modifier stack uncollapsed.

(d) Possible to export more than 1 hierarchy at the same time (in case you want to generate a multiclump file).

(e) All four car colors.

 

And there's support for both UV maps, UV anim export, lights and night vertex colors. Nothing new there but could be handy to have everything in the same interface. In general, I hope this is a more robust tool that gives fewer buggy models.

 

See the readme for more information.

 

Credit is due to guys who evaluated this tool and also those who uncovered the file format (didn't do any investigation myself). Thanks to fastman92, DexX, The Hero, RESpawn, Kam, Deniska, Steve-M and everybody else who contributed to format information on gtamodding.com

Edited by seggaeman
Link to comment
Share on other sites

Chris_lolwut

the smoothing group feature really is a blessing from above for a lot of people biggrin.gif

Link to comment
Share on other sites

Yep I sure used to find that pretty annoying smile.gif . Btw let's say you got a model where some of the faces have been assigned smooth groups 1 and 2, and the rest have been assigned group 1 only. In the viewport it will look like a single smooth group but the tool will see 2 separate ones !

 

Let me know if this kind of behaviour poses problems.

Link to comment
Share on other sites

XEPOMAHT007

added support for a export bump mapping effect in dff gta3?

 

user posted image

  • Like 2
Link to comment
Share on other sites

No bump map support right now. Actually I don't know much about this feature. Send me a sample GTA III model using bump map and I'll investigate.

 

UPDATE:

 

Improved the smooth group splitting feature. Now faces with smoothing bits in common are treated as belonging to the same smoothing group.

That's exactly how it is in the 3ds max viewports.

 

Also clearing all smoothing bits for a set of faces gives a tesselated appearance in the exported model. (what you see is what you get).

Link to comment
Share on other sites

XEPOMAHT007
No bump map support right now. Actually I don't know much about this feature. Send me a sample GTA III model using bump map and I'll investigate.

 

Number section = 288. Used in material on some generic objects in GTA3.

 

user posted image

 

I do not know that until now did not support it in KAM scripts or ZModeler.

Link to comment
Share on other sites

 

No bump map support right now. Actually I don't know much about this feature. Send me a sample GTA III model using bump map and I'll investigate.

 

Number section = 288. Used in material on some generic objects in GTA3.

 

user posted image

 

I do not know that until now did not support it in KAM scripts or ZModeler.

What models in gta3 use it?

 

I can provide some samples for rwg 3.6/7, but i seem to recall there being slight differences between versions. A bump mapped material exported in rw 3.6 wouldn't load properly in rw 3.4 (VC), something to do with the length of the texture name string.

 

I'll have to install a newer version of max than 2008 to test it, but if it does everything you claim, that's awesome. Especially the smoothing groups icon14.gif

 

 

- Version specific ambient, diffuse and specular figures apply to GTA III and GTA VC (RW 3.3.0.2). These values aren't used in GTA VC (3.4.0.3) and GTA San Andreas.

Renderware spec isn't used in SA, but i know ambient and diffuse are. Both values are blended with the material color when RwD3D9SetMaterial is called, mostly noticeable on vehicles or other dynamically lit objects. They likely work in GTA3/VC as well. And in gta3, the specular part of the material is used as the "reflection multiplier" for the reflective material on the default vehicles.

Link to comment
Share on other sites

Nice , best new feature is that with the smooth groups , what about player ?

Link to comment
Share on other sites

Thanks DexX and XEPOMAHT007 for your info on those bump maps. smile.gif

 

@DexX: Alright I'll try to investigate those sample files if you find them (I don't have GTA III unfortunately). Btw that ambient, diffuse and specular data

I mentioned occurs in the geometry struct. (hope your cough isn't too bad. tounge.gif )

 

See here.

http://www.gtamodding.com/index.php?title=...28RW_Section%29

("For all versions below 3.4 also some lighting color values are stored").

 

Material specific ambient, diffuse and specular figures can be set in the material editor. Yeah could be the specular is not used in SA (even if it occurs in the file)

but I never tried to verify this.

 

@KingShady. Nope no ped support yet. : / Not finding time to add it right now.

Link to comment
Share on other sites

A little overdue, but at least it's nice to know that there's a plugin-based IO tool for DFFs. Does this have full vehicle support, too?

76561198000404928.png

Link to comment
Share on other sites

I'd say not full because stuff like coronastar has not been implemented. But there certainly is comprehensive support for the rest. That is as far as vehicles go, I don't think there is something Kam's scripts

or Zmodeler2 can do and which this tool can't.

Link to comment
Share on other sites

razor1995

I use 3dsmax 2011.use your Script.But Import file Type no have grand theft auto *.dff.I want know?

 

 

Link to comment
Share on other sites

About the bump, you could look at my source code (see sig), which should be about correct. I used the rw 3.7 exporter to generate some files with mat fx and also looked at the files in gta that have mat fx, perhaps this helps you.

Link to comment
Share on other sites

razor1995
About the bump, you could look at my source code (see sig), which should be about correct. I used the rw 3.7 exporter to generate some files with mat fx and also looked at the files in gta that have mat fx, perhaps this helps you.

Thank. tounge.gif

Link to comment
Share on other sites

seggaeman

@blaster_nl

 

Thanks for informing about those black lights yes there's certainly a problem there. monocle.gif

 

This is how I've interpreted the light information:

 

 

{

float attenuation;

float RGBcolor[3];

float FallSize;

short unknown; //always 3

short lightType; //0x80 if omnilight, 0x81 otherwise

};

 

FallSize seems to be the culprit. Kam forces this value to 0 (it is zero in several R* files). So I guess I'll do the same.

 

@The Hero: Great job figuring out the bump maps smile.gif . I'll check your source for info on that (as well as on lights).

 

 

Link to comment
Share on other sites

  • 4 weeks later...

Some sample files for material effects, and a tool to generate them;

 

http://www.gtagarage.com/mods/show.php?id=20834

 

The renderware exporter won't work with the newer versions of 3ds max that i have installed, hence the hack-job tool tounge.gif

 

Seggae, am i missing it, or did you not code an export "Scale" option? It would be handy instead of manually scaling each object in a hierarchy, resetting the xform an re-linking to the bone/dummy/helper objects, etc.

 

 

Btw that ambient, diffuse and specular data

I mentioned occurs in the geometry struct. (hope your cough isn't too bad. tounge.gif )

Ahh yes. I haven't looked at pre-3.6 models in a loooooooooooooooooooong time tounge.gif

Link to comment
Share on other sites

DexX thanks for the material effects tool I'll have a look at it once your site hoster is up and running again. smile.gif

 

Nope there is no scale option right now. I can add it in the next release of the tool (which will also add ped and mass file export through Maxscript).

But actually it does take node and object offset transform into account. So if you scale geometry up/down and don't reset XForm you don't need to worry about it being a different size in the file.

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

Alright I will. It would have been done much earlier if the process was straightforward (it isn't because 3ds max 2013 has made the transition to unicode). I'll supply source code in the next release.

Link to comment
Share on other sites

Any ETA on the ped import/export support? I'd like to do peds on your plugin as Kam's seems buggy at times. In some cases I had to resort to some rather unorthodox workarounds like exporting the model first as an Unreal Engine PSK, and reimporting it using Gildor's script - I had to do that with my Felicity Merriman ped when I found out that one of her hands were effed up ingame.

76561198000404928.png

Link to comment
Share on other sites

  • 1 month later...

 

@Lpgunit: This has been very long but you will be glad to hear that ped import and export is working. The project has also been open sourced. Code and binaries are available here.

 

http://dffplugin.codeplex.com

That's nice. I hope this won't end up with the same glitches that I get when exporting certain peds to SA.

 

EDIT: Hmm, from what it seems the model I tested mucked up a bit, as it was slightly turned on export.

Edited by lpgunit
76561198000404928.png

Link to comment
Share on other sites

Ok didn't quite understand that bit. The tool turned the model or you did?

The tool did. The exported model was turned slightly on the x-axis in my case, even if I just imported and re-exported it without any changes done.

76561198000404928.png

Link to comment
Share on other sites

I'll look into it. Send me a link to the model in question.

It did seem to happen with a custom ped I rigged before, but not on vanilla models:

 

http://www57.zippyshare.com/v/95117174/file.html

 

The hmydrug.dff and test.dff are from the vanilla game, with test as the hmydrug model I re-exported using the tool. When I did the same thing to my model (hfyst.dff), the resultant model named wat.dff ended up being slightly tilted.

76561198000404928.png

Link to comment
Share on other sites

  • 2 years later...

Hi seggaeman!, this post is dead since a while ago. Sorry for the bump.

 

i want to ask you if you can compile a 3DS MAX 2014 version of this tool, i'm really interested on it. Greetings and thanks in advance!

Link to comment
Share on other sites

Hi reix2x. Ok I will try doing it. Can't really say when I will finish though because I haven't been working on this tool for some time. Hopefully there won't be too many big changes when compiling for 3ds max 2014.

Link to comment
Share on other sites

It sounds excellent to me, if you could do it i will be very grateful, i have being trying many dff export tools but till now your toolset looks live the best out there (i have tried even the 2013 version of your tool located at codeplex).

 

huge greetings from Venezuela!

Edited by reix2x
Link to comment
Share on other sites

  • 2 months later...

I saw that the post has been bumped by Reix2x with his request, now that someone actually bumped this and you put your time in to reply. For the love of programmers, any chance you could also convert it to 3ds max 2016 too? I've made quite a lot of models and I really can't be arshed to port them all to 2014 nor to a lower version.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.