project-navigation
Personal tools

Author Topic: 3D models questions...  (Read 12940 times)

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
3D models questions...
« on: November 04, 2012, 05:48:47 pm »
Some questions about 3d modelling...


First, I've just built a ship with Radiant and I would like to export it as an .md2, is that possible?

Second, I am experimenting with Blender. Is there any way to import the animations and models in the /base dir in Blender? I would like to modify them or to use them as a guideline for building something.

Third, is this http://ufoai.org/wiki/index.php/Blender
up to date? I've tried downloading the md2_export.py and md2_import.py in the scripts dir of Blender2.63, but nothing is happening...

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: 3D models questions...
« Reply #1 on: November 04, 2012, 06:42:34 pm »
First, I've just built a ship with Radiant and I would like to export it as an .md2, is that possible?
No.

Second, I am experimenting with Blender. Is there any way to import the animations and models in the /base dir in Blender? I would like to modify them or to use them as a guideline for building something.

Third, is this http://ufoai.org/wiki/index.php/Blender
up to date? I've tried downloading the md2_export.py and md2_import.py in the scripts dir of Blender2.63, but nothing is happening...
You might try an earlier version of Blender or search for another importer. I don't use it so can't advise you, but I know in the past people have used it without any problems.

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: 3D models questions...
« Reply #2 on: November 04, 2012, 06:53:21 pm »
No.
You might try an earlier version of Blender or search for another importer. I don't use it so can't advise you, but I know in the past people have used it without any problems.

1) Writing a .bsp to .md2 converter is possible, but it will be of little use; therefore no one attempted it (to my knowledge).
2) Blender team made some massive changes in Python interface lately, especially in handling meshes, so most old scripts do not work anymore.

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: 3D models questions...
« Reply #3 on: November 04, 2012, 07:46:54 pm »
Thanks for the replies. I've found a "export selected brushes into .obj" option in Radiant, but Blender cannot open the selected .obj files, it comes out as blank. Too bad.

Is there any other 3d program that has already been proven as compatible? Everyone is talking about Blender, but when I ask about exporting the resulting file to .md2 nobody ever answers

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: 3D models questions...
« Reply #4 on: November 04, 2012, 09:17:21 pm »
I think most are using  3DSMax for exporting to md2 (regardless of what people use to actually model).
As for blender, as Sandro writes the old scripts won't work in the new versions, here are 2.5 and (at the bottom) 2.62 compatible ones, despite that the last one says it works in 2.63 it will NOT export UV data in 2.63, so I had to fix it* (see the attachment), that's what I use, but it doesn't export tags, so for that you still need to install an older Blender version.


*Note: before someone gets high hopes, No, I won't fix/write an importer/tag exporter/etc. I don't know Python or the Blender API at all, I just had the partially working exporter, the Blender docs and a stubborn idea, so I Hacked the thing Very Hard until it worked  :P.
« Last Edit: November 04, 2012, 09:20:43 pm by DarkRain »

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: 3D models questions...
« Reply #5 on: November 04, 2012, 10:40:23 pm »
Thanks again, Dark! I've downloaded and installed Blender 2.62, downloaded the io_export_md2.py.7z file, unpacked it into the scripts dir, I still cannot export anything. May I know what procedure are you using? BTW, I've tried again, if I make a group with all the brushes and export it to .obj via Radiant, then Blender can open it! Now I just need to understand how to transfer from blender to md2 and I will be set.

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: 3D models questions...
« Reply #6 on: November 05, 2012, 12:29:12 am »
When I said I fixed the attached script, I meant I fixed it to work on 2.63, since that's what I use (and thus the following steps are in 2.63), I installed the exporter using the blender installer addon option (File->User Preferences->Addons Tab->Install Addon), but you should be able to drop it in your scripts/addons dir, either way be sure to mark the checkbox to enable it* in the Addons tab of the User preferences window, then you just select the mesh you want to export (only one) and go to File->Export->Quake 2 (.md2).

*Note: You'll need to enable it each time you open Blender, unless you 'Save User Settings' in the file menu.

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: 3D models questions...
« Reply #7 on: November 10, 2012, 02:20:35 pm »
Thanks, Rain! Sorry, but I am way more experienced with the Autodesk interface, so I just downloaded a free md2 extractor for 3dsmax and I am experimenting with it. I have managed to make some little models, exported into .obj and used them as "models" in Radiant. It's working fine, now I just need to understand how to properly skin the model. Do you know any good tutorial? I've found this, where the procedure is called "unwrapping".

http://www.tutorialboneyard.com/Pages/50Calunwrap.aspx


By the way, I've exported the .md2 of the static model but the Radiant just crashes whenever I try to open the "create model" menu. Am I missing something?
« Last Edit: November 10, 2012, 02:44:02 pm by Latino210 »

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: 3D models questions...
« Reply #8 on: November 10, 2012, 04:08:51 pm »
What the hell? The .obj works fine with Radiant, but as soon as I load the map with UFO the program goes into fatal error. Can somebody tell me what am I doing wrong? .Obj included.

Edit: disregard that, I am an idiot. I was using a script for 3dmax 8 on 3dmax 2012. Now I can save an .md2 and Radiant is able to read it. Too bad that Radiant cannot skin the .md2, even if there is a nice 1024X1024 jpg in the same folder with the same name. See the included pic. By the way, putting this .md2 into a map makes UFO crash when I try to load it.

« Last Edit: November 10, 2012, 05:07:41 pm by Latino210 »

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: 3D models questions...
« Reply #9 on: November 10, 2012, 05:15:55 pm »
Don't know, maybe its because the model isn't uv mapped and skinned? But of course the game shouldn't segfault like that...

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: 3D models questions...
« Reply #10 on: November 10, 2012, 05:50:14 pm »
Each MD2 file points to its own skin file, and this has to be configured when you export the model. We use a system for referencing adjacent files with a "." and no file type extension (jpg, png, etc.). So, your MD2 exporter should allow you to define skins. If you did so for a model that had a skin file in the same directory named "car.jpg", you would set the skin to:

.car

Then the game (and Radiant) should be able to locate the skin. You can even specify multiple skins and in the func_model definition add a skin property pointing to each one (starting with 0).

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: 3D models questions...
« Reply #11 on: November 10, 2012, 07:36:10 pm »
Dear sirs

I am at my wit's end. The .md2 has been skinned and UVwrapped, but it does appear as covered in nodraws. The .obj works fine, at least in Radiant. Both object cause a fatal error when I try to visualize them during battle. I am including the three different versions of the object, the sample .jpg skin and the error message. Maybe it's because I am playing with a nightly build?  Can somebody smarter than me take a look at that?

Code: [Select]
======start======
Date: 2012-11-10
Windows version 5.2 (Build 3790) Service Pack 2
Win32 DEBUG, cpu: IA-32, version: 2.5-dev

0xb33109e : [unknown module] : [unknown file]
======end========




EDIT: I forgot, all the models in the models dir have an .mdx file included (no mention of that on the wondrous, useful wiki). I tried opening them with a .mdx converter but the format was not valid. Any clue?
« Last Edit: November 10, 2012, 07:46:11 pm by Latino210 »

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: 3D models questions...
« Reply #12 on: November 11, 2012, 12:05:02 am »
The skin name defined in the md2 is bad ("SkinBitMap:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::") so that's a problem, I edited the skin name and the model showed just fine both in radiant and in game

As for the obj, I don't know, there's a in the game bug for sure, but I haven't found where, maybe its related to the fact the obj is missing a corresponding .mtl

mdx is not needed to use the models (Its about pre-caching the models IIRC) and I don't think it is a standard format, you can generate it for md2 files using ufomodel anyway

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: 3D models questions...
« Reply #13 on: November 11, 2012, 01:02:26 am »
Once again, you are saving me from the bottomless depth of my ignorance. Just a little thing more, before going to bed: how exactly have you changed the skin name? I've tried editing with notepad, but it only made the radiant crash. Have you used an hex editor? I had already tried to cancel the "skinbitmap:::::::::::::::::::::::::::::::::" string and writing "motor" in its place, to no avail.
About the .obj, screw them, if I can export an .md2 with that (flawed) script and rename it by hand I am all set.

Thanks again for your help.

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: 3D models questions...
« Reply #14 on: November 11, 2012, 02:44:28 pm »
For some reason the forum wouldn't let me post, anyway, yes I didn't feel like re-exporting the model so I used an hex editor to write .motor (note the leading dot) and fill the rest of the skin name with null characters, supposedly you can also edit skin names using ufomodel but don't ask me how that works.