• I need help animating Gmod player models
    59 replies, posted
I've recently been looking into making some player models, or rather, adding animations to some ragdolls, I was wondering, what program do people use to animate? Or is it a case of adding Half life 2 animations to the models that you have created? Because I have the models I need and I was wondering how I would go about it, I've been unable to find answers to this pulling peoples other creations apart to see how they work. So, if anyone has any links or guides on how to animate models to make player models out of ragdolls it would be much appreciated. I'm finding it very difficult to find a place to start and the internet is very unhelpful. I would like if someone was to give me some pointers and tell me where to start. However, searching around the internet has revealed that it may not be possible to create player models out of certain ragdolls, as such, if the Madoka models from the aptly named Madoka magica pack cannot be animated as player models, then I would rather know sooner than later. Thankyou. In edition, is there any way to open MDL files? I was unable to find something that would allow me to convert MDL files into something that I could open with a model tool, so I instead downloaded the source models, these however are saved in a pmd format, which is even harder to convert, so it would also be useful if anyone knew of a tool for allowing me to open the contents of mdl files.
[url=http://wiki.garrysmod.com/page/Player_model_compilation]This[/url] and [url=http://wiki.garrysmod.com/page/Player_animations]this[/url] should help you a bit.
Ah yes, they seem like they're going to be useful, I finally have a basic outline, I just need somewhere to start, not to mention, I still need a program, would Source model viewer let me add animations to my models? Only problem is I need to get that thing running first. Thank you, what you linked will be helpful.
[QUOTE=Countbuffalo;43998582]Ah yes, they seem like they're going to be useful, I finally have a basic outline, I just need somewhere to start, not to mention, I still need a program, would Source model viewer let me add animations to my models? Only problem is I need to get that thing running first. Thank you, what you linked will be helpful.[/QUOTE] Your best bet for animation would be 3dsmax. Its what Maxofs2d uses. A free alternative would be blender.
Okay, I did look at blender, but I thought it was more a case of making animations frame by frame than adding frames for games. File conversion is a problem, though I think I've got that, the only problem is these VTF and VMT files that I have, I have a guide here and it says that the textures are saved as .TGA files, though none of the mods I have use TGA, so I'm guessing that would be out of date. [editline]22nd February 2014[/editline] I managed to convert the models into something that blender could open, however, I'm not sure if I've done it correctly, the only model that blender can open is the physmodel.SMD file, which I think is the models skeleton? It's basically a lot of simple shapes with a load of bones. I'm feeling pretty confident that this is what I need, but I'm not completely sure. Edit - Yeah, it looks like the skeleton alright, the only thing is, do i edit the skeleton for animations or the model itself, hoping it's the skeleton as the model isn't showing up for some reason.
Thinking about it, maybe it would be best if I explain what exactly I've got at the minute to make things easier for anyone who knows what they're doing with this kind of thing, I'm going to compare what I get with Urdnot Wrex model I just quickly grabbed off the workshop, hoping that it doesn't use source skeleton, and if it does then, well, I guess I know that I know I can probably do the same thing. So, at the minute I have the Madoka magica model pack and the Urdnot Wrex pack, both as GMA's, I unpack the GMA's into the usual files (models, materials, LUA etc), then I convert the MDL's into SMD's so i can open them with blender. Okay, so here's what I get from converting the MDL's into SMD's (it's rather worrying): Urdnot Wrex (going to use him as a sort of control), has the following files: Coach.SMD 20kb - Opens in Blender, very similar to the phymodel. Lots of joints connected together phymodel.SMD 83kb - A physics model, opens in blender, simply a load of simple shapes connected to form a simple looking, crash test dummy kind of human ragdoll.SMD 20kb Wrex.SMD.SMD 3,728kb - opens in blender, untextured version of the model. As opposed to Madoka herself's MDL file : Madoka.SMD 10kb - doesn't appear to actually be viewable in blender, opening it causes nothing to happen phymodel.SMD 47kb - Openable in blender, combines the skeleton and physmodel together in one file, somehow still half the size of the Rex physmodel. ragdoll.SMD 14kb More worryingly is the fact that out of the three Madoka files only phymodel.SMD shows up in blender, I'm not sure whether to think that the MDL file has been unpacked incorrectly or not, since the models work in GMOD, heck, they work as player models, the only problem being they lack animations. Looking at the files I get, ragdoll.SMD is an easy one to figure out. I'm guessing phymodel.SMD is the skeleton? Is that what I would animate? Of course, looking at Wrex's files, it seems that maybe Coach.SMD is the skeleton, Wrex.SMD.SMD is the actual model. I'm a little confused where on earth my Madoka model disappeared to during conversion. Ah, it appears that with the Madoka model, the phymodel.SMD includes the skeleton (whatever they're using instead of Coach.SMD)
I'm not sure if someone actually explained this yet or if you figured it out yet, but I'm not sure you're looking for any actual animating. Firstly, it would be an enormous waste of time if every single model had to be re-animated. To work around this, a skeleton was created. Rather than animating each individual model, it is rigged to a skeleton. The skeleton is what is animated and in source the animations are stored in a separate file which can be linked to the model you use. This method is used so all of the animations used are only made once and only stored in a file once rather than repeatedly. This only really changes for models that have a different skeleton or different animations. Chances are the model you're wanting to make a playermodel already has a skeleton, but the names, sizes, and proportions are different enough to cause issues resulting in the model probably not even working. When you set up a model to be a playermodel in Garry's Mod, it's going to need to be set up to work with the standard playermodel skeleton. This usually means that you'll spend a few hours, days, or weeks depending on your schedule making sure the model fits the skeleton properly rather than re-animating hundreds of animations for every model. The only major downside this method has is that it needs to fit on the skeleton properly. Models can have the proportions adjusted to fit the skeleton properly, but some require so much work that the model won't look the same in the end. The krogans from mass effect for example probably won't work as playermodels. There are also some that may fit, but won't look right. Space Marines are technically humans but they're way too bulky to fit on animations made for someone of a much more standard frame. As for what rigging is entirely; it's usually just a matter of making sure it looks good on the animations. You're responsible for aligning your model to the skeleton and adjusting the proportions if necessary. Other than that you're the one that controls how the model deforms when it moves. The game doesn't know that your legs shouldn't be attached to the arm bone until you tell it that (though by default it attaches to the nearest bones). Primarily, you're just there to make sure joints bend smoothly which most people tend to ignore completely. If you take a look at the CSS playermodels for GMod used in TTT and such, you'll notice that they don't actually bend smoothly at all. I'd reccomend you look at a couple of these models to see what a bad rig looks like. Anyway, sorry if you've already learned any of this, but it should cover the basic overview.
Ah, thank you, someone who is telling me what I need to know. So it's simply a case of converting my skeleton to be compatible and then adding the animations? How will I know when my model's compatible, will the animations work when I add them to the model? Also, where exactly would I find the animation file I need? As well as the skeletons, as I cannot find the default Half life skeleton in my Gmod or Half life 2 folders. Hold on, nevermind, I found the animations in my SDK files. male_animations_sdk looks like the right folder, but, rather than one single file it's a lot of SMD's and some QCI files. I'm guessing QCI is the actual config folder, and SMD is the animations model. Looking at the SMD's with blender, yeah, that's what I need, now I need to figure out how to apply that to the models I have. Is there anywhere people learn all this stuff? Or do you just learn it as you go along. So, I'm guessing if I can link animations with a MDL file, then there is no reason to unpack it.
To give people a status update on my project. Good news! I've discovered that these models do in fact use the Valve_biped skeleton. Which means I can add the Source animations, hurrah! That's probably the final obstacle, well, besides compiling this whole thing again. At the minute I've got a QC file which was created when the model was decompiled, it's got everything I need but the animations. I've noticed that the source SDK animations folder has several QCI files in it, and I was wondering if it is simply a case of copying from one file to the other? Okay, I may have another problem as well, attempting to compile the model results in a lot of errors, a LOT of errors. I'm going to try and take a look by myself, but it's highly likely I'll end up posting the error log here so some experts can have a little look at it. Nevermind, that was me thinking adding animations would be as easy as a simple copy and paste. I only have a few errors now, which is strange as I have touched absolutely nothing since I unpacked this thing. Looking at the error message, it appears that it can't seem any bones for something called bbox. Which is a bounding box, apparently, I'm guessing I need to add one to my entity (Madoka) in order for it to compile correctly?
You shouldn't need to even touch any animations unless you want anything custom. Animations that are shared in larger amounts are usually stored in their own file. The QC command "$includemodel" allows your model to look for and attach a different model file with itself. In GMod for player animations, this would be: $includemodel "f_anm.mdl" $includemodel "m_anm.mdl" M and F simply depend on whether you want the model to have male or female animations. By default it searches in the models/ folder which means this would look for models/f_anm.mdl or models/m_anm.mdl. As long as the files linked exist (In Gmod's case, these do), the animations will be linked to your model automatically without needing to actually compile them into every model using them. Note that these animations are built for the gmod playermodel skeleton. Aside from that, I wouldn't bother tweaking your skeleton to match. Custom skeletons are usually built for the proportions, models, movement, and so on that the company is looking for. Skeletons from different games tend to be different by just enough to make things hard. For the gmod playermodel version, you'll want to just delete the skeleton and rig the model to the gmod skeleton. Once that's complete, bbox should be working as well and you can just adjust anything else from the valve base. Sizes and proportions need to be adjusted differently. All players in gmod have relatively the same height excluding any protrusions from the head such as horns. Any characters meant to be small such as children, chibis, or anything similar will usually need to be sized up to fit the skeleton anyway, but they can be scaled back down in-game with lua.
Okay, you've been very helpful, it's a lot more simple than I was making out, then? That's good, one last hurdle to go I think, that's the cannot find bone for bbox error, does this mean that the model isn't going to work, if that's the case it's strange as the QC labels it as a ValveBiped.Bip01 file. Would I need to specify the size of the bbox using the QC file? Or rather, would it be a case where I have to see if these coordinates actually match up? Of course the coordinates problem brings something else up, since it seems to be off by a lot. Coordinates in the SMD for the ValveBiped.Bip01_R_Finger01 -0.731 -0.405 -0.282 1.732 0.910 0.842 Coordinates in blender for the ValveBiped.Bip01_R_Finger01 -4.0153, 40.3945, 0.2867
As long as your skeleton exists in the reference file and your model is attached to it, you should be fine on the bounding box. The pelvis is usually the root bone. As for coordinates, it looks like your blender coordinates are absolute while the SMD coordinates are relative. In other words, the coordinates in blender lead to the location of the bone whereas the coordinates in the SMD lead to the location of the bone relative to its parent bone. The additional 3 sets of numbers would probably be the angles. Unless you see anything misplaced in modelviewer when you get it compiling, it shouldn't be a problem.
Yes, well, the problem is that I can't actually compile the files into an mdl, the mdl studio tells me that it can't actually find the bone for the model, the log for me attempting to compile my model is as follows: Created command line: "C:\Program Files (x86)\Steam\SteamApps\common\SourceSDK\bin\orangebox\bin\studiomdl.exe" -game "F:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod" -nop4 -nox360 "C:\Users\Alexander\Desktop\Madoka model\Unpacked MDL\mdldecompiler.qc" qdir: "c:\users\alexander\desktop\madoka model\unpacked mdl\" gamedir: "F:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\" g_path: "C:\Users\Alexander\Desktop\Madoka model\Unpacked MDL\mdldecompiler.qc" Building binary model files... Working on "mdldecompiler.qc" SMD MODEL C:\Users\Alexander\Desktop\Madoka model\Unpacked MDL/madoka.smd SMD MODEL C:\Users\Alexander\Desktop\Madoka model\Unpacked MDL/ragdoll.smd SMD MODEL C:\Users\Alexander\Desktop\Madoka model\Unpacked MDL/phymodel.smd ERROR: cannot find bone ValveBiped.Bip01_R_Finger01 for bbox ERROR: Aborted Processing on 'MMD Misc/Madoka.mdl' I can't quite understand why it can't find the bones since the QC file is premade, it was created when i decompiled the mdl, and I assume that it would simply be a case of recompiling it, that doesn't seem to be how it works, though.
Oh, that? I used to run into that all the time for toes a few years ago now that I think about it. If I recall I only had this issue on decompiled models and I always just cut it from the QC, though I'm pretty sure there's a better way to go about it. Would you mind posting your QC?
Of course I wouldn't mind posting it, I'm guessing there's no way I can do it through the forum, I'll quickly find somewhere that will host it and then I'll link it. Here you go : [url]http://www.mediafire.com/download/5m9udrxgnqmu5bs/mdldecompiler.qc[/url]
If it's a single QC file, you can paste the contents in your post inside code tags or you can just use pastebin (just for future reference). Anyway, [url="https://www.mediafire.com/?88d9cy7xftb2jsc"]this[/url] should make it easier to work with at the least. It's mostly the same with content organized and a few unnecessary things removed. I did drop a new set of hitboxes on her (which you may want to adjust if it's a playermodel) along with a bounding box. I'm not sure if it'll actually help or not, but it's worth a shot. Other things that may help: - It looks like the skinfamilies don't even do anything. There probably isn't much use in having a second skin that doesn't change the textures used. - The model is decompiled. I guess I can't be even more obvious that that, huh? Anyway, decompiled models tend to have all kinds of issues and a lot of data is truncated from the QC. It's pretty rare that it'll go back together in one piece with a single compile. - It looks like the model is pulled right out of Left 4 Dead. You should consider changing the material paths and such; right now they point to replacing Ellis's. You might also be lacking proper animations if you're intending for this to be a GMod playermodel. Looking at your first post; are you still looking at wanting to deal with PMD files?
I'm willing to deal with the PMD files, though you must understand I don't have the foggiest idea what to do. As for compiling, maybe I should get a better tool than GuistudioMDL because it seems to cause nothing but problems, it refuses to open your QCI files, but it's like you said, chances are it won't compile itself first time. So I guess in order to start compiling I need to ensure that the QC has everything it needs, or have you already taken care of that? As for changing the material paths, that's going to be in one of the QCI files, the files have attachments for left 4 dead, hey, I could put them in Left 4 dead, though , I'm getting ahead of myself, focus on Gmod for now. If we start with the PMD's we'll be at square 1. So, I'll probably try some last efforts to use the models I've got, then we can take a look at the PMD's. Thankyou for all the help you're giving.
If you're using 3ds max, you can get [url="http://www.vocaforum.com/showthread.php?t=1644"]mariokart's import script[/url] for PMD files. If you're using Blender, you can get the MeshIO tools for PMD and PMX files. You'll probably want to fix some stuff up such as smoothing, but it should be relatively clean for the most-part. As for the QC files, the QCI files are basically linked with the QC file. You don't compile each QCI file if that's what you're trying to do. Essentially, that just allows you to split your QC into different files because packing your model with optimization can result in very, very large QC files that you'll want to keep organized. I compile things using studiomdl just fine. GUIStudioMdl is the exact same thing with a GUI slapped on the tool to handle commands. The QC I gave you should be exactly the same, just cleaned up and organized so it's easier for you to work with. The only actual changes were me removing unused data, though I also changed the hitboxes and added a bounding box which I'm hoping might fix your issue. If it doesn't, at least your QC is [hopefully] easier for you to deal with. Long-story short, it should have exactly what you need if you just compile it using the madoka.qc file. You might need to use the PMD files in the end, though. What you have now would be good for Left 4 Dead if you add a few other things, but I'm not sure it'd work on a playermodel if it's built for L4D2 instead of Garry's Mod unless you want to use Left 4 Dead animations instead. The skeleton is just a bit different, though you might be able to get away with just reorienting a few bones as well to save some time -- it's pretty lazy but most anime models in Source are extremely low quality anyway. Even then, I'm cheating the same way with Miku: [img]https://db.tt/JWjPpIpI[/img] Anyway, let me know what happens and we'll go from there.
Well, it looks like compiling what we've got at the minute isn't going to work, all I'm getting is a : Error opening c:\users\alexander\desktop\madoka model\madoka model\QCI/ragdoll_BRS.qci error. I guess maybe it's best to start with the PMD models, the only problem is I've opened Madoka up in Blender and, well, it looks far too complicated for anything that would ever go in Gmod. It has a skeleton, but that might need changing, since it seems far too complicated for source, I'll link you a download to the PMD file I'm going to start with in case you need to take a look. [url]http://www.mediafire.com/download/3z0bjfpf01amy2m/md_m.pmd[/url]
Ah, sorry about that. Change this line in madoka.qc: $include "QCI/ragdoll_BRS.qci" --> $include "QCI/ragdoll.qci" As for the madoka model, keep in mind the model is made for MMD. In other words, you're seeing the model, physics model, skeleton, and sometimes camera, lights, and so on all merged into a single file. I usually just delete everything that isn't the mesh and rig it from scratch. If you want it to be a playermodel, it's going to need to go on the gmod biped in the end anyway. If you just want it to be a ragdoll or something, Source tolerates skeletons up to 128 bones, so that one should work fine.
Sorry to bother you again, but the compiler still doesn't want to work, I went and changed the path in the QC because I'd tidied up that area, the error now is that it can't load the files, does this mean that the path is linked to the wrong place? Is it a case of being unable to open the file because it can't find the file or because it can't actually open the file. It's rather strange that the / for the Madoka.smd file is facing the other way, does that have something to do with it? [B]could not load file 'C:\Users\Alexander\Desktop\Madoka model/madoka.smd'[/B] Actually disregard most of that, that was my own fault, id put the path as "C:\Users\Alexander\Desktop\Madoka model", rather than "C:\Users\Alexander\Desktop\Madoka model\Madoka model", so that was down to my own stupidity, this time however, the error is: [B] 'C:\Users\Alexander\Desktop\Madoka model\Madoka model/..//phymodel.smd'[/B] It's strange, do the QCI files have their own path's inside them that I edit, and with the /...//phymodel.smd, I'm not really sure where exactly it's trying to find this file. Actually, the path looks like the $pushd that you put at the top of the ragdoll qci folder. Okay, i deleted that, and it works now, almost, it's come full circle and I'm back to the 'can't find bone for bbox error' again. In regards to the being unable to find bone error, there is only one instance of a ValveBiped.Bip01_L_Toe0 bone anywhere in the QCI folders, and that's in the hitbox.qci file [editline]27th February 2014[/editline] Okay, sorry about how I write these, I'll write a post, find something new, and edit my own post until you end up with a wall of gibberish which is mostly useless, after deleting both of the Toe bones it has almost compiled, all that's missing now is to open the Madoka.mdl file, seems a strange thing to do considering the tool is making said MDL file, but it says check for write enable, so I'll have a look at what that means before I come back again, hopefully with a finished product, then I'll have to look at how you've done what you've done so I can do the other girls. [editline]27th February 2014[/editline] Latest update - I managed to get it compiled, and it shows up ingame as a playermodel but for some reason the model doesn't physically appear, do you think I've messed up with the autorun lua? The Lua is as follows: player_manager.AddValidModel( "Madoka Kaname", "models/madoka.mdl" ); list.Set( "PlayerOptionsModel", "Madoka Kaname", "models/madoka.mdl" ); Fixed up the Lua a bit, I added a 'player' folder under 'models' , that fixed something, she now has an image for when you select her with the menu, the new Lua reads player_manager.AddValidModel( "Madoka Kaname", "models/player/madoka.mdl" ); list.Set( "PlayerOptionsModel", "Madoka Kaname", "models/player/madoka.mdl" );
Sorry about that, I probably should've checked with you to make sure the paths were correct since I didn't have the other files. Where are you at right now?
At the minute I've got the GMA folder, which decompiles down into three files, models, materials and lua, inside of models is a 'player' folder which contains the VTX, MDL and PHY files. inside of materials a file called models, and inside of that are the textures for Madoka, saved as VMT's and VTF's. Finally there is the Lua folder which contains the 'autorun' subfolder, the Lua uses the code at the bottom of my last post. If you want I can link the decompiled folder for you.
I meant the paths in the rebuilt QC. Where are you at right now in terms of getting the model into the game? Any issues still?
I've successfully built the QC into an MDL and placed it with all the necessary contents needed to make a playermodel, the textures and LUA and such, the problem is that the actual model does not appear, it is invisible to me. Does this mean that there are missing files?
If it were missing files, you'd probably end up with errors and such instead. It could have issues while compiling. Go ahead and send me the files and I'll see if I can get it to compile after some sleep.
Okay, I've pasted the link to what I compiled into the GMA. It contains all that we should need, models, textures, lua. Lets hope we can get this thing working, I don't really know how to thank you though, when it does work. Listing you as a contributor and giving you credit is the least I can do. [url]http://www.mediafire.com/download/zufh9g54tzw9f9f/Madoka+Kaname.rar[/url]
Realised that I might have got confused with what you meant, I've given you the files for compiling the GMA, but I've realised that you probably want the files used to compile the model, considering that seems to be the problem. So, I'll link the files used to construct the Model in case you need them. [url]http://www.mediafire.com/download/qffyzm381nudyc2/Madoka+Kaname+model+components.rar[/url]
Firstly, here's a quick little explanation you'll need for modeling. The model essentially stores the paths the model files are meant to be located in. It also stores the path to the materials as well as the names of each material used. The materials then list what paths the textures are as well as the name they use. If you decide to change any of these paths, it's perfectly fine, but you'll need to change the paths the model uses or nothing will really happen. Here's the lines we're looking at: QC: $modelname "player/madoka.mdl" $cdmaterials models\madoka For the VMT: "$basetexture" "models/madoka/texturename" Note that the model and VMT both look in the materials folder automatically, so this path actually means materials/models/madoka/ . Moving on, I see exactly why your model is having issues. First of all, the skeleton is located at ridiculous coordinates. Usually the pelvis is at about 0, 0, 30 but this model's pelvis is at -65248.0, 128960.0, 0. Aside from ridiculous coordinates, the reference model has no data related to the mesh at all. In other words, there's nothing actually containing the madoka model itself aside from the skeleton it was meant to use. I'm not sure how this model is decompiled but I'm not sure it's going to work. Thankfully you have PMDs importing now, right?
Yes, I've managed to import the PMD models into blender, all I've done is import Madoka and this one's already looking better than the other one. This time there's actually a model, as well as a skeleton and something else, I'm not sure what this third thing is, it's a series of tubes and boxes that seem to fit inside the mesh, but I'm not too sure what that's for, looking at how it can be edited, it might be to do with weight values or something. Now that I have this, I'm assuming that the skeleton is not going to work with source, so, would it be easier to touch up this skeleton? Or to use the old physmodel.SMD from before and touch up the coordinates?
Sorry, you need to Log In to post a reply to this thread.