Go Back   NewTek Discussions > LightWave 3D Technique Discussions > Game Development

Reply
 
Thread Tools Display Modes
Old 11-27-2005, 06:17 PM   #1
warmiak
Registered User
 
Join Date: Oct 2005
Location: USA
Posts: 992
SMD Exporter for Lightwave 7.x/8.x

I just finished beta version of SMD exporter (Half Life 2 engine mesh and animation format) for Lightwave.

You can download plugins from http://www.warmi.net/lightwave/.

There are 3 plugins present in the zip file.

One is for exporting static mesh models from Lightwave modeler.
The other two are for Lightwave Layout.
The layout plugin for exporting reference models is very similiar to the modeler plugin but will also export reference pose (bones at their rest position/rotation)
The other layout plugin is for exporting skeletal animations.

Technically there are 4 plugins since animation plugin for lightwave contains two plugins but from the user point of view this is irrelevant since the fourth plugin is automatically applied and driven by the master animation plugin. This was neccesary since to capture post IK information in Lightwave one has to create item motion plugin and apply instance of it to each bone that is being animated.
As I mentioned, this is all transparent to the user and I only mention it because Lightwave will display message about 2 plugins being "found" when installing animation plugin.

This is a beta release and as such there is a possibility that some things will not work as expected. If you encounter any problems with exporting
mesh or animations you can send me whatever scene/object you having problems with and I will try to debug and possibly fix any potential problems.

Refer to readme.txt within the zip file for detailed usage and general information about the plugins.
warmiak is offline   Reply With Quote
Old 11-27-2005, 10:47 PM   #2
Tima
Registered User
 
Tima's Avatar
 
Join Date: Feb 2003
Posts: 56
doh! awesome news =)

i ll test this reaaly soon

Thx a lot =)

just a little question , you think you make a VTA plugin exporter for Lw to complete tools?
__________________
http://www.game-lab.com
Je veux un vrai integration des egdes dans lightwave 9.X bouhhhhhh!!!

Last edited by Tima; 11-27-2005 at 10:53 PM.
Tima is offline   Reply With Quote
Old 11-28-2005, 01:40 PM   #3
warmiak
Registered User
 
Join Date: Oct 2005
Location: USA
Posts: 992
" you think you make a VTA plugin exporter for Lw to complete tools"

Probably, since VTA are basically mesh deforms.

Right now I am working on an SMD mesh/reference/animation importer for Lightwave - mainly so I can reuse, modify etc.. Half Life 2 existing models and animations.
warmiak is offline   Reply With Quote
Old 11-28-2005, 05:02 PM   #4
Tima
Registered User
 
Tima's Avatar
 
Join Date: Feb 2003
Posts: 56
Good job , but i a have some problems ^^

hmm, i cant compile model export from modeler , cause studiomdl demand sequence file to complete compilation and exporter dont create a empty sequence file, i think.

i have a problem to export background layer as a phys model , the plugin just write reference file.
__________________
http://www.game-lab.com
Je veux un vrai integration des egdes dans lightwave 9.X bouhhhhhh!!!
Tima is offline   Reply With Quote
Old 11-28-2005, 09:04 PM   #5
warmiak
Registered User
 
Join Date: Oct 2005
Location: USA
Posts: 992
This is a matter of content of .qc file ( which is a sort of makefile or template for how to compile a model.)
In that file you basically list locations for various meshes , textures along with some commands and this is what Half Life SDK studiomdl uses to compile a final model.

The plugin doesn't deal with that at all - it simply creates smd meshes out of Lightwave models.

Having said that , let me give you some hints regarding possible solutions.

When studiomdl complains about sequence file then this is matter of simply adding sequence command to your qc file.
For animated objects this would be list of animated sequences (different smd files which you exported from Lightwave) For static meshes you can just use the reference model as a sequence idle.

This is an example qc file for a static mesh:

// Output .MDL
$modelname prison_island/vehicles/hummer.mdl

// Textures (vtf)
$cdmaterials prison_island/custom_models/vehicles

$staticprop

$scale 1.0

// whole body – reference model
$body studio "hummer.smd"



// sequences: - will use reference model again since this is a static mesh
$sequence idle "./hummer" loop fps 30

$surfaceprop "metal"

$collisionmodel "hummer_phys.smd" {
// Mass in kilograms
$Mass 2000
$concave
}

--------------------------------

As you can see, for static meshes you need two smd files. One is your reference model and the other is physics model ( which is basically a simpler version of reference model.).
Even phys model is optional …

I have tested hundreds of models exporting from the modeler and layout and I had no problems whatsoever.
Basically first select layer you have your reference model in , start plugin and change Export Layers: to "Foreground only" and export the model as something.smd.

Once you are done with that , switch to phys model layer and do the same thing (Select foreground only etc), this time exporting it as something_phys.smd. You can verify if the correct layer is being exported by looking at statistics table - phys models will generally have much lower poly count.


One more thing - when creating static meshes from modeler ( or even from layout) if you don't have any bones in the model ,then the plugin will create a single root bone by default and assign all vertices to it - this is basically to satisfy SMD requirments - otherwise you wouldn't be able to compile even a static mesh.
If you look at Half Life 2 meshes you will see that all static objects have this single fake bone and a single frame of animation precisely to be able to use reference model as sequence idle.
In other words, the plugin doesn't care if you are exporting phys or reference model - it is a mesh that uses the same format. It is up to you if you are exporting a single reference model and then reusing it for sequence idle, maybe even for phys model or whatever - the format of smd file will be the same. .qc file is where you tell studiomdl what is your reference model, animation or phys model.


I am just mentioning this for completness - it all happens automatically for static meshes.

Check these links for further info:

http://www.hl2world.com/wiki/index.p...ompile_Toolkit

http://www.hl2world.com/wiki/index.p...Physics_Models

Last edited by warmiak; 11-28-2005 at 09:29 PM.
warmiak is offline   Reply With Quote
Old 12-02-2005, 05:20 PM   #6
Tima
Registered User
 
Tima's Avatar
 
Join Date: Feb 2003
Posts: 56
thx warmiak for this big explanation =)
i can compile model, if i use reference model for Phys and anim idle sequence ok
To export phys BG layer i make the same that you have explain on top

now i'll test to export character animation

Thx again for the plug
__________________
http://www.game-lab.com
Je veux un vrai integration des egdes dans lightwave 9.X bouhhhhhh!!!
Tima is offline   Reply With Quote
Old 12-13-2005, 02:30 AM   #7
jasonwestmas
Adapting Artist
 
jasonwestmas's Avatar
 
Join Date: Mar 2003
Location: Madison Wisconsin
Posts: 4,438
First of all I really appreciate your hard work in this department

Some Feature questions:

Will using Record Pivot Rotation on any of the bones mess up the smd animation export?

Does this exporter support IK calculations and "match pivot rotation"? It seems like your instructions say it does. Or should I first bake the IK and the pivot rotations into the bones? Also, I'm using four goals in the ankle and foot on both legs, would this cause a problem?

Thanks!

Last edited by jasonwestmas; 12-13-2005 at 02:50 AM.
jasonwestmas is online now   Reply With Quote
Old 12-13-2005, 02:49 PM   #8
jasonwestmas
Adapting Artist
 
jasonwestmas's Avatar
 
Join Date: Mar 2003
Location: Madison Wisconsin
Posts: 4,438
getting there

Hmm, my Referance .smd model seems to compile ok now but I get an error when it my studio compiler tries to compile the animation .smd. Doesn't seem to be any animation in the "ProwlerWalk1" .smd export.

Created command line: "C:\Program
Files\Valve\Steam\SteamApps\epiginosis\sourcesdk\b in\studiomdl.exe" -game
"c:\program files\valve\steam\steamapps\epiginosis\half-life 2\hl2" "C:\Program
Files\Valve\Steam\SteamApps\epiginosis\sourcesdk_c ontent\hl2\modelsrc\Prowler\Prowler_Model.qc"

c:\program
files\valve\steam\steamapps\epiginosis\sourcesdk_c ontent\hl2\modelsrc\prowler\,
c:\program files\valve\steam\steamapps\epiginosis\half-life 2\hl2\, path
Prowler_Model
Working on "Prowler_Model.qc"
SMD MODEL ProwlerRig_hl2.smd
ERROR: model has no sequences
ERROR: Aborted Processing on 'models/Prowler/Prowler_model.mdl'

//QC file


$modelname models/Prowler/Prowler_model.mdl

$cdmaterials materialsrc/Prowler

$scale 1

$model Prowler "ProwlerRig_hl2.smd"

$texturegroup skinfamilies
{
{"Body_specular_normal"}
{"Body_translucent_color"}
{"Head_specular_normal"}
{"Head_translucent_color"}
{"Bow_Arrow_Quiver_color"}
}

$sequence ProwlerWalk1 "ProwlerWalk1.smd" loop fps 25 activity Walk1
jasonwestmas is online now   Reply With Quote
Old 12-14-2005, 11:52 AM   #9
warmiak
Registered User
 
Join Date: Oct 2005
Location: USA
Posts: 992
The smd file parser inside of mdlcompiler seems to be quite unforgiving and has some funky requirements regarding formating of qc files.

In this case the problem is lack of space between "{" character and the filename in the $texturegroup section.

In other words this section:

$texturegroup skinfamilies
{
{"Body_specular_normal"}
{"Body_translucent_color"}
{"Head_specular_normal"}
{"Head_translucent_color"}
{"Bow_Arrow_Quiver_color"}
}

should be written as:

$texturegroup skinfamilies
{
{ "Body_specular_normal"}
{ "Body_translucent_color"}
{ "Head_specular_normal"}
{ "Head_translucent_color"}
{ "Bow_Arrow_Quiver_color"}
}

Bottom line is that one has to be very careful when writing and formatting qc files - I have no idea why Valve model compiler is so rigid about these minor issues but that's how it is.


As far as SMD exporter I finally figured out what was wrong with “reset pivot rotation” not being included in the final rotation matrix for the model, and will be posting updated version within a day or so.
In addition to that I have now fully working importer (mesh, reference models and animation) from smd to lightwave and it will be included in the next release as well.
warmiak is offline   Reply With Quote
Old 12-14-2005, 02:02 PM   #10
jasonwestmas
Adapting Artist
 
jasonwestmas's Avatar
 
Join Date: Mar 2003
Location: Madison Wisconsin
Posts: 4,438
Excellent! Thankyou, got the animation working now. Just needed the"./" before the smd file name. I'm really excited about the "Record Pivot Rotation" fix too! The only problem was that the match goal orientation on my toe, ankle and wrist didn't convert in the smd you sent me, but I guess that's because your exporter works a little like motion baker?? Anyway, at least now I don't have to make a new rig and I don't have to bake all my bones and mess with key reduction.

Last edited by jasonwestmas; 12-14-2005 at 02:06 PM.
jasonwestmas is online now   Reply With Quote
Old 12-15-2005, 03:10 AM   #11
jasonwestmas
Adapting Artist
 
jasonwestmas's Avatar
 
Join Date: Mar 2003
Location: Madison Wisconsin
Posts: 4,438
In case anyone wants to know, match goal orientation and Record Pivot Rotation are now supported with Warmiak's exporter. He'll be posting the update really soon. I was so thrilled that I just had to break the news!
jasonwestmas is online now   Reply With Quote
Old 12-15-2005, 11:57 PM   #12
warmiak
Registered User
 
Join Date: Oct 2005
Location: USA
Posts: 992
Update

I just released latest versions of SMD plugins for Lightwave 7/8.

Changes:

- Pivot rotation as well as "Match Goal Orientation" are now taken into account when exporting reference/animation. This new stuff, as well as existing support for IK , should account for pretty much every possible scenario when exporting animation from Lightwave. Of course , one still has to make sure the animation is Source compatible to begin with ( single root bone + all bones are driven by weightmaps only.)


- New set of of 2 plugins for importing SMD meshes/reference models and animations into Lightwave.

Refer to readme.txt within the zip file for detailed usage and general information about the plugins.

http://www.warmi.net/lightwave/


PS.

Thanks to jasonwestmas for his help in debugging issues with pivot and goal orientation.

Last edited by warmiak; 12-16-2005 at 12:01 AM.
warmiak is offline   Reply With Quote
Old 12-16-2005, 02:30 AM   #13
jasonwestmas
Adapting Artist
 
jasonwestmas's Avatar
 
Join Date: Mar 2003
Location: Madison Wisconsin
Posts: 4,438
Many thanks to you too Walter, this is a fine piece of work you've made with the SDK. I got my character running great! Hope to see a lot more games made with Lightwave and Halflife2. Blackwatersoftware, the people I'm working with, are just as thrilled as I am!
Attached Images
File Type: jpg Prowler_walk1 copy.jpg (134.2 KB, 400 views)
jasonwestmas is online now   Reply With Quote
Old 06-25-2006, 05:33 AM   #14
Tima
Registered User
 
Tima's Avatar
 
Join Date: Feb 2003
Posts: 56
Up!
Hi Warmiak , i wanna know if you have try to work on VTA exporter or if this tool have any chance to be released in the futur.
you have make good tools
but to create complete character with faciales animation, it's not possible
__________________
http://www.game-lab.com
Je veux un vrai integration des egdes dans lightwave 9.X bouhhhhhh!!!
Tima is offline   Reply With Quote
Old 06-25-2006, 11:01 AM   #15
jasonwestmas
Adapting Artist
 
jasonwestmas's Avatar
 
Join Date: Mar 2003
Location: Madison Wisconsin
Posts: 4,438
So you're trying to animate the face with bones? Just to let you know, there is a hl2 face animation tool along with the other other hl2 tools that come with the game. You import your mdl file into the face animator and create the facial morphs from there.
jasonwestmas is online now   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 08:52 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2000-2007, NewTek