Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

[REL|Beta] DFF Import/Export script for Blender


Hollower

Recommended Posts

I always wondered where all them stars came from hollower and now I know where, this script must be great because everyone has said so, but I just read through the first part of the readme and I have version 2.33 with the updated script and it will not open the updated script that you said worked with this version. I just recieve an error when trying to open and I get transferred back onto the main screen. Ill have a read through sometime to get more used to this. smile.gif

 

It is something I have done wrong it must be as you have all got this working but with different versions.

 

Good work though hollower from what people have seen.

Link to post
Share on other sites
I just recieve an error when trying to open and I get transferred back onto the main screen.

 

You are probably opening from Blender's main menu. I kind of glossed over this part in my tutorial because as it says "learn Blender first" so I assumed people would figure out how to set up a split window for the text editor. I gave the link for the online Blender documentation a few posts back. The section Understanding the interface should help. The text editor's File menu is at the bottom of the text editor's panel.

 

I haven't utilized a feature of Blender where I could integrate the script into the main menu because it involves splitting the script into two, import and export, and I don't know how to keep the GUI which is kind of necessary for the various options and the feedback from the status window. So I'm going to stick with using the text editor window.

 

 

Good work though hollower from what people have seen.

Thanks. Remember, don't try to do a player model as the first thing. smile.gif Take the time to learn Blender's workflow, even if you only plan to use it as a conversion stage.

Link to post
Share on other sites

Thanks, Hollower. I forgot about the CTRL+SHIFT+P, as you had advised me before. Will check this out asap.

 

I notice in the script there are references to .col files. Is this support for colision files or just a colour variable for Blender?

 

And thanks for the ti[p about the names being corrected on export, I was wondering about that.

 

Thanks again,

 

Sonix.

Link to post
Share on other sites
I notice in the script there are references to .col files. Is this support for colision files or just a colour variable for Blender?

 

I intend to add collision file support later. There are a few placeholders in the released script, but no functionality.

 

Link to post
Share on other sites

Well after just a bit of messing around I worked out how to use the script and import a file into blender and I was tryin to add pre-lighting but I dont know how to add lights and sometimes all my controls seems to dissappeaer under the materials section ill keep trying though. smile.gif

Edited by GT-1
Link to post
Share on other sites
Well after just a bit of messing around I worked out how to use the script and import a file into blender and I was tryin to add pre-lighting but I dont know how to add lights and sometimes all my controls seems to dissappeaer under the materials section ill keep trying though. smile.gif

To add a lamp in Blender. Hold your mouse over the 3d window and press space bar. Click Add>Lamp.

 

To change settings for the lamps press the material icon to see the lamp icon and press that. To instance another lamp from an existing one, hold ALT+D. This will give you multiple lamps responding to the same set of lamp controls. Use duplicate SHIFT+D to have seperate lamp settings.

 

Your material settings will not be there if the mesh has no material applied. All you'll see is a blank area where the material buttons should be, and ADD>NEW in the top left corner of this blank area(click that to add a new material).)

 

The script imports the texture files (as long as they are unpacked from the relevant txd into the same directory as the dff file) and auto assigns materials to the mesh objects, so you shouldn't loose the buttons on those objects.

 

Hope this helps,

 

 

Sonix.

Link to post
Share on other sites
Edit (May 4th): Blender 2.33 has just been released and it breaks compatability with this script. Stick with Blender 2.32 until I release a fix.

do you have a fix or where can i get the old version of blender?

 

Link to post
Share on other sites
Edit (May 4th): Blender 2.33 has just been released and it breaks compatability with this script. Stick with Blender 2.32 until I release a fix.

do you have a fix or where can i get the old version of blender?

Im using blender 2.33 and the updated script above works for me I think anyway. There is a post above somewhere by Hollower with the changed script that should work. smile.gif

 

So there is no one way of just importing a file and then exporting this file with pre-lighting without placing the lamps all over the place, you cannot just import and then export with the lighting as im not too bothered about the shadows if not which I think is right I will just keep trying.

 

Ill catch you on MSN hollower. smile.gif

Link to post
Share on other sites

Delfi: My bad, I posted a fix but forgot to edit the first post. Done.

 

GT-1: Sorry, there needs to be real light in the scene. If you add no lights it will assign all black vertex colors which is exactly like a zmodeler export. Well, you can also paint them on but that would be even more work than prelighting.

 

Link to post
Share on other sites
and.. hollower does the script still calculate the normals on import?

custom normals do matter realy..

Small fix if it doesn't. Enter EDIT mode for the mesh you want to check the normals dierction on. Press A to select all verts, then press CTRL+N to recalculate normals to face outside the mesh.

 

If you want to see the normals when in edit mode, press the normals button on the right hand side of the Edit buttons in Blender's interface.

 

To calculate all normals to face inside the mesh, select all verts and press space bar>edit>face normals>recalc inside.

 

Hope this helps, if the script doesn't recalc them on import.

 

Sonix.

Link to post
Share on other sites

It was just a tiny bugfix of one function so other than that it is still the same as the first release. Same deal if I release any other fixes under 0.1. More significant changes will come in 0.2 (I'm trying to number them so that the eventual 1.0 release will be a stable or final version, but there's no telling when or *if* that will happen). I will try to support custom normals if it is possible.

 

Sonix:

Delfi is refering to custom normals that are skewed to be not perpendicular to the face. I don't even know how to do that in Blender or if it is possible. The reason I'm not importing them from the dff file is because when I did they were all being lost after doing any mesh editing.

 

Link to post
Share on other sites

Thanks Hollower, but I don't understand why custom normals would be needed. What are the benifits? Something to do with texturing?

 

Thought all normals were perpendicular anyway.

 

Confused Xinos. blink.gif

Link to post
Share on other sites

Well we had a problem with exporting that .dff file which would not happen a error occured so I tried another file and went through all the stages and it exported fine but I need to check it ingame now, only the pre-lighting that is. smile.gif

 

Thanks Hollower

 

EDIT it did work all I need to do is to pratise were to put the lighting moving thingy dont know what its called but its all pratice.

This was alot darker before, on this side its light on the other side its slightly darker. smile.gif Thats how its supposed to be right, well im sure it worked although it could have been better.

 

user posted image

 

EDIT AGAINI exported that all well and good and I came to the race track that blaer made also unlocked .dff file but I have a problem, I run the script as before go to import > find the file > and then I click select file and blender shuts down, straight back onto windows without saying any errors.

It was made in MAx but exported from Zmod the track that is to a .dff but this is a problem I did not have before. angry.gif

Edited by GT-1
Link to post
Share on other sites

I have been conversing with GT-1 and thanks to his feedback I have located a couple of small bugs.

 

1.

I mentioned in the tutorial that you should enable the 'msplit' button when importing a model that came from Zmodeler. What I didn't know is that if you don't enable it and then try to re-export, the script will exit with a Python error if the mesh had more than one material. I can fix but it's not urgent...just don't do it. In the future I'll probably just auto-detect Zmodeler files and get rid of the option.

 

2.

The Filename and path fields are limited to 255 characters. Apparently if you select via browsing and the resulting path goes over the maximum, Blender just gives up and exits. Bleh! Of course I can put in a simple check and truncate the field if necessary.

Link to post
Share on other sites

Will there ever be any way of gettin round the 16 materials limit for importing files into Blender, this has really started to become a problem and has become annoying but if not Ill have to live with it.

 

Thanks to my feedback, im honoroured but really it was my st00pidnes probs. biggrin.gif

Link to post
Share on other sites
Will there ever be any way of gettin round the 16 materials limit for importing files into Blender, this has really started to become a problem and has become annoying but if not Ill have to live with it.

 

I don't know. It's a hard-coded Blender limit not a script limit so I really only have a few unpleasant options.

 

1. I beg Blender developers to raise or remove the cap (I'm not advanced enough to mess with the source myself)

 

2. I make the importer split up a mesh into many smaller meshes and somehow keep them linked so they can be rejoined at export (the prospect of bugs with this scares me)

 

3. I somehow come up with a way to store "fake" materials so that even if they aren't loaded into Blender the information is still stored in memory. I don't know if this is possible but I'm looking into it.

 

It *may* be possible to do some patching with RWAnalyze. You could export a 'broken' file from Blender (if it doesn't cause the script to crash), open in RWA, export the geometry struct, open the original 'clean' file and import over the geometry struct. The material indices would be wrong, but Zmodeler makes them wrong too so maybe it could work. I haven't tested this theory yet.

 

 

Thanks to my feedback, im honoroured but really it was my st00pidnes probs. biggrin.gif

Well I didn't know about those two problems until you reported them. I need to know all the silly ways to break my script so I can plug up the holes. I figured I should post them here so others know what not to do.

Link to post
Share on other sites

I am having a problem exporting a dff. Blender was working fine, but all the models I have tried, after exporting a Fido model, crash the script. I tried using script b and c, and Blender v2.31a and 2.33a still no luck.

 

Any help is very much appreciated, as I am trying to get MarkPagliaro's patched peds fixed up for GTA:LC.

 

.:EDIT:.

Nevermind, I forgot to press msplit.

Edited by ModelingMan
Link to post
Share on other sites

Hollower, I'm still having a lot of problems with the script crashing on export.

 

I've managed to work out it's the hierachy that's causing it, but I'm unable to parent anything to anything without this happening. Creating parent without inverse crashes the script on export. Creating ordinary parent, also crashes the script on export. This is for GTAVC vehicles.

 

Please could you try a test for me, using 2.32 or 2.33 with the b or c script accordingly. Import an existing .dff file, it can be any, mod or original. Delete the chassis_hi mesh, add your own, parent this to the chassis dummy and try to export. There's usually the hierarchy list displayed in the console window, then errors in four code lines. (Will write these down if you need them.)

 

If you have no problem, then my comp system is not working properly. Do I need the latest release of python?

 

I have been making the mesh with Blender, then exporting as a DXF, converting this to LWO objects, then importing these into zmodeler into an existing dff file. This way I can set up the hierachy correctly in zmod. I then export as dff, and import into Blender with msplit.

This is the only way I can then get the script to export without crashing. Which is a pain in the butt.

 

Any chance of some help please?

 

Thanks,

 

Sonix.

Link to post
Share on other sites

Sonix:

I just followed the steps you gave on the VC Cheetah and it exported without errors. Imported cheetah.dff, deleted chassis_hi, made a cube for the new chassis tounge.gif, converted to triangles, assigned it one of the loaded materials, selected chassis_hi and chassis_dummy via SHIFT-F4, parented without inverse, selected the cheetah empty, exported as VC Vehicle. No errors.Here is a picture of the console.

 

If you give me the error messages I can locate where the script is failing and give an idea of what's going wrong on your end. Currently the script only uses built-in modules so you shouldn't even need a full Python install.

 

Link to post
Share on other sites

Ok thanks for the quick reply. The only thing I can see you're doing differently, is selecting the objects using Shift F4. I have been right clicking to select the chassis_hi mesh, then holding SHIFT and right clicking the Empty. Then doing parent without inverse.

 

The script usually writes the hierarchy list upto the crash point, which is one reason I think it's down to parenting errors on my part.

 

Will check again with the Shift F4 method to compare. I'm at work right now, so it won't be until tomorrow I can post back, unless you are able to try my method again by using just right mouse button select and shift. No worries if not, you've helped me out so much already.

 

---EDIT--- From memory, the usual lines stated, are 120, a couple of lines about 1450 and one 1600 ish I think, not much help I'm afraid, but will post full details asap. ---EDIT---

 

Thankyou very much,

 

Sonix.

Edited by sonix
Link to post
Share on other sites

Well it shouldn't make a big different how you select. I use the shift-f4 method because the chassis_dummy is underneath another empty and can't be selected in the 3d window. But order is important because the 'active' object is the one that becomes the parent. The active object is the lighter shade of pink and it's name is displayed in the lower-left corner of the 3d window.

 

Edit: the printout of the hierarchy is actually done before the exportation process starts, not during, so it doesn't indicate where the error happens. Any errors should be below the ===== line.

Edited by Hollower
Link to post
Share on other sites

Ok. I understand the selection process. I've just run some small tests (made a quick file in blender, 1 empty 1 uvsphere on a works comp. I had no file to import, but making one from scratch quickly and testing if export ok. GTAVC vehicle.)

 

Both methods worked ok on export, parent and parent without inverse. Maybe it's just when I'm working with complex hierachies.

 

Not to worry, I'll have a go today with a few different methods and also post back with error messages.

 

Huge thanks again,

 

 

Sonix.

Link to post
Share on other sites

very very cool script. i'm just a novice on blender that was a bit hard to get an understand on. but after that it was pretty easy.

i've only done small changes on the reg. models just getting to know the program more. and so far so good.

thank you.

Link to post
Share on other sites
  • 3 weeks later...

rah.gifrah.gifrah.gif

 

Rokkn plugin hollower.

 

I've been able to parent the skeleton to tommy, and he animates well in game... I've even had success assigning vertexs to the relevant groups such that they texture predictably - so THANKYOU!!! I look forward to more bone modelling advances... which leads to my question

 

I find when importing tommy into game his chin/jaw twists on an alarming angle when turning his head... the game engine masks a good view of it in most camera angles, but it is possible to see properly in 1st person view when on a bike, if you hold the "driveby shoot" keys while reversing the bike.

 

I know this may seem pedantic, but it is quite notticable that the face is wobbling on the spawn screen as it moves - I understand that choose from closest bones wont get the exact vertices, but even when I manually group/assign them I seem to get the same results?!

 

Is it just me??

 

Thats ma main quiz!

 

thanks at any rate

 

[DRuG]NikT

Link to post
Share on other sites

Hi Hollower, I've been haviing problems with UVs on export. I've re-read your tutorial, but it doesn't mention anything about detaching faces that share materials.

 

If I have a cube for eg, if I UV map the top face use cube8bitbody64.bmp, and the front face use enginetop8bit64.bmp and the bottom face use cubebody128.bmp. I know i have to assign the relevant verticies the corresponding material as well, but if I then try to export this the uv mapping is all messed up.

 

So at the suggestion of Suction T Man I tried to detach the faces that had verts sharing materials, using Y key to split faces. Alas after this, the model won't export using your script. The same error message I had before returns over the same four lines of code as before.

 

I ask only because this multiple texture per vertex issue is not mentioned in your tutorial.

 

Any help you might be able to give would be greatly appreciated.

 

Link to problem.

 

Blender and in game screen shots, please click here.

 

Thanks,

 

Sonix.

Link to post
Share on other sites

sonix:

I have been aware of this bug for a while but I don't yet have a fix in place. The script converts UVs from per-face (Blender) to per-vertex (GTA) by simply taking the first occurance of a vertex and ignoring when it comes to the same vertex on another face. Evidently that method is flawed. I have since learned that Blender's "sticky" UVs are what I'm supposed to use. Right now I don't think simply making them sticky in Blender will work since the script still reads from the face, but maybe this info will help you figure something out since you probably know more Blender tricks than I do. One workaround I found that worked on some models (but made others worse) is to select all verts and press the 'Xsort' button. Give it a try...save a backup first obviously.

 

[DRuG]NikT:

There are a lot of possible reasons for that. The skeleton may not be lined up with model. Some vertices may have been unintentionally assigned to more than one group. Or, if intentionally assigned, the weights may not be blended properly. Blending overlapping bone influences is probably the hardest part to get right.

Link to post
Share on other sites

Thanks Hollower - turns out, indeed it was the vertex/group assignment - once I got them all neatly assigned to the right groups, it all came together.

 

I am able to tweak and then re-export to test pretty reliably too, so you absolutely 0wn!!

 

(I highly recommend vcmp/vcmm for this activity, and a bat file to copy the models about while you're building)

 

Next I gotta brush up on my mesh & texturing skillz, but in the meantime, since this thread looks to be aching for proof-of-produkt... cop this bag 'o beta's (special thanks to an, as yet, un-named modeller who did the head, which can be found on 3Dcafe in the free models areas).

 

user posted image user posted image

-CLICK TO SEE FULL SIZE- -CLICK TO SEE FULL SIZE-

 

Download DRuG-Alien.vcm

Download DRuG-Alien-Racer.vcm

Don't left click the above download links, right click and select "save as"

 

I have packaged the alien pictured above as a VCM to replace robber and racer separately. The shoes still need some work, and so does the texture, but at least the face doesn't twist up now when he turns his head.

 

You'll need to get Vice City Mod Manager to install it, you'll find it very good for adding/removing mods quik n easy at any rate.

 

[DRuG]NikT

http://drug.now.nu/

Edited by [DRuG]NikT
Link to post
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.