[REL|Beta] DFF Import/Export script for Blender
Posted 10 May 2004 - 03:47 PM
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.
Posted 10 May 2004 - 06:50 PM
|QUOTE (GT-1 @ May 10 2004, 09:47)|
| 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. Take the time to learn Blender's workflow, even if you only plan to use it as a conversion stage.
Posted 11 May 2004 - 03:51 AM
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.
Posted 11 May 2004 - 04:10 AM
|QUOTE (sonix @ May 10 2004, 21:51)|
| 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.
Posted 11 May 2004 - 03:33 PM Edited by GT-1, 11 May 2004 - 06:36 PM.
Posted 12 May 2004 - 12:45 AM
|QUOTE (GT-1 @ May 11 2004, 15:33)|
|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.|
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,
Posted 12 May 2004 - 02:44 PM
|QUOTE (Hollower @ Mar 5 2004, 21:20)|
|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?
Posted 12 May 2004 - 07:08 PM
|QUOTE (Delfi @ May 12 2004, 14:44)|
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.
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.
Posted 12 May 2004 - 08:24 PM
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.
Posted 12 May 2004 - 08:36 PM
custom normals do matter realy..
Posted 13 May 2004 - 12:38 AM
|QUOTE (Delfi @ May 12 2004, 20:36)|
| 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.
Posted 13 May 2004 - 01:23 AM
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.
Posted 13 May 2004 - 11:25 PM
Thought all normals were perpendicular anyway.
Posted 15 May 2004 - 03:30 PM Edited by GT-1, 16 May 2004 - 09:44 AM.
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. Thats how its supposed to be right, well im sure it worked although it could have been better.
EDIT AGAIN I 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.
Posted 16 May 2004 - 07:44 PM
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.
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.
Posted 20 May 2004 - 02:41 PM
Thanks to my feedback, im honoroured but really it was my st00pidnes probs.
Posted 20 May 2004 - 09:55 PM
|QUOTE (GT-1 @ May 20 2004, 08:41)|
| 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.|
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.
Posted 20 May 2004 - 11:25 PM Edited by ModelingMan, 20 May 2004 - 11:27 PM.
Any help is very much appreciated, as I am trying to get MarkPagliaro's patched peds fixed up for GTA:LC.
Nevermind, I forgot to press msplit.
Posted 01 June 2004 - 02:01 AM
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?
Posted 01 June 2004 - 03:51 AM
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 , 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.
Posted 01 June 2004 - 04:01 AM Edited by sonix, 01 June 2004 - 04:10 AM.
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,
Posted 01 June 2004 - 04:11 AM Edited by Hollower, 01 June 2004 - 04:14 AM.
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.
Posted 01 June 2004 - 04:20 AM
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,
Posted 01 June 2004 - 05:57 AM
i've only done small changes on the reg. models just getting to know the program more. and so far so good.
Posted 18 June 2004 - 07:13 PM
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
Posted 21 June 2004 - 03:18 AM
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.
Posted 21 June 2004 - 03:48 AM
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.
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.
Posted 28 June 2004 - 10:09 AM Edited by [DRuG]NikT, 23 June 2005 - 10:57 AM.
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).
-CLICK TO SEE FULL SIZE- -CLICK TO SEE FULL SIZE-
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.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users