|
Post by HellCattX on Nov 1, 2008 13:05:00 GMT -8
Modeling tut
This is a short but COMPLETE tutorial. I take for granted that you KNOW how to operate a keyboard and mouse! (Therefore, CS noobs this tutorial is NOT for you!
Step 1: Choose your model carefully.
Essentially, this is so you don't replace a machine gun with say, a pistol! Looks very bad, and the anims would be very weird. Well.. not so much as the anims, but the feeling of it ingame is enough throw you off.
Replacing an assault rifle with a submachine gun is ok (and vice versa), Shotguns for shotguns, Pistols for pistols, etc.
Also, when you download a custom model, say.. from CS-skins.net, check with the author before you release. They worked hard on their models. Don't just give them credit in the .txt file. EMAIL THEM!
Step 2: Check the animations.
Some mods have more anims then others for their weapons. But usually, all mods that have guns have idle, reload and firing anims. So unless the mod is very different, there shouldn't be any problems.
What to do: -Open the model that you want to replace in FA with HL MODEL VIEWER -Write down each name of every anim for that weapon in a .txt file. This is important, you'll need the names later on. -Open model from other mod in HLMV. -Check it's animation's names.
If the anims match(very rarely), your done! All you gotta do is take the model from the other mod's /model folder (or .pak file) and put in the firearms/model folder. No recompiling necessary
Step 3: If the anims DO NOT match (more anims, other anim names, etc)
What to do: -Copy the new model into another folder -Open Milkshape 3D -Decompile the model via Tools<Half-life<Decompile normal HL .mdl file -Leave ALL of the boxes CHECKED.
This will "unzip", if you like. the .mdl file into the folder it currently is into several files. (.smd, .bmp and .qc)
-Open the .qc file with NOTEPAD.
At the bottom of the .qc file, you will see something like this: Code:
$sequence animation1 "animation" loop fps 30 ACT_IDLE 1
$sequence: animation1: This is the name .smd file containing the animation. "animation":This is the name of the anim as it appears inside HLMV. Loop doesnt really matter unless it is an IDLE animation, an animation that can be played over and over again (like the breathing of the player model when its not moving)
Since the name in between the " " 's don't match the ones from the FA model you want to replace, you have to rename them. (Thats why i asked you to write down the names of the anims from the FA model your replacing in the first place!)
Step 4: Renaming
What to do:
-Rename the anims that fit the FA ones the most by changing the name between the " " 's.
Like, if the model from the other mod as a single "idle" anim, and the FA model's idle anim is called "idle1"... well.. add the 1! DUH! And as i said before, some models from other mods have different number of anims.
If it as MORE animations, there's no problem. FA simply doesn't use the excess ones. You could delete the lines in the .qc file, but it would still work perfectly.
If it as LESS, then there is a problem:
Some of the FA anims are unique... but can be copied! Most notably is the reload_empty animation is the major problem in converting weapon models. FA as 2 reloads. 1 for if the weapon still has a bullets in the magazine, and 1 for when the gun is completely empty, thus, it will not only reload, but recock the gun as well.
What to do: -In the .qc file, copy the whole line of the "normal" reload anim and paste it after all the others. -Rename it to reload_empty
Your model will now have 2 anims that are exactly the same, but will make it work in FA. If there are any other anims that are missing, repeat this process with the most appropriate anims:
Like, if a model as a single "idle" anime and FA as "idle1", "idle2 and "idle3", copy the idle anims 3 times and rename them!
But if the new model has, let's say, "shoot1" and "shoot2", and your replacing a model with just a "shoot" anim, well then, pick one of them! And rename it to "shoot".
After this, don't forget to save the file!
Step 5: re-compiling This is easy...honest!
What to do: -in Milkshape 3D, go to Tools<Half-Life<compile .qc file -Select the .qc file you just edited (of the new model, duh!) -Press ok. -Let her rip!
If all goes well, you'll have a brand new .mdl file. Check it's animation's name and compare them to the FA weapon you want to convert and see if its all right. The ORDER in which the anims are in does not affect FA in anyway. Afterwards, copy the new .mdl file in your firearms/models folder and you're set!
PROBLEMS you might encounter:
If the model is misaligned ingame, use this tutorial to correct it.
It's the best way.. trust me.. i know...
There are also tons of problems that can occur during compile. IF you didn't do ANYTHING but rename the .qc file and you get an error during the compile, it might be that you mispelled something. Check the .qc file again.
Ending statement I made this tutorial to increase the visual quality of FA. I DO NOT SUPPORT MODEL RIPPING IN ANY FORM. So please don't do it! ok? Got problems? TRY STUFF BEFORE YOU POST HERE! Trying is the god damn best way to learn stuff.
It's late.. i need coffee!..
------- BP's "How To Convert a Model" tut 102 -------
Ok class, listen up. 101 was just to show you how to make a direct conversion with the .mdl file.
Now i'm still filled with alchool right now, and im writing this on the top of my head so.. yeah.
In this class, 102, you'll learn how to do a FULL conversion of a weapon from another mod into FireArms, which means you'll have lots of recompiling to do, and loads of bone assignement to do also, but you'll be able to use use your weapon with the FA arms.
What you will need for this tutorial Half-Life model viewer
Milkshape 3D (Any version will work, but since 1.6.0, it has a new .mdl decompiler plugin which doesn't fuck up animations anymore.. which is uber good! )
The model you want to convert. The model you will replace.
Step 0: model check First off all, like in class 101, i told you to carefully choose the model you want to convert, as not every model can be converted without reanimating it.
Obviously, you don't want to convert your "1337" Desert Eagle model from CS to replace the M60!
Pistols replace pistols SMGs replace SMGs Rifles replace Rifles HMGs replaces HMGs
and so on, but it doesn't work that way.
Now, you may ask why not replace the Sterling with a P90 for example. Well the simple fact of the matter is: HAND PLACEMENT You do NOT hold a Sterling the same way you hold a P90. And since this tutorial is to convert models WITHOUT reanimating, well you need a model that is held almost the same way that the original FA model is held. So replacing the MP5 with a UMP.45 would work for example.
Another thing to consider in choosing your model, is what key parts does the weapon have. By this, i mean the magazine, cocking handles, and bolts for rifles. This is the reason why you cannot convert a SIG 552 to replace the SSG 3000, since the SIG uses a cocking handle rather then a bolt. If the model you want convert has the same things as the model you want to replace, you're good right?
Well you're not out of the woods yet! WHERE the things are located. If your model for example uses a LEFT handed bolt, or if the cocking handle is further away along the receiver.. well you're outta luck for this model.
Now, for this tutorial, i will use my Counter-Strike AWP replacement model for the SSG 3000 if and when a more detailed example is needed. But keep in mind, im simply using my conversion as an example, and that the principles behind the conversion is the same for almost every conversion.
Step 1: Setting up your working environment This may seem like trivial step, but it's important.. trust me on this one.
First off, make a new folder (like c:\models\ to keep it short) Inside that folder, make another folder called \old\. This ensures that the files do not overwrite themselves during decompiling.. and makes everything more clean!
Now, copy the v_model you want to convert (the one from the other mod) into the \old\ folder. Then copy the model you want to replace into the c:\models\ folder.
So when i did my AWP conversion, i put the v_awp.mdl file in the \old\ folder, and the v_ssg.mdl into the c:\models\ folder.
Step 2: Decompiling the models You'll need to decompile both the model you want to convert, and the model you want to replace.
1- Open Milkshape 3D 2- Go to the Tools menu < Half-Life < "Decompile normal HL .mdl file" 3-Browse to where the model you want to convert is, and press ok. 4- Keep everything checked. 5- Press OK 6-Repeat same procedure for the model you want to replace.
Step 3: "Cutting the fat" This is where you take out all off the unnecessary parts off the model you want to convert. By this, i mean the arms and the bones.
1- Still in MS3D, go to FILE < import < Half-Life SMD 2- Select the REFERENCE .smd file for the model you want to convert and open it. Uncheck the SKELETON box.
The name of the .smd file is usually named something other then an animation name. (for example: Not idle.smd or reload.smd) If you still don't know, well then try each and everyone of the .smd files. If a message box pops up saying:
"Append Keyframes at current time?", well thats not it. It's an animation file. Press NO, and keep searching until the message box: "SMD IMPORT" comes up.
3- Now that your model is all up, go to the GROUPS tab in the Top right of MS3D 4- Click on every item that says things like "Arms", "Fingers", "thumbs", and press delete for each of them.
If you're not sure which ones to delete, just click SELECT, and the groups will be highlighted in red in the viewports.
6- Then go the MATERIALS tab 7- Select the materials that are put on the hands, arms, thumbs.. basically all the materials used on the groups you deleted just before and press the DELETE button also. 8- Save the model (like weapon.ms3d should do)
Now you have a nice weapon model to fiddle with! Yay!
Step 4: Triming the old model Repeat the same procedure as in Step 3, but this time, you'll delete everything BUT the arms AND the skeleton.
1- Still in MS3D, go to FILE < import < Half-Life SMD 2- Select the REFERENCE .smd file for the model you want to convert and open it. RECHECK the SKELETON box. 3- Do as in Step 3, but delete the weapon model instead. 4- Also delete the materials for the old weapons. 5- Save ("new.ms3d" should do)
Now you got nothing but the arms AND skeleton.
Step 5: Putting it all together Now it's time to put 2 and 2 together and do some magic! (Does it reeeeally show im full of beer right now? )
Copy the weapon.ms3d file AND it's textures to the c:\models\ folder.
With the arms still loaded up in MS3D, proceed as such:
1-Go to the FILE menu < Merge Now your arms have something to hold onto!
2- Select every group that makes up the weapon 3- Move the gun into position. This is a tricky manouver and as such, it's quite normal that this tutorial isn't meant for complete newbies. It's also why i told you to choose your models wisely. This is the time where you can see if the conversion is possible, with a minimal loss of realism.( Ie: The arms don't clip in the weapon too much , and the grips and such as where your arms are,etc)
When your new model is in position with the arms, make sure the scale is right. If the model is too big, rescale it by going to the [b¸]MODEL[/b] tab and pressing the SCALE button. In the 3 XYZ fields below, put in 0.9 OR 1.1 in each of them and press scale. This will scale down OR up your model in slow increments until the size is juuuuuust right!
After thats done, save.
Step 6: "Slap me up Scotty!" This is the step where you reassign the vertices to the right bones to make everything work!
With the weapon and arms all in place, its time to get ready to recompile. But before you do that, you need to reassign every vertices to their appropriate bone. THIS IS NOT AN EASY STEP.
Watch closely where the bones are (If you don't see them, go to the JOINTS tab and check SHOW SKELETON. It may look like a mess, but you just have to zoom in.(shift+left click and drag)
Now, this is where it gets complicated. You have to select a bone in the JOINTS tab and it will show up red in the viewports. Then according to that bone, you have to go to the MODELS¸ tab, press the SELECT button, and then the LOWER Vertex button (not the one under ROTATE mind you). Then by dragging selection boxes all over your model, select the vertices that you want to assign to the bone you selected. After all are selected, go back to the JOINTS tab, and press ASSIGN. Now, not knowing exactly which bones does what in the animation, you have to assume what they do. They are usually named differently then the ones used for the arms, or are situated inside the weapon model.
For my AWP conversion, i assigned every vertice of the main body of the gun to one bone, then assigned the vertices of the bolt to another, the bolt hand, the trigger, and the magazine and so on until every vertice is assigned. To check if you did assign every vertice, click on the SELUNASSIGNED button. The ones that aren't assigned will be highlighted red.
Also, to make sure you don't reassign vertices of the hands, go to the GROUP tabs, select the hands, and press HIDE.
You're almost done!
Save your model.
Step 7: "Export this mofo!" This is where you get ready to compile and actually do it.
1- Go to the FILE menu < Export < Half-Life SMD 2- Overwrite the old reference .smd file. At this point, if you get this message: "FOUND VERTEX WITH INVALID BONE ASSIGNEMENT!" , it means you did NOT assign every vertice. Go back, and finish the job.
3- Go to the TOOLS menu < Half-Life < Compile .qc file 4- Select the .qc file for the old weapon model, and let her rip!
VOILA! YOU'RE DONE!!!!!!!!! Woot!
Go in your c:\models\ folder and open the .mdl file you just created. Play every animation to see if it all fits well. If some parts of the mesh are all fucked up and stretched all over the place, it's most likely that you assigned the vertices to the wrong bone. Go back, and reassign them.
Assigning: First you need to have a set of vertices that can be assigned to a set of bones. If your just using a premade bone structure from another model, I advise you to take note, and write down what vertices are assigned to what bones on the original model, before attempting to assign your own vertices, because most bone structures do not have individual bone names describing what they attach to, usually they are just bone01 and so on, not even in order (as is the case with hands/arms). Now if you have all that clear, and you know which bones need to be assigned to what vertices, then you can set to the tedious task of assigning those vertices to their appropriate bone joint, not difficult stuff, but it can get aggrevating if you select 1 wrong vertice.
Exploring your Bone Structure: Now if you are making completely new animations, and you don't have a bone structure use, things get more complicated, but in my opinion, this is the BEST way to make your models, because then you know more specifically which bones control which verts. To create a bone structure you will first need to get a general idea in your mind of how you want your animations to function, if its a weapon, you will want it to be in the right hand, so you will want to branch your bone structure from the right palm (wrist) bone right, or if you don't want it to be affected by the arms movment, you will want to make sure it's not connected to any other joints when your initial bone... once you have a general idea on how you want to start, you will want to select the joint you want to branch from (or not, depending on how you want it to function) but generally speaking, let's say we are making a weapon, so we want it to branch from the palm of the hand. Well we know the palm vertices are controlled by the joint in the wrist, so we select "bone48" from the "Joints" tab to select the right hand wrist joint ("bone25" for left wrist), then while your still in the "Joints" tab, make sure that "Show Skelaton" is checked, and with the bone still selected, you will then go back to the "Model" tab, and click on the "Joint" tool, located to the right of the "Extrude" tool, and you will then click some where in your workspace where you want to place this joint, it will be the base joint for the rest of your bone structure. I suggest placing it some where you want most of the weapons action to take place on, so that animations will be easier, so take your animation ideas into consideration when placing this bone. For example if I wanted to make finger twirl animations, I would want to place this bone in the trigger guard, so that it can be rotated by the point where the finger will be. Before continuing make SURE that your bone is properly aligned with the model that you want it to be assigned to, because it will, by default, be created on all the same axis as the joint that it branches from, except the ones you specify by placing it, i.e., clicking on it from a side view will set it as far forward as you want it, and as high up, but it won't set how far over left and right you want it (from the origin) and I suggest taking some time to make sure its accurately lined up with the center of the model your assigning it to or else it will pivot offcenter. Now with this bone in place, proceed to place another joint and it will branch from the last bone you placed, so unless you want the next bone to be branched from the last bone you made, then remember to reselect your initial bone, or whichever you want to branch from. Continue adding your new bones this way until you think you have all your areas that will have some kind of animated action involved covered, and remember, place the joints where it will hinge from, not in the middle of the object, go back and assign all the appropriate verts to their new bones you made, and your set for the next step. You will want to save TWO seperate copies of this file, one as a .ms3d work file so you can come back and edit it easily later, and export another as a .smd REFERENCE file, call this file something like ref1.smd or ref.smd, you will be coming back to this file ALOT, so save backups of it in case you overwrite it.
Being a Poser: Now if you have created a new bone structure, you will have your reference file, thats great... now you need to see your new bone structure in action, so you then need to create a series of "sequences"... but before we get to the actual animating, you have a problem that must over come... you have to make a reference sequence, no not a reference file, you've done that, but now you have to make a default "pose" that will be the first and last frame of all/most of your animations, and some in between. Now this is the most preliminary of all animation, but its still animation, so keep this in mind, "DO NOT SAVE YOUR FILE!" if you save your file, it will ruin your keyframes, if you want you want to save your work, you must export to a .smd SEQUENCE file, now, to get started, we will want to click the little square at the bottom right called "Anim", this will put you in animation mode and you will no longer be able to select anything but joints, and at this point, if you would like to, you can turn off the "show skelaton" option in the "Jonts" tab, to clear up some viewing space, because you know what bones do what right? The player camera is based roughly above the origin, so you will now have to move those primary arm bones (Bone48 & Bone24) forward in front of it, and you will have to move them to the right some, this is best done through trial and error until you get a feel for where the arms should be, but I suggest first moving them so that the back end of the arm is under the origin, you will also want to drop the arms down below the origin some too... Now to check out how the arms look you must first export your animation sequence to a .smd SEQUENCE file, name it something like "idle.smd" or "idle1.smd" since that will most likely be your first animation, as it is the most simple. Then you must generate a test .qc file easily done by using the milkshape "Tools/Half-Life/Generate .QC File" option from the menu bar, now you will need to edit this .qc file, it's only text so open it with notepad, and set it up to work with your reference file, and your test idle animation, which can be done, by changing the lines: studio "./reference" to studio "(your reference .smd name here)" and $sequence seq-name "sequence" loop fps 30 ACT_IDLE 1 to $sequence "Idle" "(your test idle sequence .smd name here)" fps 30 and assuming you have textures assigned and in 256 colors, you compile this .qc file with either milkshape, or krastitatos external compiler, I suggest the latter of the two. When it compiles it will create a .mdl file of the same name as the .qc file name you generated, and you can then view it in Jed's HLMV, and goto the origins tab, and see where the arms are, and get an idea of where they need to be moved to. When you have the arms in the right position you need to start "posing" the hands and arms into a default holding pose for the weapon, here you just set to work rotating lots of joints in the hand and arm structures, and repositioning the ARMS and the weapon only, do not use the move tool on any hand or finger joints, only rotate them into place. When you finally have it in a decent enough "pose" hit control-a to select all the joints, then hit control-k, as it is your best friend while animating, control-k is the equivilant of control-s, while animating, it saves the positions of the joints, then if it checks out in the origins in Jed's HLMV, and everything seems fine and dandy, your ready to start animating!
Animatezoring: Now you think your ready to animate huh? Well you are, its exactly what you did to "pose" the shape, except with an added 4th dimension, time, your timeframe scale is located along the bottom of the screen running from the left side, to the right side, next to the "Anim" button, make good friends with this bar, there will come times when you love it, and times when you want to rip off your monitor and shoot it with your .50 BMG leg cannon, but you can't I'm sorry... just make friends with it... explore around and click and drag the little bar back and forth through the time frame, notice it does nothing... and notice the 2 numerical boxes on the right of it, those are also your friends, not as important ones, but they are still your friends, one tells you which numerical frame your on, and the other defines the number of frames to display on the frame bar, since your first animation will most likely be an idle animation I suggest keeping it some where around 30 for a good easily controlled number of frames, and remember this one thing, you cannot pick up and leave off on animations easily, this is something that has to be either done in one sitting, or come back and do it later, because if you close milkshape you have to re import the sequence .smd onto the reference .smd to get access to it, and I will discuss this later, long story short, animations aren't fun to salvage... anyway, continue posing pieces, using control-k to save their transformation geometry at that time frame (very important) until you have made some kind of motion or animation for about half of the time frame, the other half we want it to be going back into position right? So we go back to frame one, hit control-a to select all the joints, then use the animation/copy keyframes option from the menu bar to copy all the joints keyframes from frame 1, thats your "pose" remember? And we wanna go to the last frame, and use the animation/paste keyframes option from the menu bar, the immediately press control-K to save the last keyframe, now swing the little tracker bar back and forth and make sure your animation checks out, with as little clipping as possible, I know its hard to help it some times, and go back and make your final tweaking adjustments, remembering to press control-K when you change something, and when it all looks good, export it as a .smd SEQUENCE, and compile your .qc to check it out in HLMV... now when you make more animations under different names, you will need to add them to .qc file by copying and modifying the $sequence line from before...
Realising you've screwed up when it's too late: (editting animation) Now this is difficult but some times we have to do it, so here we go... First you must load your reference .smd file again, using import, making sure you don't have extra crap already being worked on in your work space, I suggest opening a new file first, then you must load the desired .smd sequence that you want to animate, lets say your idle.smd sequence... With your .smd sequence apphended to your time frame, when you click the "Anim" button, it should load up the animation, but with some distortion that you must deal with: -first it will start the sequence at frame moving your frame 1 to frame 3, leaving an annoying extra 2 frames at the beginning of your animation... damn... -secondly EVERY frame will now be keyframed... even more "damn..." because now things will be nice and difficult to modify... Solution 1: To fix the extra 2 frames we must put a very useful tool to action, called "reverse animation" under your plugins menu this way your last frame will be put right on frame 1, and the extra 2 useless frames will be at the end where you can cut them out, but FIRST, make SURE your animation time frame bar is set to the same number of frames as the sequence your modifying + 2 for the extra 2, this way your last frame in the sequence is the last frame on the bar, as if you were working on it. Now here's the tricky part, turn off "Anim" mode, and use the reverse animation tool to reverse the animation, and then turn it back on, and your 2 extra frames will be at the end where you can now change the frames to display number back down two (-2) so that those 2 frames are cut off, then exit Anim mode again, and re reverse your animation, and then select all and press control-w to reweld any unwelded vertices during the process, and when you reenter Anim mode, your animation is undistorted by the extra frames! yay! But the other problem... everything being keyframed... sorry there isn't a solution to this other than just going frame to frame and using control-shift-k to UNkeyframe the joints... and I've had to do this for a 320 frame animation it's NOT fun, so let's try to avoid using this section of the tutorial please
H4Xoring with animation!: (tricks and shortcuts) Now these are just a few tricks I've developed, other than the ones listed above, in the previous sections of the tutorial, so here we go... -Make your deploy and holster animations in under 5 minutes! This one is easy, you use your "posed" frame as frame 1, then at frame 15 (last frame) you just rotate both arms, Bone48 and Bone24, down so they are out of sight, control-K them, export as holster.smd, then exit Anim mode, use reverse animation, reweld vertices, reenter animation mode, check it to be sure it works, export as deploy.smd sequence... easy huh? -Use the plugin manager plugin to set keyboard shortcuts for your animation keyframing tools, like I have control-shift-c set to copy keyframes, and control-shift-v to paste keyframes, and I find it useful to start all animations, except deploy and holster, and multi part reload animations, by pasting the "posed" frame at both the start and end frames and keyframing them, and letting the animation half build itself, by working around the first few frames setting ranges in your animations and letting the keyframes transition themselves back into place, its easy stuff once you get used to it... -You can splice animations by loading one, then going to the last frame on its sequence and then importing another on top of it, although ms3d doesn't like animations with more than 300 frames... -Finally, when animating stuff, always do the most complex parts first, like slides coming back and hammers pulling back, because you can set them in the first frame where the weapon is level and flat, but don't set the keyframe, then use copy keyframes (even though you haven't set the keyframe it works) and you can paste it anywhere in the animation and it will rotate or move appropriately according to its parent joints, this is very very useful, as making a slide pull back properly on a moving weapon would be very difficult to animate by hand, remember to make good use of that "posed" frame!
hope this helps at least one person out there.
|
|