|
 |
|
|
|
|
|
GTA Modification Forums
[REL] Blender DFF IO For III/VC/SA
 |
|
 |
| |
maxorator  |
Posted: Saturday, Aug 25 2012, 19:09
|
VC:MP lead developer

Group: Members
Joined: Feb 24, 2006



|
Blender import/export script for GTA III/VC/SA .dff filesv0.9.0 by maxoratorTested on Blender 2.63 with bundled Python 3.2. To install this script, go to "File->User Preferences->Install Addon" and select the .py file. Exporting and importing .dff files will now appear under Import and Export menus. Limitations: * Does not support editing ped model skin/bone data. * Collisions loaded from .dff files are retained until export, but the data for that cannot be imported from .col files separately. * Uses triangle list instead of triangle strips in mesh plugin data (should not affect gameplay, but increases file size). For textures to be loaded automatically, you have to create a directory named "dff_file_name.dff_tex" in the same folder of the DFF file you are loading and it must contain all textures in files named "texture_name.png". For example if you are importing "infernus.dff" file, then you have to create an "infernus.dff_tex" folder and export all the textures that model uses as PNG files into that folder. For exporting, the objects you want to export have to be selected. Child objects are exported automatically, they don't need to be selected. The importer automatically hides _dam and _vlo atomics after loading them, pressing Alt+H will reveal them.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Caencel  |
Posted: Wednesday, Sep 5 2012, 18:18
|
Bugpills

Group: Members
Joined: Sep 5, 2012


|
hey, pretty good to see a Blender plugin being maintained, going to test it today since Blender is more comfortable for me, are you going to keep working on it? also a little more extensive documentation of how exactly the data is interpreted could be of use, for example hierarchies, dummies(empties?), textures UV, vertex color, materials (secular lighting, reflections, transparency, opacity) if the meshes need transformation applied to them before exporting, main color, secondary color, plain material etc, also if this successfully can export a vehicle and stuff, i now pretty much of these questions are going to be answered as soon as i start testing, and i would be happy to help, any plugin for Blender is worth some attention -can't make it work, i'm using Windows XP sp3 and Blender 2.63a installed (installation not zipped package), every time i export or import a dff i got various errors, tried with a character, a vehicle and an average object, this is the output from a cathedral model from the game, the dffs tested weren't read-only This post has been edited by Caencel on Friday, Sep 7 2012, 22:09
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
maxorator  |
|
VC:MP lead developer

Group: Members
Joined: Feb 24, 2006



|
| QUOTE (Caencel @ Wednesday, Sep 5 2012, 21:18) | hey, pretty good to see a Blender plugin being maintained, going to test it today since Blender is more comfortable for me, are you going to keep working on it? also a little more extensive documentation of how exactly the data is interpreted could be of use, for example hierarchies, dummies(empties?), textures UV, vertex color, materials (secular lighting, reflections, transparency, opacity) if the meshes need transformation applied to them before exporting, main color, secondary color, plain material etc, also if this successfully can export a vehicle and stuff, i now pretty much of these questions are going to be answered as soon as i start testing, and i would be happy to help, any plugin for Blender is worth some attention
-can't make it work, i'm using Windows XP sp3 and Blender 2.63a installed (installation not zipped package), every time i export or import a dff i got various errors, tried with a character, a vehicle and an average object, this is the output from a cathedral model from the game, the dffs tested weren't read-only
|
If it's a III model, then you should retest with the 0.9.1 version I just uploaded (I hadn't really tested on III models when I uploaded the first version, so there was a slight problem with reading headers of old RW versions.) Otherwise, can you send me a .dff you are getting these errors on? I'd like to take a look at it and see what might be causing this. To answer some of your questions - this plugin should export any imported III/VC/SA vehicle and ped into a nearly identical file. The only difference should be the order of geometries, atomics and frames in the exported .dff file, which shouldn't affect gameplay. It supports environment map textures, specular textures and therefore also having two UV maps (first for normal texture, second for specular and environment map texture). To see how exactly you should set up these textures, you could just import a SA vehicle and see how the importer lays it out. Some basics: Hierarchies are preserved on importing and exporting. Dummies are empties - empties are exported into frames that have no atomics (geometry) attached to them. The script automatically splits quads into triangles. It also splits the mesh into groups based on the UV map - so that if a vertex is on N different UV map groups, then it will be duplicated into N different vertices in the final .dff file. Material specular texture settings' "specular level" (from GTAModding descriptions) corresponds to the texture's specular colour intensity in Blender's texture settings. That's also how the export script tells the difference between specular and diffuse textures. Environment map's intensity is also specified by the envmap texture's "specular level" setting in Blender. Material reflection in RW file corresponds to material "mirror" settings in Blender - RW's reflection intensity is Blender's reflectivity and reflection colour is, not surprisingly, the colour you can specify under mirror settings. Alpha channel in material colour is basically Blender's alpha setting under "Transparency" in material settings. I don't really understand what you mean by vertex colour though. And what exactly do you mean by main and secondary colours? One note - importing/exporting lights does not work. This post has been edited by maxorator on Sunday, Sep 9 2012, 19:36
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Caencel  |
|
Bugpills

Group: Members
Joined: Sep 5, 2012


|
so far everything has been good, maybe i'll write a little tutorial or some notes i'm myself finding useful, right now i'm working with Blender and modifying the "Pony" van and here are some thoughts: - Is pretty good that the imported model has the damaged parts hidden but i'm wondering if would be better if dummies, main parts and damaged parts be divided by layers, that would make things easier to handle - Something i noticed is that some textures are not loaded at all, the material and the uv information is there but the paths to the images or the images used at all aren't there, not really a big problem at all - I never been really paranoid about DFF security but i'm wondering if it's possible to lock them at exporting or if locked DFF are possible to import, at some point this matters because ... uh.. let's say a "mod expert" would just import other's people mods, move some stuff here and there and export as it's own. - Finally one of the advantage of working with 3D Studio over Blender is the material library, Blender can use materials from other .blend files but come on, who doesn't like a handy panel with a list of customized materials for personal use? I just found a plugin that does the trick really good https://sites.google.com/site/aleonserra/ho...ripts/matlib-vx i don't know if you can mention it in your main post Maxorator, it works pretty good with current Blender release but as with everything is important to read the instructions and information. screenie:
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Michael-Knight1  |
|
Never Give UP

Group: Members
Joined: Jul 8, 2012


|
| QUOTE (Caencel @ Sunday, Sep 16 2012, 17:28) | so far everything has been good, maybe i'll write a little tutorial or some notes i'm myself finding useful, right now i'm working with Blender and modifying the "Pony" van and here are some thoughts:
- Is pretty good that the imported model has the damaged parts hidden but i'm wondering if would be better if dummies, main parts and damaged parts be divided by layers, that would make things easier to handle
- Something i noticed is that some textures are not loaded at all, the material and the uv information is there but the paths to the images or the images used at all aren't there, not really a big problem at all
- I never been really paranoid about DFF security but i'm wondering if it's possible to lock them at exporting or if locked DFF are possible to import, at some point this matters because ... uh.. let's say a "mod expert" would just import other's people mods, move some stuff here and there and export as it's own.
- Finally one of the advantage of working with 3D Studio over Blender is the material library, Blender can use materials from other .blend files but come on, who doesn't like a handy panel with a list of customized materials for personal use? I just found a plugin that does the trick really good https://sites.google.com/site/aleonserra/ho...ripts/matlib-vx i don't know if you can mention it in your main post Maxorator, it works pretty good with current Blender release but as with everything is important to read the instructions and information. screenie:
| we need great tutorial for low poly characters , etc ....
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
maxorator  |
|
VC:MP lead developer

Group: Members
Joined: Feb 24, 2006



|
| QUOTE (Caencel @ Sep 16 2012, 17:28) | | - Is pretty good that the imported model has the damaged parts hidden but i'm wondering if would be better if dummies, main parts and damaged parts be divided by layers, that would make things easier to handle |
Didn't really know you could group objects like that in Blender. I might look into it. | QUOTE (Caencel @ Sep 16 2012, 17:28) | | - Something i noticed is that some textures are not loaded at all, the material and the uv information is there but the paths to the images or the images used at all aren't there, not really a big problem at all |
Are you sure you have all the textures in the _tex folder? Like for SA vehicles you also have to put the generic textures there. | QUOTE (Caencel @ Sep 16 2012, 17:28) | | - I never been really paranoid about DFF security but i'm wondering if it's possible to lock them at exporting or if locked DFF are possible to import, at some point this matters because ... uh.. let's say a "mod expert" would just import other's people mods, move some stuff here and there and export as it's own. |
I don't do DRM. | QUOTE (Caencel @ Sep 16 2012, 17:28) | | - Finally one of the advantage of working with 3D Studio over Blender is the material library, Blender can use materials from other .blend files but come on, who doesn't like a handy panel with a list of customized materials for personal use? I just found a plugin that does the trick really good https://sites.google.com/site/aleonserra/ho...ripts/matlib-vx i don't know if you can mention it in your main post Maxorator, it works pretty good with current Blender release but as with everything is important to read the instructions and information. screenie: |
How would it work with .dff files though? Is it possible to export the customized materials as image textures?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Caencel  |
Posted: Tuesday, Sep 18 2012, 02:18
|
Bugpills

Group: Members
Joined: Sep 5, 2012


|
| QUOTE | | Didn't really know you could group objects like that in Blender. I might look into it. |
see at near the end of the reply (*) | QUOTE | | Are you sure you have all the textures in the _tex folder? Like for SA vehicles you also have to put the generic textures there. |
Is not a big deal anyway because Blender itself can use a specific path for textures and setting the material manually is something i recommend to do in order to understand it's structure and customize the materials and textures according to own interests, never the less i'll give it a try since in some cases it might be necessary not quite sure what's that but it was something i thought it would matter. | QUOTE | | How would it work with .dff files though? Is it possible to export the customized materials as image textures? |
this plugin is basically a library that can store any sort of material you desire, i'm starting to do it with materials from SA vehicles so it doesn't really have anything to do with dff files and i don't think i understand well what you mean with export customized materials as image textures Now so far the materials used work well, i would say no mayor problems should exist if everything is setup properly in Blender, which is not that hard since you can use as templates the materials imported from the Dff: (sorry for the broken look of the vehicle, is not ready for use in game and lacks collision which i'm planing to add via Collision Editor II, is just for testing the export procedure)  -  - As you can see is very promising since the first in-game test was successful with no single error. * Now the details, i thought it would be a good idea to have everything in different layers but turns out that the exporting process only works for the current layer or last layer selected (this if you try to select all of them) so project-wise is better to keep everything as it is now. Also i found myself with a rare bug, at first i had the idea that the exporting process would add the extension .dff to the file automatically but it didn't nevertheless i did it manually and the file worked fine, the problem came when i exported the file including the extension in the file's name, an error came out but the file was created anyway  However trying once again exporting without extension immediately doesn't produce any error and indeed i prefered this file over the "erroed" .dff which btw i didn't test This post has been edited by Caencel on Tuesday, Sep 18 2012, 02:22
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Caencel  |
|
Bugpills

Group: Members
Joined: Sep 5, 2012


|
| QUOTE (maxorator @ Saturday, Oct 27 2012, 19:15) | | QUOTE (Caencel @ Sunday, Oct 28 2012, 03:05) | just a quick problem here man, i made a wheel pack for Vice City but Blender is exporting it without textures
http://www.mediafire.com/?y8313x4z3nt4611
these are the wheels exported and textures |
When I export this, I get an identical .dff. Is this one already the one exported by the script? |
yup it is the one already exported, at first sight these might look like the original wheels but that's because i used the original textures as placeholders so i can work original textures later, also i know all textures are there because i used another plugin for Blender from some japanese site (scroll down a bit, the plugin's name is in english) that i'm not using at all due to the lack of understandable documentation, also i think it's only for SA as some GTA III and VC can't be imported, but returning to the main topic, that plugin exported everything with textures. Blender Source file This post has been edited by Caencel on Sunday, Oct 28 2012, 05:04
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
maxorator  |
|
VC:MP lead developer

Group: Members
Joined: Feb 24, 2006



|
| QUOTE (Caencel @ Sunday, Oct 28 2012, 08:00) | | QUOTE (maxorator @ Saturday, Oct 27 2012, 19:15) | | QUOTE (Caencel @ Sunday, Oct 28 2012, 03:05) | just a quick problem here man, i made a wheel pack for Vice City but Blender is exporting it without textures
http://www.mediafire.com/?y8313x4z3nt4611
these are the wheels exported and textures |
When I export this, I get an identical .dff. Is this one already the one exported by the script? |
yup it is the one already exported, at first sight these might look like the original wheels but that's because i used the original textures as placeholders so i can work original textures later, also i know all textures are there because i used another plugin for Blender from some japanese site (scroll down a bit, the plugin's name is in english) that i'm not using at all due to the lack of understandable documentation, also i think it's only for SA as some GTA III and VC can't be imported, but returning to the main topic, that plugin exported everything with textures.
Blender Source file | I'll have to test this. The structure of the wheels.dff file looks okay, seems to contain texture names. Not sure yet why it doesn't load textures in-game.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Pages:
(2) [1] 2
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|