• Garry's Mod IK rig for blender?
    8 replies, posted
I was wondering if anyone knows of an IK rig for Gmod that works with Blender. I've been searching for ages now but I only found 1 rig and it's for 3DS Max. I've been using a different IK rig that does work with Blender but it's 100% incompatible with the Source engine. I'm also interested in learning how to add inverse kinematics to an existing skelleton so i can modify the HL2 one in case therearen`t any IK rigs for Blender.
What do you mean compatible with Garry's Mod exactly? What is it that you're trying to do? If you're animating an npc with an IK rig you just have to animate him first and then bake the animation and delete the IK controllers when you're done. Even easier than using a custom rig, you can add your own IK controllers to the Valve Biped rig. Takes like 5 seconds in Blender. If that's what you're trying to do, then what you have to do is go into pose mode, select one of the lower arm bones, press "Shift + I" and when the menu comes up hit "to empty" and change the number of iterations to 2. This will create a giant plus that you can move around so you can move his entire arm just like a ragdoll in GMod. Repeat for the other arm and the legs, and the spine if you want, but that causes some issues sometimes. You can get some pretty interesting animations that way though. When you're done you still have to bake the animations and get rid of the IK controllers as far as I know. Another modeler was telling me you could import IK rigs into SFM, but I haven't really looked into that.
What i mean by compatible is that the IK rig I'm using to make weapon animations doesn't have the same bone names and setup as the Valve Biped rig, so the compiler doesn't recognize it. The cool thing about this rig is that i can move the tip of a finger and the rest will follow, thus making the hand posing absurdly simple. Same happens with the rest of the arm, if i drag the wrist the rest of the arm moves with it. I've recorded a short clip showing how it works: [vid]https://dl.dropboxusercontent.com/u/26215793/ShareX/2015/12/2015-12-15_21-50-22.mp4[/vid] This rig is incredibly good because it allows very fluid movements and easy posing. If i can make the Valve Biped behave like that one then I would love to know how, because I've been wanting to make some decent weapon animations for a long time and this rig is pretty much the only thing I can efficiently work with.
Yeah, that's not really anything special, it's a pretty standard IK rig. You can easily turn the standard Valve rig into one just like that, although I wasn't aware that you needed to use the valve rig for first person weapon models. As far as I know you just need a bone labeled Valve_Biped.R_Hand and Muzzle_Flash or something along those lines and it'd work just fine. I can't tell whether those dummy objects are just IK controllers or your model is actually skinned to them. Is there a skeleton that those dummy cubes are controlling or is that it? If they're skinned directly to the dummy objects then you'll have to use a different rig using regular bone objects. If there's a skeleton underneath using regular 3ds max bones on the other hand I don't think you have to change anything other than bone names, you just have to bake the animations and delete the controllers when you're done. In 3ds max you can bake the animations by exporting it as an FBX, checking "bake animation" and then re-importing it into an empty scene and deleting the now unnecessary IK controllers.
Well I tried using that rig for a weapon and when I compiled it only the weapon showed up in Gmod. After exporting the animation into .smd format I opened it with a text editor and it did had bones just like the Valve Biped rig, except that they had completely different names. Would it be enough to just rename each bone to match the equivalent on the Valve Biped rig or would I need to mess with some other stuff? Also, I think the IK controllers show up in the .smd as well, can i just delete them from it before compiling the amimation or do I need to remove them in Blender and then export the animation?
Like I said, you're going to have to do the FBX method to bake the animation and get rid of the controllers as they might be causing problems. Do the FBX method above, delete the IK controllers, and make sure your model is still animating with just the skeleton present. From there, I don't think you need every single finger bone named the same as the valve skeleton, just the hand bone and the muzzle flash. Could you also paste your QC file?
This is the .qc i used to test the rig, which resulted in the animation being ported without the arms, just the gun. I will try exporting to FBX and then to .smd and see if it works with the compiler. [CODE]$modelname "weapons\c_longbow.mdl" $bodygroup "studio" { studio "reference.smd" } $cdmaterials "models\Killstr3aKs\Neuroweapons\longbow" $attachment "1" "gun" 12.00 9.00 4.00 rotate -0 65 -0 $surfaceprop "default" $contents "solid" $illumposition 3.995 -9.538 -6.393 $bbox -9.089 -11.527 -13.175 24.027 7.405 0.169 $cbox 0 0 0 0 0 0 $hboxset "default" $sequence "idle" "anims\idle.smd" { fps 30 "ACT_VM_IDLE" 1 loop node "Ready" } $sequence "shoot" "anims\shoot.smd" { fps 30 "ACT_VM_PRIMARYATTACK" 1 { event 5001 0 "1" } } $sequence "draw" "anims\draw.smd" { fps 30 snap "ACT_VM_DRAW" 1 { event 5004 1 "Weapon_javelin.Draw" } }[/CODE]
Ok so I exported the animation to FBX and then I imported it back, and now the rig has blender-like bones instead of those boxes/spheres, and the animations work flawlessly. Will try renaming the right hand wrist bone to Valve_Biped.R_Hand and then I'll compile it, if it works there won't be enough money on the Earth to buy all the beers you deserve :v:
Great! Hope for the best!
Sorry, you need to Log In to post a reply to this thread.