Source Filmmaker

Source Filmmaker

Dawn🌙 Jun 6, 2015 @ 9:22am
Quadruped (Horse) custom IK rig?
Hello!

So I wanted to try to make a rig for a horse (This one[garrysmods.org]) because I guess it would be easier to animate and stuff. I new to custom rigging, so I downloaded a custom rig for a quadruped to edit it afterwards.

The problem, however, is that it has more bones for a few parts than there are lines for them (I mean it has more than one bone for the neck, 7 bones for one leg...) and I don't know how to add these bones to the rig, especially for the legs, because for the neck and spine I assume you can just add a new line and rename them "boneSpine2/3/4...".

I guess I'll play around and even break my SFM because you learn by trying a bit, and I guess I'll wait for some replies.
< >
Showing 1-12 of 12 comments
Pte Jack Jun 6, 2015 @ 1:21pm 
I used the version 1.4 of the Auto_Rig script available in the workshop and tweaked the results abit to add the 2 extra neck bones. This is what I came up with.

http://imgur.com/oDFxK0X

Not the BESt rig, but it will allow you to pose into an approximate postion then you can manually pose from there using bone rotations.
Last edited by Pte Jack; Jun 6, 2015 @ 1:22pm
Dawn🌙 Jun 6, 2015 @ 2:28pm 
I tried the auto-rigger but it doesn't seem to do much for me, I also don't know at all how to do it.
Would you mind sending me the script maybe? Or just show the stuff to put in the auto-rigger?
raptornx01 Jun 6, 2015 @ 3:50pm 
didn't know the auto-rigger worked on non-bipeds.
Pte Jack Jun 6, 2015 @ 6:29pm 
It's all in the bones, Front legs and hooves are the arms, rear legs and hooves, the legs... Problem is that the kenetics can get a little screwy.

For example, this horse has 6 or 7 bones that make up the legs, I used the first 4, so the foot driver is actually ends up in the knee caps. So you use that to drive the upper legs then use the regular bones to rotate the bottoms and hooves. But other than that, not too shabby.

So here is the Auto_Rig setup

http://i.imgur.com/F380Nql.png

And the resulting Rig

http://i.imgur.com/SBXM5A7.png

and the rig if you tweak the neck bones...

http://i.imgur.com/oDFxK0X.png
raptornx01 Jun 6, 2015 @ 9:41pm 
if i remember i might have to mess with it once this video is done.
Dawn🌙 Jun 7, 2015 @ 4:47pm 
Omg thanks for the setup it works perfectly

But for the tweaking of the neck, I guess you work directly in the .py file? What do you have to change there?
Pte Jack Jun 7, 2015 @ 5:41pm 
These are the sections I had to edit, if you open the rig_horse.py file in a text editor (like notepad++) you can see the code I snipped out and get an idea of how I added the neck_1 and Neck_2 bones and rig handles...

#================================================================
# Find the dag nodes for all of the bones in the model which will be used by the script
#==================================================================
----->8 Snipped 8<-----
boneSpine2 = sfmUtils.FindFirstDag( [ "SK_spine_3" ], True )
boneSpine3 = sfmUtils.FindFirstDag( [ "SK_spine_4" ], True )
boneNeck = sfmUtils.FindFirstDag( [ "SK_neck" ], True )
boneNeck_1 = sfmUtils.FindFirstDag( [ "SK_neck_1" ], True )
boneNeck_2 = sfmUtils.FindFirstDag( [ "SK_neck_2" ], True )
boneHead = sfmUtils.FindFirstDag( [ "SK_head" ], True )
----->8 Snipped 8<-----

#==================================================================
# Create the rig handles and constrain them to existing bones
#==================================================================
----->8 Snipped 8<-----
rigSpine2 = sfmUtils.CreateConstrainedHandle( "rig_spine_2", boneSpine2, bCreateControls=False )
rigChest = sfmUtils.CreateConstrainedHandle( "rig_chest", boneSpine3, bCreateControls=False )
rigNeck = sfmUtils.CreateConstrainedHandle( "rig_neck", boneNeck, bCreateControls=False )
rigNeck_1 = sfmUtils.CreateConstrainedHandle( "rig_neck_1", boneNeck_1, bCreateControls=False )
rigNeck_2 = sfmUtils.CreateConstrainedHandle( "rig_neck_2", boneNeck_2, bCreateControls=False )
rigHead = sfmUtils.CreateConstrainedHandle( "rig_head", boneHead, bCreateControls=False )
----->8 Snipped 8<-----

# Create a list of all of the rig dags
allRigHandles = [ rigRoot, rigPelvis, rigSpine0, rigSpine1, rigSpine2, rigChest, rigNeck, rigNeck_1, rigNeck_2, rigHead,
rigCollarR, rigElbowR, rigHandR, rigKneeR, rigFootR, rigToeR,
rigCollarL, rigElbowL, rigHandL, rigKneeL, rigFootL, rigToeL];

#==================================================================
# Build the rig handle hierarchy
#==================================================================
----->8 Snipped 8<-----
sfmUtils.ParentMaintainWorld( rigNeck, rigChest )
sfmUtils.ParentMaintainWorld( rigNeck_1, rigNeck )
sfmUtils.ParentMaintainWorld( rigNeck_2, rigNeck_1 )
sfmUtils.ParentMaintainWorld( rigHead, rigNeck_2 )
----->8 Snipped 8<-----

#==================================================================
# Create constraints to drive the bone transforms using the rig handles
#==================================================================

# The following bones are simply constrained directly to a rig handle
----->8 Snipped 8<-----
sfmUtils.CreatePointOrientConstraint( rigSpine2, boneSpine2 )
sfmUtils.CreatePointOrientConstraint( rigChest, boneSpine3 )
sfmUtils.CreatePointOrientConstraint( rigNeck, boneNeck )
sfmUtils.CreatePointOrientConstraint( rigNeck_1, boneNeck_1 )
sfmUtils.CreatePointOrientConstraint( rigNeck_2, boneNeck_2 )
sfmUtils.CreatePointOrientConstraint( rigHead, boneHead )
----->8 Snipped 8<-----

I also had to add then to the common\SourceFilmmaker\game\platform\cfg\sfm_defaultanimationgroups.txt file.

"RigBody"
{
//horse1
"control" "SK_root"
"control" "SK_spine_1"
"control" "SK_spine_2"
"control" "SK_spine_3"
"control" "SK_spine_4"
"control" "SK_neck"
"control" "SK_neck_1"
"control" "SK_neck_2"
"control" "SK_head"
----->8 snipped 8<-----

and

"Body"
{
//horse1
"control" "SK_root"
"control" "SK_spine_1"
"control" "SK_spine_2"
"control" "SK_spine_3"
"control" "SK_spine_4"
"control" "SK_neck"
"control" "SK_neck_1"
"control" "SK_neck_2"
"control" "SK_head"
----->8 snipped 8<-----
raptornx01 Jun 8, 2015 @ 3:30pm 
cool
episoder Jun 8, 2015 @ 5:42pm 
i'm not much of a horse guy. but... "i was born to do this."... what movie ? ;)

screwy kinetics? guessing? you could add
forward = ComputeVectorBetweenBones( boneSpine3, boneSpine2, 10 )
and tweak that obvious
rigKneeR = sfmUtils.CreateOffsetHandle( "rig_knee_R", boneLowerLegR, -forward, bCreateControls=False ) rigKneeL = sfmUtils.CreateOffsetHandle( "rig_knee_L", boneLowerLegL, -forward, bCreateControls=False ) rigElbowR = sfmUtils.CreateOffsetHandle( "rig_elbow_R", boneLowerArmR, forward, bCreateControls=False ) rigElbowL = sfmUtils.CreateOffsetHandle( "rig_elbow_L", boneLowerArmL, forward, bCreateControls=False )
or do it wrong like this... and turn it around. or... move the chain. or... that horse probably needs a longer IK chain. completely down to the toe. -_-

real quick stupid of me... X)
Last edited by episoder; Jun 8, 2015 @ 8:48pm
Pte Jack Jun 8, 2015 @ 6:28pm 
I'm first to admit that I don't know the first thing about how this python work in SFM. All I know is that it works fine for what I need it for the way it came out of the auto rig builder script, except for the 2 missing neck bones that I wanted control on.
episoder Jun 8, 2015 @ 8:56pm 
i dunno much either. those other data manglers are crazy. but... the rig script is actually not very hard to figure out. it's just bones and parenting. i dunno if long bone chains even work. would be nice tho. some advanced foot roll. standing on the tip of the toe. that'd make that work.
Pte Jack Jun 8, 2015 @ 11:03pm 
yup, the adding of bones and the parenting is not hard, I'd like to know more about what the code that calcs the foot roll does and whether or not that might be the way into adding contraints to bones so they move more naturally and to stop them from bending in A. B. Normal (ly)
< >
Showing 1-12 of 12 comments
Per page: 1530 50

Date Posted: Jun 6, 2015 @ 9:22am
Posts: 12