9
$\begingroup$

I've searched google extensively on this. Can't seem to find an answer.

I know about spline IK, which is wonderful for conforming a row of bones to a path. But combining the armature object with a follow path modifier causes the point of origin to move, but the bones themselves stick to the beginning of curve.

Ultimately my goal is to make a creature like a snake or centipede follow a curve path, thus animating it fairly realistically ...

$\endgroup$
0

2 Answers 2

14
$\begingroup$

Mesh and curve modifier.

enter image description here

Once set up, can travel along curve by displacing our dummy edge object

Having tried a method similar to @moonboots answer in writing a train addon found using the method outlined below kept the wheels on track (better if the curve is too tight nothing will help). This may not matter too much with a deforming object like a snake. However it only requires making one very simple mesh object, with vertex groups as targets for bone constraints.

Trying to place empties on the curve with offsets will cause the "train to derail" as the offset is looking at curve length rather than where the line segment next meets the curve. For example a unit circle radius 1, can hold a square with edge lengths sqrt(2) each corner touches the circle. The arc length is p1 / 2 Trying to get the empty locations right on a complex curve is IMO too hard. If a mesh is created and threaded onto a curve with a modifier the edge lengths are preserved.

Create a simple mesh as shown. With edges and verts emulating bones.

enter image description here Here the mesh is moved 1 over for visual

enter image description here

Add a curve modifier to the mesh. I've made the mesh z up to cooncide with bones global orientation, so I track the mesh on curve using Z. The mesh can "run on the tracks" by animating its Z location property. Can switch tracks by changing this one modifier target

enter image description here

Next we add a copy location constraint of root bone to our mesh object, with base vertex group as a subtarget, and a track to constraint along the axis of bone "Y" to the next vertex group.

For all subsequent bones in chain add track to constraint to next vertex group.

$\endgroup$
2
  • 2
    $\begingroup$ nice! It's true that the method I explained will force to correct the Offset every time we change the curve length $\endgroup$
    – moonboots
    Commented Feb 27, 2019 at 12:38
  • 1
    $\begingroup$ Both answers are good but this one seems pretty reliable. $\endgroup$ Commented Feb 28, 2019 at 0:44
7
$\begingroup$

To make a snake-like animation you can do it the way I explain below (inspired by bugzilla2001 here: https://www.youtube.com/watch?v=VXheGvyEz3A& ).

But as batFINGER said it has a drawback because as it uses the Follow Path Offset, each change you'll make on the curve length will imply an adjustment of the Offset...

Anyway, here it is:

  • Create your object (snake, train...)

enter image description here

  • Create the armature, parent the object to the armature:

enter image description here

  • Create an empty at the beginning of the armature, parent the armature to the empty:

enter image description here

  • Create your road with a curve. Change its direction with a W > Switch Direction if necessary, put its origin at its beginning:

enter image description here

  • Put your empty at the center of the scene with an altG:

enter image description here

  • Give your empty a Follow Path constraint and choose the curve as the Target. The empty will stick to the beginning of the curve:

enter image description here

  • Duplicate the empty with a shiftDenter, change the Follow Path Offset of this second empty so that it is separated from the first with a distance of approximately one bone::

enter image description here

  • Create as many empties as you have bones, and again change the Offset of each one:

enter image description here

  • In Pose mode, select the first bone and give it a Track To bone constraint (not an object constraint!), with its empty as Target:

enter image description here

  • Do it for each bone. Then correct the Offset of each empty so that it sticks to its bone tail:

enter image description here

enter image description here

  • If you play the animation the armature should follow and the whole object should bend along:

enter image description here

  • To set the animation parameters and speed yourself, select the curve, go in the Graph Editor, select the Evaluation Time track, open the properties with N, press the Modifiers tab and remove the Generator:

enter image description here

  • Now in the Properties panel > Data > Path Animation, you can keyframe the Evaluation Time yourself:

enter image description here

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .