Quantcast

Jump to content

» «
Photo

DFF Exporter (3ds Max plugin)

26 replies to this topic
seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#1

Posted 21 April 2012 - 03:03 PM Edited by seggaeman, 13 May 2012 - 06:26 PM.

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

Chris_lolwut
  • Chris_lolwut

    RIMSRIMSGUNSGUNS

  • Members
  • Joined: 05 Jul 2008

#2

Posted 21 April 2012 - 03:07 PM

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

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#3

Posted 21 April 2012 - 03:17 PM

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.

XEPOMAHT007
  • XEPOMAHT007

    ______________________

  • Members
  • Joined: 18 Nov 2009
  • Russia

#4

Posted 22 April 2012 - 09:58 AM

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

user posted image

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#5

Posted 22 April 2012 - 02:24 PM

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).

XEPOMAHT007
  • XEPOMAHT007

    ______________________

  • Members
  • Joined: 18 Nov 2009
  • Russia

#6

Posted 22 April 2012 - 03:59 PM

QUOTE (seggaeman @ Sunday, Apr 22 2012, 14:24)
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.

DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#7

Posted 27 April 2012 - 03:14 PM

QUOTE (XEPOMAHT007 @ Sunday, Apr 22 2012, 07:59)
QUOTE (seggaeman @ Sunday, Apr 22 2012, 14:24)
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

QUOTE
- 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.

King Shady
  • King Shady

    Group:G-Modding Group:Bulletproof

  • Members
  • Joined: 10 Oct 2010
  • None

#8

Posted 27 April 2012 - 06:20 PM

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

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#9

Posted 27 April 2012 - 06:52 PM

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.gtamoddin.....28RW_Section)
("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.

lpgunit
  • lpgunit

    It's L, as in Lpgunit, not I.

  • Feroci Racing
  • Joined: 24 May 2008
  • Philippines

#10

Posted 28 April 2012 - 12:19 PM

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?

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#11

Posted 28 April 2012 - 08:47 PM

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.

MajesticNL
  • MajesticNL

    Chris

  • Feroci Racing
  • Joined: 16 Oct 2005
  • Netherlands

#12

Posted 29 April 2012 - 12:43 PM Edited by Blaster_nl, 29 April 2012 - 12:52 PM.

Useful scripts, for the ones interested:

Batch loader - 'Mass DFF importer'
http://www.scriptspo...ts/batch-loader

Batch exporter - 'Mass DFF exporter'
http://www.scriptspo...-batch-exporter


@seggaeman, How accurate are the omni import settings for map objects? Each omni has the following settings: multiplier: 1,0, FAE: 200,0
Also the colors look odd, i've seen many black lights on buildings from SFe.

razor1995
  • razor1995

    Player Hater

  • Members
  • Joined: 02 May 2012

#13

Posted 03 May 2012 - 03:14 PM

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


THE HERO
  • THE HERO

    /* no comment */

  • Members
  • Joined: 25 Jan 2005

#14

Posted 03 May 2012 - 05:21 PM

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.

razor1995
  • razor1995

    Player Hater

  • Members
  • Joined: 02 May 2012

#15

Posted 04 May 2012 - 02:50 AM

QUOTE (THE HERO @ Thursday, May 3 2012, 17:21)
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

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#16

Posted 04 May 2012 - 03:13 PM

@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).


DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#17

Posted 30 May 2012 - 12:40 AM

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

http://www.gtagarage...ow.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.

QUOTE
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

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#18

Posted 02 June 2012 - 04:29 PM

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.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#19

Posted 14 September 2012 - 04:34 PM

Hi, could you update this for 3ds max 2013?
Also, are you planning to open source it?

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#20

Posted 23 September 2012 - 05:33 PM

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.

lpgunit
  • lpgunit

    It's L, as in Lpgunit, not I.

  • Feroci Racing
  • Joined: 24 May 2008
  • Philippines

#21

Posted 24 September 2012 - 02:20 AM

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.

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#22

Posted 10 November 2012 - 10:09 AM

@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

lpgunit
  • lpgunit

    It's L, as in Lpgunit, not I.

  • Feroci Racing
  • Joined: 24 May 2008
  • Philippines

#23

Posted 11 November 2012 - 01:42 AM Edited by lpgunit, 11 November 2012 - 02:20 AM.

QUOTE (seggaeman @ Saturday, Nov 10 2012, 10:09)
@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.

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#24

Posted 11 November 2012 - 01:42 PM

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

lpgunit
  • lpgunit

    It's L, as in Lpgunit, not I.

  • Feroci Racing
  • Joined: 24 May 2008
  • Philippines

#25

Posted 12 November 2012 - 03:30 AM

QUOTE (seggaeman @ Sunday, Nov 11 2012, 13:42)
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.

seggaeman
  • seggaeman

    Ace

  • Members
  • Joined: 29 Mar 2010

#26

Posted 12 November 2012 - 12:33 PM

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

lpgunit
  • lpgunit

    It's L, as in Lpgunit, not I.

  • Feroci Racing
  • Joined: 24 May 2008
  • Philippines

#27

Posted 12 November 2012 - 12:52 PM

QUOTE (seggaeman @ Monday, Nov 12 2012, 12:33)
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.zippysh...17174/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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users