Problems understanding WW and player model importing.

Started by CaptainCrazy, October 22, 2013, 10:24:49 AM

Previous topic - Next topic

CaptainCrazy

I was advised to ask you, K@rt, because apparently you're pretty much in the know how.  I can't seem to import even a player model provided by Valve with all the correct bone names and everything.

The player model is view-able in HLMV but there are no animations for it and i just wish to use default HL2/CSS animations so i can get a feel for making custom players.

Could you please help me as i've been through a lot of Google search results but had no luck at all so i figured i'd come here to ask instead of pestering Shawn who has been a lot of help as it is xD

I've tried using the cs_player_shared.qc and injecting into the QCI in WW but then it comes back with messages like:


And i am again reminded of why Source used to infuriate me when other engines are much more lush yet simpler to use lol.

I can pretty much do everything else regarding modeling and mapping but this is just not working for me xD

***EDIT***

Okay i got it working but now i get messed up poses like this  >:(

K@rt

To be honest Captain, I haven't tried importing player models into Max using the WWMT importers for 3 months or more.  The last time I tried it seems that the WW importers were simply not capable of handling fully skinned, rigged character models and/or animations.

.smds that imported fine using Wunderboys smdimporter would lose all (or most) of the bone info and none of the skinning info would be translated either when I tried with WW. This was using L4D2 character models (which have a slightly newer format than CS:S models) but I think the same applies.

Since I last tried to import a character into Max I have mentioned to Shawn once or twice that it would be nice to have a system that could handle character models correctly - but so far as I am aware he hasn't made any changes to the importers since then. He's added a lot of other things but I don't think he's had time to work on them and I think that for him its not a major priority.

Unfortunately Wunderboy no longer supports smdimporter and the last version of max that it is compatiable with is 2012. So in 6 months when max 2015 comes out max 2012 will stop being supported and we will find ourselves with no importer for supported versions of max at all. :(

I hope Shawn will be able to find the time to get the importers working correctly for character models, up and including the GO engine - but I really have no notion of how much work this might be. I know some people who were working on a mdl decompiler called Crowbar and I think it's quite complicated... so getting an smd importer that is capable of correctly reading all the data in the .dmx and .qc files maybe quite a bit of work.

For the moment if I want to import a character model from an smd file my solution is simply to use max2012 with wunderboys importer http://www.wunderboy.org/apps/smdimport.php ... sometimes the animations can get a little weird, but normally the mesh, bones and skinning info comes out ok.


*So far as I know there is nothing that will allow animation files (.mdl and .ami) to be decompiled into a format that can be imported into Max. Most character animations are kept separately in these files rather than being compiled directly into the model as with weapons.

CaptainCrazy

Thanks, i just can't seem to find any decent tutorials out there on how to do this but if you know of any then that would help me a lot!

I'll try Max 2012  ;D

K@rt

What is it you do want to exactly?

I just spoke to shawn and he explain to me a bit clearer. If you are trying to use the existing animation files to animate your model then all you need to do is add

$includemodel "<path>/<filename>.mdl"

to the qc file.

The only thing is that the skeleton HAS to be identical - normally its best to use a decompiled one.

CaptainCrazy

#4
***EDIT***

Just read your comment, yeh that's pretty much it and maybe that's the problem... I'm trying to use a skeleton from DeathMatch for CSS.  Well a skeleton from HL2 actually that i got from Valves website..


For now, I just want to export a biped rigged to the Valve skeleton (from 3DS Max) and use CSS animations, just so i can get the hang of it you know?

I'd also like to do it for Deathmatch possibly.

So to recap.

Export a Valve rigged character from 3DS Max.
Import it into Source.
Have that character use the Source animations.
Be able to use it in a game.

K@rt

Yes I think you have it. The HL2 skeleton rigs and the CS:S ones are similar but NOT the same... and even one extra bone I think would mess everything up.

If you want to use the CS:S animations; decompile one of the T or CT models, import into max (using wunderboys importer) and delete the mesh so you have just the skeleton. Now take your model and add a skin modifier with the skeleton from the decompiled model. Weight your model the way you want. Then when you recompile just add to your .qc the following

$includemodel "player/cs_player_shared.mdl"
$includemodel "player/ak_anims_ct.mdl"   OR   $includemodel "player/ak_anims_t.mdl"  (depending whether you used CT or T model)

If you want to use the HL2DM animations then you must do the same with a charater from that game instead.

CaptainCrazy

Understood  ;D

I can't quite find where to, well, find the CSS player models and such though only the HL2 ones under the .GCF?

K@rt

Think it depends whether you game has been Steam piped. If it HASN'T been piped then they will be in:

Drive:\Program Files (x86)\Steam\steamapps\counter-strike source shared.gcf

and if it has been piped it should be in

Drive:\Program Files (x86)\Steam\steamapps\common\counter-strike source\cstrike\css_pak_dir.vpk

(not sure if its css_ or something else, but close to that)


Here is the smd for a custom Counter-Terrorist model I just grabbed from Gamebanana and decompiled:

https://www.dropbox.com/s/ifnc8q2l6ed23j9/ct_gign_soldier.smd

and here is the ragdoll sequence that is compiled directly into the model:

https://www.dropbox.com/s/6srn82mj5ndoxh3/ragdoll.smd

(not necessary to import ragdoll into max, just add it back into the .qc when you recompile your model using

$sequence ragdoll "ragdoll" ACT_DIERAGDOLL 1 fps 30.00

CaptainCrazy

#8
Thanks i did know where they were earlier but it kept telling me nothing was in them .VPK files so i downloaded GCFScape and it works now  ;D


Can't seem to get the bones to export with the model though which kinda sucks because i need the skeleton from it.

K@rt

Im afraid I have no idea what your level of knowledge is about all this. To export the bones with the model you must use a skin modifier. With your character model object selected you drop down the modifier stack until you find "skin" then add it.

After that you must add the bones into the modifer using the "ADD" function in the modifier properties. You add ALL the bones here.

Finally you must set all the weights correctly in your skin modifier (which is a pain and takes ages)... you basically need to tell each vertex which bone moves it, some vertexs will be moved by multiple bones. Here is a simple explaination of weighting on an arm:

http://www.youtube.com/watch?v=y9-y1bJjoWo

When you export/compile you model the bones and weights will be in the main mesh smd file... you can tell if the bones are there correctly as the smd will start with a list of "nodes" one for each bone. With smdexporter (wunderboys) you simply select everything and export to smd, WWMT should recognise the skin modifier and export all the bones and mesh into the smd.

CaptainCrazy

#10
No no i don't mean that, i know how to skin a mesh to a skeleton... I mean when i de-compile the .MDL for use in 3DS Max, only the model gets de-compiled, no skeleton with it, the skeleton i need to use in order to skin a character to.

Okay tried it with a CSS skeleton and the same problem persists and my friend said my .QC is waaaaaay too small.  I guess i'll just have to give up hope that WW can do this and go back to the annoying old ways lol.

wallworm

I think you need to realize that WW is about CREATING new content.

This is what you are going to need to do:

Build the model in max with a skinned mesh that is skinned to all the bones. Make sure all bones are named/oriented the same as in the original Source model.

Then export the MDL in WW. Now open the included QCI file and paste into that file ALL of the QC commands that are from the original Source player model except for those that are in the Wall Worm-generated QC.

At this point, all files referenced from the QCI must be reachable from the path where the QC/QCI resides. So if Wall Worm outputted your QC into player/mymodel.qc and you want it to reference the correct animations from other files, you must make sure that those files are referenced correctly. SO if you need a QC that is at player/model1/animations.qci but your reference to it in the QC is just animations.qci, you need to edit those lines. The same with SMD files... and the included QCI files.

It's all about file system paths and the compilers knowing where to look for everything.

The whole point of the QCI that WW auto-generates is so that you can do all the extra things like add animations from other files. The WW QC is not too short... it just is missing all the extra animations that you must reference in the QCI. You can edit this in Wall Worm by clicking the QCI button in the main UI.

K@rt

Quote from: CaptainCrazy on October 22, 2013, 02:09:01 PM
Okay tried it with a CSS skeleton and the same problem persists and my friend said my .QC is waaaaaay too small.  I guess i'll just have to give up hope that WW can do this and go back to the annoying old ways lol.

The skeleton isn't in the .qc file, it is in the base meshes .smd file. The .qc file only contains info about jointconstraints and bone merging and even with a full working skeleton will only be 5-10Kb....  i don't know in your friends world what "waaaaaay too small" corrosponds to, but in real terms gonna be about 7-8Kb at most**

But you don't need to try and tell from the size fo the .qc file... just open it in notepad - if you get jointconstrain and bonemerge and sequence info in it then it means the skeleton IS getting decompiled but you're not importing the .smd correctly into max. If the decompiled .qc file doesnt contain that info (and as I said before, if the main mesh .smd file doesnt start with a node list) then it means you are decompiling the models incorrectly in the first place.

Normally CS:S models are EASY to decompile and even the old, unedited versions of MDLdecompiler can handle them. With some later models (IDST1 format) MDLdecompiler won't work. Look for Crowbar, but I don't know if it has gone on general release yet or not.

The dropbox link I gave you above (to a decompiled custom CS:S model) contains a skeleton which imports fine into max. Now this is from somebodys custom model so it is still probably better to goto the Source original models... however the point is it works - try importing this and if you can't then its you who is making mistakes because I imported it fine.

Like I said before if you use the WW importers then you may lose the skeleton when it is imported, but its there in the smds so just use wunderboys importer instead.



**Oh, and as a foot note, in the meshes SMD file the skeleton itself will take up about 6kb of the total file (which will probabaly be between 1500-3000Kb in total) and the weighting info will probably be upto 500Kb in size, depending on the complexity... so it is pretty much impossible to look at the size of an SMD file and KNOWwhether the skeleton is there either.

CaptainCrazy

Quote from: K@rt on October 23, 2013, 12:00:15 AM
Quote from: CaptainCrazy on October 22, 2013, 02:09:01 PM
Okay tried it with a CSS skeleton and the same problem persists and my friend said my .QC is waaaaaay too small.  I guess i'll just have to give up hope that WW can do this and go back to the annoying old ways lol.

The skeleton isn't in the .qc file, it is in the base meshes .smd file. The .qc file only contains info about jointconstraints and bone merging and even with a full working skeleton will only be 5-10Kb....  i don't know in your friends world what "waaaaaay too small" corrosponds to, but in real terms gonna be about 7-8Kb at most**

But you don't need to try and tell from the size fo the .qc file... just open it in notepad - if you get jointconstrain and bonemerge and sequence info in it then it means the skeleton IS getting decompiled but you're not importing the .smd correctly into max. If the decompiled .qc file doesnt contain that info (and as I said before, if the main mesh .smd file doesnt start with a node list) then it means you are decompiling the models incorrectly in the first place.

Normally CS:S models are EASY to decompile and even the old, unedited versions of MDLdecompiler can handle them. With some later models (IDST1 format) MDLdecompiler won't work. Look for Crowbar, but I don't know if it has gone on general release yet or not.

The dropbox link I gave you above (to a decompiled custom CS:S model) contains a skeleton which imports fine into max. Now this is from somebodys custom model so it is still probably better to goto the Source original models... however the point is it works - try importing this and if you can't then its you who is making mistakes because I imported it fine.

Like I said before if you use the WW importers then you may lose the skeleton when it is imported, but its there in the smds so just use wunderboys importer instead.



**Oh, and as a foot note, in the meshes SMD file the skeleton itself will take up about 6kb of the total file (which will probabaly be between 1500-3000Kb in total) and the weighting info will probably be upto 500Kb in size, depending on the complexity... so it is pretty much impossible to look at the size of an SMD file and KNOWwhether the skeleton is there either.

Well she showed me her .QC file for a standard character with no new animations and it had a long list of things in it regarding joints and such.

In model viewer the skeleton rig seems to be horizontal on the floor yet the character mesh is vertical as it should be.  Even if i enable or disable the rotation option in WWMT it makes no difference.

wallworm

Here are some ways to avoid the rotation problem. Make sure you save scene before trying any of these options.

* Try turning off Use Local Origin as World Origin.

* Instead of above, try rotating the pivot of your main mesh by 90% in the axis that would then re-orient the skeleton. (Perhaps so that it is aligned to the same orientation as the root bone in the rig).

* Try both above options

* Open your model in WWMT, then open WW > Wall Worm Model Tools > Bone Tools and select the root bone in the rig and press the button to Assign Bone then the button to make this the origin node... then turn back on the Use Local Origin as World Origin option above.

Hopefully at least one of these steps will help solve the problem of the rotated skeleton. If one works, share the option.

I simply don't import models except for testing/solving other peoples' problems... so I don't momentarily have the best set of steps for the import > re-export process.

SMF spam blocked by CleanTalk