Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Fri Jul 30, 2010 10:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: A new Doom3 -> Maya Importer
PostPosted: Sun Sep 26, 2004 3:34 am 
Offline
has joined the game

Joined: Wed Sep 15, 2004 2:11 am
Posts: 33
Hi everyone. This is a Maya md5 importer, so you can use it to import doom3 models and animations into Maya and watch them/tweak them/learn from them...

Thanks to everyone on this forum (der_ton, bozo and all the others) for the doom3 knowledge sharing. And thank you especially to nobdhy, who took some time to check the code, and came up with the equations that made it all possible (basically he got me going when I was completely stuck).
This MEL script (and the icon for the GUI) should work for Maya 8, 7, 6 and maybe 5. To use it:

1) Just put the script somewhere where you'll know where to find it, and the icon in "my docs/maya/6.0/prefs/icons" or something of the sort. Then in Maya make a button with:
Code:
source "F:/maya_scripts/my_scripts/doom3toMaya_018e.mel" ;
md5import ;

Of course, replace the path with the relevant info... Please note the use of "/" instead of "\" in the path!

2) Edit (with notepad) the line number 9 (of the the MEL script) that says $doomBasePath with your valid doom path.

Now some caveats:
=============
- this is a BETA, but it mostly works.
- there are no textures imported in Maya, because the code is not working yet (and the purpose is just to see the geo and the anim).
- the vertex number in Maya is not the same as in doom3. What I understand is that there are some vertices in (not all) the models that occupy the same position in space, but are still considered distinct. However, when Maya combines the faces (based on the tris), it gets rid of those weird/duplicated vertices. This doesn't seem to be such a big deal as far as weighting is concerned, but the UVs get pretty distorted in places (hence the texture feature disabling)...
- because of the aforementioned problem, some props/things will miss part of their geometry

Finally, I hope you have a fast rig, because on my mighty powerful Pentium 3 at 1Ghz, it takes:
    - 8 sec to build a "lost soul"
    - 33 sec to build a "skeleton"
    - 1mn 51s to build a "pinky"
    - 2mn 9s to build an "imp"
I think for the "hellknight" it was about 10 minutes. Rhhaaa... But I'm getting a much better machine soon! :D Please, tell me how long it takes on your PC!

Don't hesitate to tell me if you see glaring mistakes in the script or anything (after all I'm not a coder :P). Oh yeah, the link:

[EDIT] by Seith: :arrow: This is where to find the most recent version! :!:
http://www.seithcg.com/#MD5toMaya



[EDIT]moved to Maya forum >kat<


Last edited by seith on Tue May 29, 2007 11:47 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 26, 2004 11:38 am 
Offline
Plasma Spammer
User avatar

Joined: Fri Jun 27, 2003 11:24 pm
Posts: 2709
Location: Munich, Germany
Nice job. I can't test it but anyway, this is real cool.
You may want to put a link to this thread in the modelling&animations forum sticky where we collect the tools and converters for modelling&animations. :)

http://www.doom3world.org/phpbb2/viewtopic.php?t=5474

_________________
Image Staff
Modelviewer | 3DSMax<->MD5 | Blender<->MD5


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sun Sep 26, 2004 12:06 pm 
Offline
picked up 75 health

Joined: Mon Aug 16, 2004 4:02 am
Posts: 77
Location: Merseyside UK
Brilliantt.. just what I needed.. will try this tomorrow 8)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 12:51 am 
Offline
subversion

Joined: Fri Jan 31, 2003 1:04 am
Posts: 139
Location: Dark Underworld
I'm not an animator but it sure is cool to have a tool like this available.
I'm sure it'll be much appreciated! :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 5:46 am 
Offline
The first 10 posts have been the best...

Joined: Wed Sep 01, 2004 4:35 pm
Posts: 22
hey you got it all working, sweet :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 11:08 am 
Offline
picked up 75 health

Joined: Mon Aug 16, 2004 4:02 am
Posts: 77
Location: Merseyside UK
Great stuff for a beta..
Most stuff imported ok. Some of the models had some funny turnouts.. Lokk at the Skeleton for example hehe..
http://www.stonks.com/forum/import.jpg
http://www.stonks.com/forum/import2.jpg
http://www.stonks.com/forum/import3.jpg

Animation import mostly works just a few limbs do some funky dancing. I made a small DivX Avi to show
http://www.stonks.com/forum/import.avi
132k ..

Great work so far Seith.. Please keep posting updates and will test for you. .. Is it possible to get the uv layout imported ok though.. Would be nice to see the model skinned..

BTW it only took 44 secs to import the skeleton & mesh for the Mancubus and 3 mins 4 secs for the hellnight (using my Dual opteron system)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 5:44 pm 
Offline
has joined the game

Joined: Wed Sep 15, 2004 2:11 am
Posts: 33
Thank you all for your encouragements! As I said, it's just a beta...

uberstonks -> Thanks for all the testing, it really helps! By the way, can you give me some loading time, just to have an idea? Thanks... Now for the serious business:

For the UVs thingy, I really have to work more on this, but I think I'm gonna have to re-examine the way to do it from the ground up. Bah, I'll keep you posted...

Now for the funky skeleton: no, no, it's not my fault! :lol: Believe it or not, but that's the way the md5mesh actually looks like (you can double-check that with any viewer around here, I used der_ton's). I'm going to make this statement in bold, for the benefit of anybody encountering the same situation:

    -> As a rule of thumb, if you want to see a model in it's default pose the way it looks like in doom3, just load the "af_pose.md5anim" or "ik_pose.md5anim" or "initial.md5anim".
You'll see, this skeleton gets it's head firmly planted on it's shoulders :). The reason for this is the md5mesh pose exists only for reference, it's not supposed to be seen by anyone.

Also, for the movie of the archville, beside the obvious joint-flipping peculiarity ('gadda give it to him, 's got great moves!), what struck me is how "wrong" it looks timing-wise (slow-motion). And then I realized this:

    -> Your settings for Maya in "Preferences -> Settings" should be set to "Film (24fps)".
    -> Your settings in "Preferences -> Settings -> Timeline" should also be set to "Real Time [24fps]".

If they're not, that's what you get; the reason for this flipping is called "screwy interpolation(TM)" inbetween keyframes. Besides, you want to see the animations the way they were intended to be seen, right? So, sorry about that, I should have precised that all doom3 animations were done at 24fps, but there you go...

Please, by any means, do tell me if there's still a problem after checking those details (it might also be a versioning mishap on my behalf, I've go so many different! )... :P


Top
 Profile  
 
 Post subject: Error: Cannot cast data of type float[] to vector.
PostPosted: Mon Sep 27, 2004 8:47 pm 
Offline
is connecting to Doom3world.org

Joined: Mon Sep 27, 2004 8:44 pm
Posts: 6
I did eveything you said above but I get an error. I'm Runnig Maya 5.0.1 any idea why this is doing this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 8:48 pm 
Offline
is connecting to Doom3world.org

Joined: Mon Sep 27, 2004 8:44 pm
Posts: 6
The error is: Error: Cannot cast data of type float[] to vector.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 9:56 pm 
Offline
has joined the game

Joined: Wed Sep 15, 2004 2:11 am
Posts: 33
Oops, it "might" mean that it works only on maya 6.0, but if you can tell me the line number that the script editor gives you with the first error (or better an exact copy of the error messages), and the model file you're trying to import, I may be able to fix that... To get the line number to show up, make sure the option "show line numbers" in the script editor is checked, and then run the script.
Also, if you get an error message, do a scene->new to be sure to start with a clean slate...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 10:45 pm 
Offline
picked up 75 health

Joined: Mon Aug 16, 2004 4:02 am
Posts: 77
Location: Merseyside UK
seith wrote:
By the way, can you give me some loading time, just to have an idea? Thanks... Now for the serious business:


I did post some times in my last post
Quote:
BTW it only took 44 secs to import the skeleton & mesh for the Mancubus and 3 mins 4 secs for the hellnight (using my Dual opteron system)


Im at work at the moment (working nights... groan). I will look at the animation settings tomorrow. Thanks for pointing it out to me...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 12:24 am 
Offline
has joined the game

Joined: Wed Sep 15, 2004 2:11 am
Posts: 33
uberstonks-> Oh man, I didn't even register, sorry! 44 seconds for the mancubus?!! It takes my machine 2 minutes and 8 secs to do that... :cry:

Guru-> I've got it! After a bit of research involving digging out an even older machine than the one I use (with maya 5), and much back-and-forth tinkering with the code, there you go... A (hopefuly) compatible version with maya 5.0:

[EDIT] by Seith: :arrow: This is NOW the most recent version! :!:
http://www.seithcg.com/#%5B%5BImporting%20Doom3%20models%20into%20Maya%5D%5D

Tell me if those pesky "floats-not-liking-to-be-called-vectors" bother you again... :P


Last edited by seith on Sun Dec 31, 2006 8:50 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 1:40 am 
Offline
picked up 75 health

Joined: Mon Aug 16, 2004 4:02 am
Posts: 77
Location: Merseyside UK
:twisted:
Is the new version just for Maya 5 (18f) ? I am using Maya 6 so do I stay with the version you linked in the first post of this thread (18e) ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 8:58 pm 
Offline
picked up 75 health

Joined: Mon Aug 16, 2004 4:02 am
Posts: 77
Location: Merseyside UK
seith wrote:
    -> Your settings for Maya in "Preferences -> Settings" should be set to "Film (24fps)".
    -> Your settings in "Preferences -> Settings -> Timeline" should also be set to "Real Time [24fps]".


Couldnt find the 2 setting you described in Maya 6
I found some settings but I set it to real time which is 30 fps it didnt give me the option for 24fps ?
Where can I find the 2 settings you were telling me about ?.

This is so cool. I rendered the hellknight walk at every half frame so I could see the movement in more detail... Zoom the result to 200% for a better view

http://stonks.com/forum/hellknight.avi


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 10:01 pm 
Offline
has joined the game

Joined: Wed Sep 15, 2004 2:11 am
Posts: 33
-> uberstonks: Hey, this looks pretty cool indeed (although I can see that I still didn't get the weighting right, oh well)! By the way, don't worry I'm on maya 6.0, so everything I do is compatible with maya 6.0 :P. And yes, it is still compatible with maya 5.0.

Alright, to change the settings in Maya, go the menu "Window" --> "Settings/Preferences" --> "Preferences". Then you have a new window appearing called "Preferences".

Inside that window, on the list on the left side (called "Categories"), you should see a sub-menu called "Settings". Click on it, and on the right side, look for something called "Time". Set it to "Film (24 fps)".

Then go back to the left side of the window ("Categories"). Look for the sub-menu called "Timeline", click on it. On the right side, look for something called "Playback Speed" and set it to "Real-time [24 fps]". And that's it. Hope that's clear enough, as maya preferences can get tricky to navigate through...

Ok, on to the good news:

-> I rewrote entirely the way to build the meshes, and as a result, the script is now more than 2x faster than before. It used to take me 2 minutes and 8 sec to build "pinky", it now takes 54 secs.

-> Also I finally got the UVs right, so now you can see textures (although no bump yet, it's still a beta ;)). Please note that in some cases, the texture will not load, because it's name is not standard (but you can try to load it manually). Also, I didn't work on the transparencies (no alpha channel), so I don't know if they work...

[EDIT] by Seith: :arrow: This is NOW the most recent version! :!:
http://www.seithcg.com/#%5B%5BImporting%20Doom3%20models%20into%20Maya%5D%5D


Last edited by seith on Sun Dec 31, 2006 8:51 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 11:09 pm 
Offline
The first 10 posts have been the best...

Joined: Wed Sep 01, 2004 4:35 pm
Posts: 22
Just a suggestion, but you might want to add the following lines to your MEL script to automatically set the proper settings for playback:

playbackOptions -playbackSpeed 24;
currentUnit -time film;

-nohbdy


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 11:17 pm 
Offline
has joined the game

Joined: Wed Sep 15, 2004 2:11 am
Posts: 33
Thanks nohbdy, that's what I was looking for... That should take care of the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 11:40 pm 
Offline
picked up 75 health

Joined: Mon Aug 16, 2004 4:02 am
Posts: 77
Location: Merseyside UK
Cool.. Thx for the update guys... Bah... I have to wait until I finish my nightshift to try out the new version ... grr


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 29, 2004 4:40 am 
Offline
has joined the game
User avatar

Joined: Wed Aug 11, 2004 6:29 am
Posts: 30
It seems to be working fine.

Hellknight mesh 2min 6sec
Hellknight

Hellknight animation
Hellknight Walk


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 29, 2004 5:45 pm 
Offline
picked up 75 health

Joined: Mon Aug 16, 2004 4:02 am
Posts: 77
Location: Merseyside UK
worked for me too :wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group