I would like to bring two new variants to the Curve deforming approach that avoid the "pinching issue" at the points where the snake is extremely bent. I would like to thank to Quentin Clemence for pointing in that direction and bringing more variety of the solutions of this problem.
I'll try to be as brief as possible due to the solutions being fairly simple and understandable.
Variant A - Rotating Torus
The animation curve is initially a "zig-zag" shaped cylinder (closed curve). One could play with the width of various parts of the "waves".
A Hook modifier rotates the curve along the cylinder's axis.
Then a Simple deform shapes it into a Torus. Animated it looks like this:
and
The model snake is NURBS path curve but it could be also a mesh object with Curve modifier.
To keep the snake in place a linear transformation is animated to counteract the rotation of the torus. The result looks like this:
The shape of the animated curve can be deformed additionally using Lattice modifier.
The position of the snake can be adjusted in such way that the head is going up in the center of the torus where some sort of distortion happen.
A possible solution is given at the end of this text.
Here is how the modifier setup looks like:
Variant B: Translating Spiral
I am not sure what is the name of this curve, let's say it is some sort of a spiral.
Again it is a pre-modeled open curve shape that looks like this:
Again a Hook modifier is added to the curve but for translation only.
A lattice modifier is added second to flatten the curve. The resulting animated curve is shown below:
and
The lattice is shown in final state. It was deformed to flat shape in Edit mode in two steps:
The snake (NURBS curve) object uses that curve as deformation modifier and was animated similarly to the first variant so it stays in place. Here is the result that can be modified further by adding more curve loops and resolution to the lattice:
Modifier set-up:
The body animation seems nice but the problem with the head part is the same as in the variant A. The head is fixed, looking up and wobbling.
Here is a solution: We are using a curve for the body deformation. This curve can be a basis for a Spline IK constraint of an Armature. The armature rig is split in two - body and head. The body bones are part of the Spline IK constraint, while the head bone is targeting an Empty.
Blend files for your own study:
Variant A:
Variant B:
Pros: Solves the "pinching" of the body. Very lightweight. No texture distortion ("worm effect"). Adjustable shapes.
Cons: The curve tilt may cause some body rotation which is visible with more complex textures. It also affects the bone rotations in the Spline IK chain.