Gmod : how can I make small or tall player models ?
27 replies, posted
Hello ! There is my problem :
[IMG]http://image.noelshack.com/fichiers/2016/47/1479754130-peppydeform.jpg[/IMG]
[IMG]http://image.noelshack.com/fichiers/2016/47/1479754135-peppydeform2.jpg[/IMG]
When rigging a model, you need to scale the model itself to fit the skeleton. If you scale the bones instead of the model (I used to make this mistake a lot when I first started) then Garry's Mod will stretch the bones back to their original length thus making your model appear stretched out. To avoid this, rig the model to the original (unscaled) bones and rig the model as usual. Once you've completed this, head on over to your QC file and add the line "$scale (your number here without the parentheses)" at the beginning of the file. This command will allow you to either increase or decrease the size of the player model without making the model stretch.
Examples:
$scale 2 - twice as big
$scale 1 - normal size
$scale 0.80 - slightly smaller
I suggest you experiment with the values until you find the size you seek.
As for the legs, I'll have to look around for that since I've never done that before.
I don't think there's much you can do about the legs and other limbs stretching. I'm pretty sure that would require you to edit all animations.
Oh yeah thank you very much ! I'll test this ! And Larry I love your Bobba and Jango Fett player models ! I hope you solve your pmayermodel's hands problem !
[QUOTE=Pinhead Larry;51411150]$scale [/QUOTE]
Although $scale has its uses, you really shouldn't use it on animated models, especially playermodels. These models outsource animations that are shared for a myriad of reasons and as such the model itself is all that gets scaled which then gets stretched back up to fit the bones, forcing a toothpick-like stature.
[QUOTE=ferdam;51411176]I don't think there's much you can do about the legs and other limbs stretching. I'm pretty sure that would require you to edit all animations.[/QUOTE]
Originally, yes.
Fortunately, you can exploit Source's delta animations to create an additive animation that pushes the bones into desired locations. Bones themselves have no scale attached to them -- they're only a translation and rotation with some modeling programs having visual models overlayed on top of them that might be scalable. I'm not too good with tutorials and still experiment with the method even now so I never wrote any official walkthrough (I don't personally use Blender anyway) but the basic overview can be found here:
[URL]https://facepunch.com/showthread.php?t=1439159[/URL]
In a nutshell, you pull the bones in to make your own skeleton and line them up. They should have the same names and general alignments as their target animations, but should be aligned to their child bones. In max you can auto-realign all bones with children to face them, excluding extremities of course. Blender may have a similar feature, but I don't know how to use it. Once you skin your model on top of the now modified skeleton, you can export the model as your base model and export the skeleton. You can call these things whatever you want but for the purposes of the QC and this post, I'll refer to the modified skeleton exported as proportions and the next file as reference. Your proportions file can be the model itself, but I usually export the skeleton alone for a reason I'll mention later. Next, we'll take the skeleton of your target animation (ex: gmod male player or gmod female player) and drop that into your editor. This will be your reference animation file. The reference animation is going to be the target animation's skeleton largely unmodified. The only modification you'll make is rotational, NOT translational. The rotations of each bone on the reference skeleton should be modified so it has the same rotational animation as the proportions skeleton. In Max I recently found I could export and import rotational-only animations which let me handle this in seconds. Prior to that I did everything manually going bone-by-bone and axis-by-axis down the hierarchy until it matched. It didn't take more than an hour and there may be an easier way in Blender that someone more proficient in it can figure out.
A brief explanation of how it works goes as follows: The proportions skeleton subtracts the reference skeleton first and foremost. Any differences between each bone will then be turned into a delta animation. This animation is then overlayed as an additive animation and in particular we overlay it over all existing animations and autoplay it over all of them. The nature of this is why you want the rotations to match up, but translations to differ -- this keeps the animation as it should be, but pushes the bones into the desired locations. You can also exploit the subtraction method to force certain rotations though. I push the arms on some of my models out 5 or 10 degrees on the proportions skeleton but not the reference skeleton which pushes them out on the overplay animation. This is useful since a lot of the models I've released wear large pelvic devices, dresses, or skirts that the hands would otherwise clip into.
Lastly, we have ikchains. We want the player's feet to connect to the ground. This is a combination of proper ikvalues and height of the pelvis bone. You might need to eyeball it and mess around with it but I usually lower the pelvis just enough so the feet connect to the ground and there's no visible snap when the legs stretch during a walk or run animation. If you slow the animation down in HLMV you can probably see the snap and you'll want to ensure the pelvis is lowered just enough so there isn't a snap at all. You also want ikvalues that push the feet onto the ground properly without pushing them into the ground. On a related note, try ensure the feet bones share the same rotation as their target skeleton. This is the one bone that should be left unmodified rotationally if possible. It's fine if it doesn't link up properly with the toes, though you can likely mess around with the toes to get it to link properly. The ikchains are based off a default rotation in the game's code so modifying the rotation, even if the character wears heals (see here: [URL]https://facepunch.com/showthread.php?t=1499351[/URL] ) The relationship between the pelvis height and ikchain values just about completely dictate player foot connection to ground when using proportions.
[t]http://i.imgur.com/rxiOq8c.png[/t]
Ideally the head rotation should be the same as well.
The proportions system can be exploited just about as much as you want so long as you know your limitations:
[t]http://i.imgur.com/vCaVI90.jpg[/t]
Speaking of limitations:
- GMod doesn't use a weapon bone. Instead it uses the right hand bone. This means increasingly smaller models may not hold weapons properly.
- GMod doesn't use the model's bounding box for collision on living players. Instead it's code-based. This means smaller models may not fit in smaller places unless modified in the code. The same applies for first person view height.
[t]http://images.akamai.steamusercontent.com/ugc/47607117610181867/7602DAAE85F974C44E8E70F5D0E5FCB53923E341/[/t]
- Lastly, models simply weren't meant to be smaller [or larger] than the intended animation set. You may encounter a handful of smaller issues that often can't be fixed.
I think I'm going to update the original thread with links to these for future use. In the mean time, you may encounter stretching that looks like this while working with proportions:
[t]http://67.media.tumblr.com/2f273c26a78393d75a743674312d93eb/tumblr_nms38bDJNC1tar524o1_1280.png[/t]
Encountering stretching of any kind while working on this is usually pretty normal and just means you missed a simple step. If the model has face flexes, try giving it a smile and calling it a happy little accident.
[QUOTE=CaptainBigButt;51418064][B][I]In Max I recently found I could export and import rotational-only animations which let me handle this in seconds.[/I][/B] Prior to that I did everything manually going bone-by-bone and axis-by-axis down the hierarchy until it matched. It didn't take more than an hour and there may be an easier way in Blender that someone more proficient in it can figure out. [/QUOTE]
That's a massive time saver, how do you do that?
The first thing you want to do is export the model's animation. Open your model, hide the mesh so you're left with just your modified bones that you'd normally use for your proportions animation. Select all of your bones and click on the Set Keys button (the key icon next to auto key and set key at the buttom) to create a default keyframe if one doesn't already exist. Make sure there's no other unnecessary keys. From here, export your animation by clicking on the animations menu at the top and clicking save animation.
Once it's saved out, open your target reference skeleton and select all bones again. Create a default keyframe like you did with the proportions animation just previously and remove unnecessary additional keyframes. Load in the animation you exported by returning to the animation menu at the top and clicking load animation. Select the animation you exported and click load motion. With the default settings, this should've pushed your original keyframe to frame 1 and dropped your proportions keyframe on frame 0. Frame 1 will look perfectly fine while frame 0 will look heavily distorted. Open the curve editor at the bottom left under the time slider. Click on the filter button (first button directly to the right of close) and uncheck the rotation box under transforms. The transforms box itself and all child parameters should be checked (position, scale, XYZW). Close the filter button and select the keys on frame 0, deleting all of them in the curve editor. The skeleton should now be clean and easy to see on frame 0. If necessary, select the pelvis or other root bone, turn on auto key and angle snap toggle, then rotate the pelvis by [usually] -90 degrees. If you turn off autokey and slide between frame 0 and frame 1, you should now notice that frame 0 is your modified rotational set-up while frame 1 is the default. Frame 1 can be deleted or ignored from here and the skeleton exported as your reference. After memorizing the process it can probably be done in less than 60 seconds.
[t]http://i.imgur.com/15UDDrz.png[/t]
[t]http://i.imgur.com/AA1ojS0.png[/t]
[QUOTE=CaptainBigButt;51418064]Although $scale has its uses, you really shouldn't use it on animated models, especially playermodels. These models outsource animations that are shared for a myriad of reasons and as such the model itself is all that gets scaled which then gets stretched back up to fit the bones, forcing a toothpick-like stature.
Originally, yes.
Fortunately, you can exploit Source's delta animations to create an additive animation that pushes the bones into desired locations. Bones themselves have no scale attached to them -- they're only a translation and rotation with some modeling programs having visual models overlayed on top of them that might be scalable. I'm not too good with tutorials and still experiment with the method even now so I never wrote any official walkthrough (I don't personally use Blender anyway) but the basic overview can be found here:
[URL]https://facepunch.com/showthread.php?t=1439159[/URL]
[/QUOTE]
That's interesting, I wish I knew that in the time I was a source modder.
Hello, I see you are very good in this :
I'm making a Kenshiro playermodel. I adapt the body to armature proportions, but the hands are to hards to adapt. So I made like this:
[url]http://image.noelshack.com/fichiers/2016/48/1480445934-capthand1.jpg[/url]
So in the QC, the hands are like this:
[url]http://image.noelshack.com/fichiers/2016/48/1480445934-capthand2.jpg[/url]
I know what is a problem but I'm rather bad in english and I don't understand all of what CaptainBigButt said.
Can you say what I have to do (if it's possible) to keep proportions without deform the hand (step by step if it's possible) please ? I've the same problem with Toad. I also have 3DS Max.
Here are my QC and SMD files (kenshiro_reference.smd is the model, others are bodygroups) :
[url]http://www.mediafire.com/file/jmhf46rb7885f2j/kenshiro.zip[/url]
[QUOTE=Pinhead Larry;51411150]-Misinformation-[/QUOTE]
Except then this happens:
[t]http://images.akamai.steamusercontent.com/ugc/867233806011593515/A9CCE9312C28F1B2BE5EF83FD4765323A77CC81B/[/t]
[QUOTE=Lucky9Two;51450206]Except then this happens:
[/QUOTE]
That's what I meant when I said
[QUOTE=CaptainBigButt;51418064]Although $scale has its uses, you really shouldn't use it on animated models, especially playermodels. These models outsource animations that are shared for a myriad of reasons and as such the model itself is all that gets scaled which then gets stretched back up to fit the bones, forcing a toothpick-like stature.[/QUOTE]
This can work can has its uses, it really just doesn't work when the model's animations are taken from a third-party source like most playermodels are because $scale doesn't affect those. It ends up scaling the model down alone, then forcing it onto the animations which are still scaled up. Animated models with animations compiled directly into the model may work just fine with $scale.
[QUOTE=Lukis;51445904]Hello, I see you are very good in this :
I'm making a Kenshiro playermodel. I adapt the body to armature proportions, but the hands are to hards to adapt. So I made like this:
So in the QC, the hands are like this:
I know what is a problem but I'm rather bad in english and I don't understand all of what CaptainBigButt said.
Can you say what I have to do (if it's possible) to keep proportions without deform the hand (step by step if it's possible) please ? I've the same problem with Toad. I also have 3DS Max.
Here are my QC and SMD files (kenshiro_reference.smd is the model, others are bodygroups) :
[/QUOTE]
I'll look into it.
Edit: Send me an invite on Steam (click the Steam icon under my post count). I'm missing a file when I try to compile an example file to try it out in the modelviewer. I'd also like to get an update on what you're trying to do. While we're at it, I'd like to help you build a fresh QC since you're using a decompiled one.
Oh thank you very much ! I sent you an invite !
Hello ! I'm making Pr Layton playermodel. Like you told me, I wanted to export proportions and reference skeletons in .smd. But I can't (what I did it's I just deleted the mesh to export).
Here is an image: [url]http://image.noelshack.com/fichiers/2016/49/1481315543-armabone.jpg[/url]
And I noted the other playermodels' (like yours) proportion file have a different skeleton. Here is an image: [url]http://image.noelshack.com/fichiers/2016/49/1481315541-armabone2222.jpg[/url]
How do you think I can transform my skeleton like these please ? (or another way)
Nobody knows ? How to make a_proportions, reference and ragdoll skeletons please ?
Do you know how we can make a_proportions skeleton, reference skeleton and ragdoll skeleton for the animation folder please ? Do you take model's skeleton (exemple Layton_reference.smd's skeleton) and make a thing with it to make a_proportions reference and ragdoll skeleton ? I'm stuck ! Help please !
I'm making Pr Layton playermodel. Like you told me, I wanted to export proportions and reference skeletons in .smd. But I can't (what I did it's I just deleted the mesh to export).
Here is an image: [url]http://image.noelshack.com/fichiers/...3-armabone.jpg[/url]
And I noted the other playermodels' (like yours) proportion file have a different skeleton. Here is an image: [url]http://image.noelshack.com/fichiers/...mabone2222.jpg[/url]
How can I transform my skeleton (first image) like these (second image) please ? (or just how to make a_proportion, ragdoll, and reference skeletons)
Could you help me please ? How do I do ?
bump ?
Note: Steps below are for Blender
To export armature as smd, click on the bone then press [B]I[/B] on your keyboard. Insert Keyframe Menu will show up so select which one you need. Idk much about it but I always click on Whole Character. Export it and you'll get something like [URL="http://image.noelshack.com/fichiers/2016/49/1481315541-armabone2222.jpg"]this[/URL]
To delete keyframe, select the bone, press [B]Alt+I[/B] then hit Enter
Btw I like the way you describe your problem on first post
OH MY GOD THAAAANK YYOUUU you've made my christmas present ! :dogcited:
Oh, you like how I described my first problem ? Here you are my NEW problem ! Eheh!
[IMG]http://image.noelshack.com/fichiers/2016/51/1482688745-santakenshiro.jpg[/IMG]
[editline]25th December 2016[/editline]
So ? Do you undertand my problem ? What have I to do to transform a_proportion skeleton like megaman's ?
Idk much about player model proportions trick. You should pm CBB or ask him directly on [URL="http://steamcommunity.com/id/CaptainBigButt"] Steam[/URL]
Yes, I'm asking him, but he is absent for the moment. I hope he will answer ! (He is a man ? :scream: hmmmmmm.....ok.....)
[QUOTE=Lukis;51582177]Oh, you like how I described my first problem ? Here you are my NEW problem ! Eheh!
[/QUOTE]
I haven't messed around with the porportion trick, but I have had experience dealing with your finger issue. It most likely has to do with the "Roll" of the bone in blender. You can't see the roll of a bone when looking at it in its stick form, so start by changing the display to B-Bone under the armature tab. I'm not sure as to the ideal roll angle, but I try to get the bone's roll pointing towards the next bone.
[IMG]http://i.imgur.com/BDbHu89.jpg[/IMG]
[QUOTE=Pinhead Larry;51411150]When rigging a model, you need to scale the model itself to fit the skeleton. If you scale the bones instead of the model (I used to make this mistake a lot when I first started) then Garry's Mod will stretch the bones back to their original length thus making your model appear stretched out. To avoid this, rig the model to the original (unscaled) bones and rig the model as usual. Once you've completed this, head on over to your QC file and add the line "$scale (your number here without the parentheses)" at the beginning of the file. This command will allow you to either increase or decrease the size of the player model without making the model stretch.
Examples:
$scale 2 - twice as big
$scale 1 - normal size
$scale 0.80 - slightly smaller
I suggest you experiment with the values until you find the size you seek.
As for the legs, I'll have to look around for that since I've never done that before.[/QUOTE]
I don't think you can call this necroing but wanted to ask this anyways:
I just tried the scale command on l4d2 and it made the model stretched out in ragdoll pose. The animated model still had the default size and look though.
[QUOTE=CaptainBigButt;51418064]Lastly, we have ikchains. We want the player's feet to connect to the ground. This is a combination of proper ikvalues and height of the pelvis bone. You might need to eyeball it and mess around with it but I usually lower the pelvis just enough so the feet connect to the ground and there's no visible snap when the legs stretch during a walk or run animation. If you slow the animation down in HLMV you can probably see the snap and you'll want to ensure the pelvis is lowered just enough so there isn't a snap at all. You also want ikvalues that push the feet onto the ground properly without pushing them into the ground. On a related note, try ensure the feet bones share the same rotation as their target skeleton. This is the one bone that should be left unmodified rotationally if possible. It's fine if it doesn't link up properly with the toes, though you can likely mess around with the toes to get it to link properly. The ikchains are based off a default rotation in the game's code so modifying the rotation, even if the character wears heals (see here: [URL]https://facepunch.com/showthread.php?t=1499351[/URL] ) The relationship between the pelvis height and ikchain values just about completely dictate player foot connection to ground when using proportions.
[/QUOTE]
Hello CaptainBigButt! I was wondering if you could help me with this error I keep getting related to ikchain..
ERROR: ikchain 'lhand' too close to root, no parent hip/shoulder
I get it whenever i compile the model.. Do you know what it means? All advice is greatly appreciated! :)
(Also, sorry if this is a little late.. :boxhide:)
[IMG]http://i.imgur.com/Q3Ye9gu.jpg[/IMG]
I have a similar problem
Ragdoll: Check
Playermodel: Error
[IMG]http://i.imgur.com/k7a6Kc5.jpg[/IMG]
Sorry, you need to Log In to post a reply to this thread.