|
|

Glasgow, Scotland
243 posts
|
Hey guys,
I've just finished the first version of my SMD export script for modo 301.
It allows you to export static props and collision meshes from modo 301 into the SMD format - the raw format that gets compiled into an MDL file for use in games that run in the Source engine.
You can export collision meshes using this script, too. It's the same method. Just ensure that you don't have a vertex normal map applied or split edges - collision meshes must be completely smooth and sealed.
It cannot yet export idle animations for static props, however if you tell the .qc to use the SMD of your mesh, it will default it to a static idle pose (a cheap hack, but it works).
This script is modo 301 only.

Usage: - It will export all visisble polygons in all active layers.
- It will export first diffuse texture of the matierial applied to the polygon. This means you must have a material applied to your mesh.
- It will export either the UV map you have selected or the first one it finds.
- Whatever units you are using in modo, 1 of them will equal 1 inch in your exported model e.g. A character in modo should be 72 <your scale units> high, meaning the mesh will be 72 inches (6 feet tall) in-game. Coincidentally, 1 inch on an in-game model is exactly the same as 1 unit in Hammer.
- It cannot yet export smoothing based on your material's smoothing angle. So for smoothing it first looks for a vertex normal map and if it cannot find one, it will export a perfectly smooth model (as if the material had a smoothing angle of 180). You can get around this by physically splitting the edges you wish to be hard. Here's a video explaining what I mean (1.94mb, quicktime).
Note: When you export a mesh with several thousand tris, it can end up taking a while. It may appear that modo has crashed, but it hasn't - it's just working very hard. Wait a wee bit and it'll come back. I will try and make this faster in the future. (On some 25000 tri meshes, I've had it take about a minute to export).
To-do list for future versions: - Basic animation (per-object). - Morphs for .VTA morph maps. - Smoothing based off material smoothing angle.
Download: Get it here - modoToSMD.pl version 1.0 :)
If you find the script breaks on certain meshes, you can email me the mesh at jamesohare at gmail dot com and I'll try and work out what's wrong.
www.hull-breach.com/Talon
Message edited by Talon on 10/31/2007 - 3:02 AM
|
|
10/21/2007 - 6:42 AM
|
|
|

699 posts
|
good, applause for you!
yeap modo/LW - ..ehh, you laugh at my english, sorry but I`m doing what I can
|
|
10/21/2007 - 8:40 AM
|
|
|

California
3687 posts
|
Sweet, thank you very much for the hard work! I'll test it when i have time.
The human race is going through a shift in consciousness, from 3D to 5D. Reattach to your higher self and wake up! 10/10/10-11/11/11-12/21/12
|
|
10/21/2007 - 10:49 AM
|
|
|

Dublin
6265 posts
|
Super - thanks for this. :)
|
|
10/21/2007 - 10:54 AM
|
|
|

Melbourne
340 posts
|
booooooyah! I might make some kinda tutorial vid for this on the weekend.
|
|
10/21/2007 - 5:09 PM
|
|
|

California
3687 posts
|
Quote from duke_ : booooooyah! I might make some kinda tutorial vid for this on the weekend.
Can you cover this part please:
-You can get around this by physically splitting the edges you wish to be hard.
I haven't given the exporter a try yet, but have a hard time with that part. Everything else i understand perfectly.
The human race is going through a shift in consciousness, from 3D to 5D. Reattach to your higher self and wake up! 10/10/10-11/11/11-12/21/12
|
|
10/22/2007 - 9:18 AM
|
|
|

Glasgow, Scotland
243 posts
|
Hi Sonk, I've uploaded a video explaining what I mean.
You can grab it here (1.94mb, quicktime)
Additional to cutting and pasting polygons to split the edges up, you might also find use in Seneca's Super Vert & Edge Split script (about 3/4 of the way down the page).
Currently, until we have full control over vertex normals, this is the way that smoothing will have to be done. I've been playing with scripts that should help with defining hard/soft edges using a vertex normal map, but I have to admit I haven't gotten too far. I'll play around some more when I get a free weekend :)
Obviously, none of this matters if your mesh uses normal maps baked from a high poly mesh as the normal maps will take care of the smoothing themselves. Just ensure you bake them with a smoothing angle of 180 degrees on your material!
www.hull-breach.com/Talon
Message edited by Talon on 10/22/2007 - 10:53 AM
|
|
10/22/2007 - 10:53 AM
|
|
|

Melbourne
340 posts
|
I got a response from Ariel Diaz Jim Hughes at Valve, who's evidently been keeping an eye on this thread :P
Hi George,
The TF2 character pipeline is still Maya-based, so anything built in Modo was exported into Maya, then rigged and exported into the game using our maya exporter. I do know that studiomdl now supports .obj’s so you can export those from Modo and compile them into game models. This is a workflow that we don’t use in-house for shipping content, and I haven’t tried it myself, but it’s there if you want to give it a shot.
cc’ing Jim Hughes. I believe he’s tried this workflow before and might be able to answer some of your questions.
Good luck,
Ariel
Hey George,
I have used the obj path that Ariel talked about below. It works fine running studiomdl against objs instead of smd files. There seems to be an issue with modo 301 exporting of objs and it crashes our model compiler. I looked at the actual obj in a text editor and it seems like 301 isn't exporting any vertex normals. My solution at home was to just reload the obj file in 201 and re save it out and then it will work with our model compile tools. I was going to email Luxology about this. Someone released a smd exporter for modo this weekend as well. I tried it at home with a simple cube and it worked.
http://forums.luxology.com/discussion/topic.aspx?id=21324
Jim
|
|
10/22/2007 - 11:06 PM
|
|
|

California
3687 posts
|
Talon,
thanks thats what i kind had in mind. Hopefully i'll get to test it by next week, when my Toad character is done. Oh and thanks for the tip on normal map baking.
duke,
I can't believe they still use Maya! I didnt know studioMDL supports OBJ files now. gotta update my source SDK.
The human race is going through a shift in consciousness, from 3D to 5D. Reattach to your higher self and wake up! 10/10/10-11/11/11-12/21/12
Message edited by Son Kim on 10/23/2007 - 12:22 AM
|
|
10/23/2007 - 12:21 AM
|
|
|

Glasgow, Scotland
243 posts
|
Cool stuff duke_, cheers for posting up your email replies :)
I didn't realise they used Maya at all (I still thought it was all XSI for rigged characters). modo > maya > game is the workflow we use at work, so it's good to hear we're on similar tracks :P
Didn't know about the .obj thing, either. Though I've seen studiomdl complaining about not being able to find .obj files before.
www.hull-breach.com/Talon
|
|
10/23/2007 - 12:42 AM
|
|
|

In my lab
260 posts
|
Awesome Talon! I was just about to load up Lightwave to export from, thought I would check and see if you got this going.
Side note, anyone know when the Orange Box SDK is going to be released? Ive tried the walk-around for Portal but it just crashes every time for me.
|
|
10/30/2007 - 8:04 AM
|
|
|

France
56 posts
|
Thanks for this talon, just what i was looking for.
Auctane: A lot of people were expected the sdk to be released a week after the games so I guess they're running a little behind.
http://storefront.steampowered.com/Steam/Marketing/message/1273/
I've haven't been having much luck with the walkaround either, what errors are you getting?
Message edited by sakura on 10/31/2007 - 3:07 AM
|
|
10/31/2007 - 2:42 AM
|
|
|

Melbourne
340 posts
|
They've said on the hl-coders mailing list that it will be atleast a month after orange box release, so don't hold your breath.
|
|
10/31/2007 - 5:25 AM
|
|
|

France
56 posts
|
Is that the source code update your talking about or just the updated tools (hammer, etc)?
|
|
10/31/2007 - 6:07 AM
|
|
|

Glasgow, Scotland
243 posts
|
I'm guessing it will all arrive together (maybe with the Source engine's multi-core improvements they had intended to release before the orange box? We can only hope :P).
www.hull-breach.com/Talon
|
|
10/31/2007 - 6:29 AM
|
|
|

In my lab
260 posts
|
Quote from sakura : I've haven't been having much luck with the walkaround either, what errors are you getting?
On the 'easy' one it was trying to execute the hl2.exe from HL2 so I went into the gameinfo.txt and set it to portal\hl2.exe which when I compiled a map and tried to run it, it then gave me the same error as the one that 'will put hair on your chest' which was something along the line of: ValveFilesystem(8ri92597###%$@!)error_ FS is already in use! So, assuming someone actually did get it to work, its like there is a file Steam is using and the Portal\HL2.exe cant open it? Maybe if I read into the right way to setup a mod, I would have a better understanding and be able to do it.
I spent several hours trying to make it work but finally decided without really tearing into it, it wasn't going to happen. I need to concentrate on my portfolio so I am going wait for the SDK to officially be released... I think.
|
|
10/31/2007 - 6:57 AM
|
|
|

France
56 posts
|
I got past that error by changing the game exe in options to $SteamDir\steam.exe and then from the Run Map dialog, prepending -applaunch 440 parameter for the '$game_exe' command. The appid for portal is 400.
Now I'm stuck on a "Could not load library client" error. Never mind, I can wait for the sdk update.
Message edited by sakura on 10/31/2007 - 7:17 AM
|
|
10/31/2007 - 7:16 AM
|
|
|

In my lab
260 posts
|
Sounds like a similar problem further down the line. Yeah waiting for the SDK.
Talons script works awesome though!
|
|
10/31/2007 - 7:58 AM
|
|
|

France
56 posts
|
FYI
SDK update should be out today. http://forums.steampowered.com/forums/showthread.php?t=620671
Message edited by sakura on 11/7/2007 - 8:55 AM
|
|
11/7/2007 - 8:55 AM
|
|
|

Melbourne
340 posts
|
This is really weird, check out this rat bastard of a mesh. Exporting for use as a collision model, I get that bad smoothing group error. I tried it in the LW exporter aswell, same deal.
www.dukecg.net/PhysboxError.zip
|
|
11/12/2007 - 2:39 AM
|
|
|

Glasgow, Scotland
243 posts
|
Odd, I exported it here and it seems to compile just fine (no errors in the command line at least, I need to set up all my SourceSDK mods again to check it in HLMV).
It sounds like you might be referencing the wrong model in your .qc file?
www.hull-breach.com/Talon
|
|
11/12/2007 - 3:38 PM
|
|
|

Melbourne
340 posts
|
I tried it again but realized I hadn't included the texture which messes it up a bit. I've now re-uploaded with a test texture, re-installed the SDK, and the qc is definately referencing it. It's really weird, these issues used to be sorted by setting the smoothing to 180 and an atlas UV or some kind of valid UV map, but this particular geometry is busted, even if I rebuild it. :o
http://www.dukecg.net/PhysboxError2.zip
|
|
11/13/2007 - 2:34 AM
|
|
|

Glasgow, Scotland
243 posts
|
Yeah, the texture thing I realised the night I released it when I started to export full collision models that didn't have materials.
I've got that fixed up but I'll wait until I've had a proper look at the animation side of things before I release it (I don't think it's too big of a bug, easily solved).
The smoothing won't make a difference because I can't yet export a smoothed model (i.e. unless there's a vertex normal map or you've broken the geometry - the model gets exported completely smoothed anyway). UVs will get set to (0,0) if they don't exist, too.
www.hull-breach.com/Talon
Message edited by Talon on 11/13/2007 - 3:46 AM
|
|
11/13/2007 - 3:42 AM
|
|
|

Melbourne
340 posts
|
Yeah it's a really weird thing. As I said, it does the same thing via the LW exporter. I'm going to get someone to export it via Max and see if that works. I also tripled before exporting but that didn't change it.
|
|
11/13/2007 - 3:59 AM
|
|
|

Melbourne
340 posts
|
Here's something i've been working on. Thanks again for the script!
|
|
12/13/2007 - 5:32 PM
|
|
|
|
|