23
$\begingroup$

How one would approach this specific snake motion in Blender as shown in reference:

enter image description here Reference source enter image description here Reference source

The position of the snake visibly remains almost static while the body parts quickly change their position. Using Curve and Armature Modifiers doesn't seem to help much and Soft Body Physics are difficult to control.

Edit (by vklidu): In general - current solutions are not really solutions:

  • Modifier - are too spiky (+ in mesh version deforms texture)
  • Hooks and ShapeKeys - are correct in curvature, but this solution is not a real loop

Here a bit closer locomotion ...

enter image description here

$\endgroup$
12
  • $\begingroup$ it looks like it's contracting itself? so maybe curve modifier and scale on one axis? $\endgroup$
    – moonboots
    Commented Jul 12, 2021 at 19:31
  • 2
    $\begingroup$ Have a seven foot eastern brown living up the back. It's idea of defensive is getting on its tail chasing you and biting you in the crutch. Agree this isn't a dupe (my answer there is more for trains) however IMO if intention is animating, rigging the snake is a good place to start. $\endgroup$
    – batFINGER
    Commented Jul 14, 2021 at 13:41
  • 1
    $\begingroup$ I have no solution but I will share my observations. This seems to be a regular "forward" motion of a snake warped around into a circle. Snakes can generate waves but they cannot move forward in the absence of friction. These waves appear to be similar to peristaltic waves, muscular contractions passing down the length of its body. If friction is added the resulting force is towards the center. The pattern created is similar to those of ancient labyrinths, some interpret these labyrinths as representing an inner journey. Curious! $\endgroup$
    – user5049
    Commented Jul 15, 2021 at 8:57
  • 2
    $\begingroup$ I would try to figure out what the problem is, before looking for a solution. With an image-sequence reference.. 1. Manually rotoscope the changing curve to shape-keys. 2. Try to identify fixed points in the reference, (tail-tip, etc) and animate empties along the changing curve following those points. It may not be the final method, but it would give a clue about what the final method has to do. (After all, this motion has evolved, because, presumably, it confers an advantage by confusing / alarming predators) $\endgroup$
    – Robin Betts
    Commented Jul 16, 2021 at 9:08
  • 1
    $\begingroup$ @RobinBetts This defensive movement causes the scales to produce sound like a poisonous snake due to the friction between them. Observation is very helpful in this case and I recommend slowing the video down or viewing it frame by frame to understand what is happening. Doing a curve 2D animation with Grease Pencil is quite a fun challenge too. $\endgroup$ Commented Jul 17, 2021 at 11:41

8 Answers 8

23
$\begingroup$

It depend how advanced rig or complex animation it should be.
For given reference it could work with ...

  • one Curve controlled by few Hooks

enter image description here

  • and Snake controlled by Curve modifier

enter image description here

enter image description here

$\endgroup$
8
  • 5
    $\begingroup$ Just downloaded. The motion is so much simpler than it looks! Well worked out. :) $\endgroup$
    – Robin Betts
    Commented Jul 16, 2021 at 16:08
  • $\begingroup$ I like the way it is executed - using Hook Modifiers on the deforming Bezier Curve. However, it is showing only the first phase of the motion. The formed bulge on the right side of the head keeps expanding. If you try to complete a full loop (cycle) of the motion as on the videos you may run out of control points to keep up with the new shape. I would love to see a full cycle using this approach. By the way you don't have to animate the snake body if you switch the Curve direction and invert the snake model - the head will "stick" to the beginning of the curve. $\endgroup$ Commented Jul 16, 2021 at 21:35
  • $\begingroup$ Here is the the file with the switched direction and removed Snake object animation. blend-exchange.com/b/Gv2Zz2Jd $\endgroup$ Commented Jul 16, 2021 at 21:43
  • 1
    $\begingroup$ Wow! Well done!!! $\endgroup$
    – Chris
    Commented Jul 17, 2021 at 9:19
  • $\begingroup$ @RumenBelev -right :) I just mimic the gif you attached, later I saw video with loop cycle, sorry. Anyway I don't think you will run out of control points since they just deform curve left&right, but it has to be animated all since inner curve runs slowly to outer. I will check that later. I have also another concept that I want to proof (tomorrow or Monday). Ad to animated snake - right thanks :) I tried to switch dir, but it didnt changed result for some reason, so I left it and focused on basic movement. If I wouldn't find loop version, I will delete answer to don't waste Jachym's bounty :) $\endgroup$
    – vklidu
    Commented Jul 17, 2021 at 11:20
15
+500
$\begingroup$

Here is another way ... curve object with two modifiers used for Snake object with Curve modifier ...

  • Wave
  • Simple Deform > Bend

enter image description here

Not perfect yet ... I have difficulties to set shape of wave I like to (still too spiky). For now just a concept to play with :)

... change Simple Deform > Bend > Angle

enter image description here

Later I want to try Lattice or something similar that allows me adjust tips of waves to get more roundness, but ... busy days so if someone wants to move it forward ...go ahead :)

$\endgroup$
5
  • $\begingroup$ This one looks easier for a longer animation. $\endgroup$ Commented Jul 18, 2021 at 20:51
  • $\begingroup$ This is very good procedural solution! A friend of mine proposed this approach last night, but we ended to a conclusion that we cant stop the neck (head) area from moving and to control it separately. I'm quite surprised that you got the same idea independently and executed it perfectly! Good job! $\endgroup$ Commented Jul 19, 2021 at 18:03
  • 1
    $\begingroup$ Dropped the bounty here, like the clever way this answer is dealing with infinite looping :) $\endgroup$ Commented Jul 22, 2021 at 11:34
  • $\begingroup$ @JachymMichal Thanks ... Seems like I 'm occupying this thread ... hm ... I expected bigger waves with such bounty ... like no one with Animation nodes skill or some rigger ... none of the answers here really gave satisfied solution here. Lets go for second round :) $\endgroup$
    – vklidu
    Commented Jul 22, 2021 at 21:18
  • 1
    $\begingroup$ Well played sir :)) $\endgroup$ Commented Jul 23, 2021 at 6:00
8
+500
$\begingroup$

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".

Starting Curve

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:

Cylinder animation and Rotating torus

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:

Snake animation

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:

enter image description here

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:

Spiral shape

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:

Translation and Flattening

The lattice is shown in final state. It was deformed to flat shape in Edit mode in two steps:

Flattening the Lattice

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:

Snake animation

Modifier set-up:

Modifier setup

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.

Armature Rig

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.

$\endgroup$
4
  • $\begingroup$ Absolutely fantastic stuff.IMO, because this kind of cross-domain, 3D > 2D idea could generalize to other problems, not just in animation. Is there a particular link for your reference? $\endgroup$
    – Robin Betts
    Commented Jul 29, 2021 at 21:29
  • $\begingroup$ @Robin Betts Unfortunately there is no reference. It was a private discussion and we were just throwing out ideas. Quentin is working on shadow projections and he found the 3D objects that could possibly generate these 2D shapes in motion. It is in fact a fascinating area to explore and Blender has the capabilities to assist. I have big hopes for the Geometry Node that could give us more access and control over the Curve object. For example control on Tilt orientation of a Curve can help in resolving the above mentioned issue. $\endgroup$ Commented Jul 30, 2021 at 6:49
  • $\begingroup$ Reminiscent of 4D > 2D, to loop/tile procedural noise. $\endgroup$
    – Robin Betts
    Commented Jul 30, 2021 at 7:17
  • $\begingroup$ despite the disadvantages I like the concept :) Thanks $\endgroup$
    – vklidu
    Commented Jul 30, 2021 at 8:23
7
$\begingroup$

Here is my take using curve Shape Keys for the animation. This requires some good animation skills and patience.

I prefer using NURBS curve for this specific shape - Figure 1

Initially I start with a Curve Path object and subdivide it twice Then subdivide some more only the first segment where the head will be and then snap these generated points to the first control point. I'll call them "spawn points". Currently the segments they create will not contribute to the curve shape as they have zero length. Figure 1

Now I start pushing the body points to form the initial snake body shape - Figure 2. That is not necessary but saves some animation time as my intent is for looping animation.

Figure 2

On the next step we add the snake object and use the NURBS curve as Curve Modifier. It is important to be able to see the body of the snake to prevent intersecting body parts during the animation - Figure 3 Figure 3

The last step is harder to describe in few words but basically the animation is a sequence of Shape Keys of the NURBS path. I prefer using Absolute shape keys (the Relative option is turned off) as it is easier to control the speed using the Evaluation Time property. Figure - 4

Figure 4

On each sequential Shape a new "spawn" point is introduced, leaving the location of the first "head" point. It will now contribute to the body shape, providing more resolution (point density) where it is most needed (close to the head and neck). To select a subsequent "spawn" point just select a previous one then [CTRL]+[+] to include it in the selection. You can see how the shape changes in the attached blend file and on the animation below (apologies for my poor FFMPEG conversion skills) Blend file:

Animation Preview

Pros: It is easy to animate using fewer modifiers and objects.

Cons: Due to the nature of shape keys the transition form one shape to another is in linear fashion and this doesn't produce very smooth result unless you use more and more shape keys. That makes this animation hard to reproduce and modify.

$\endgroup$
2
  • 1
    $\begingroup$ Another nice answer to IMO a nice Q. Thanks to @Jachym again for pointing it up. Downloaded.. the movement is easier to see with a bands texture at a frequency chosen to try to avoid the strobe?... but I guess the conversion to gif would screw it, anyway. $\endgroup$
    – Robin Betts
    Commented Jul 17, 2021 at 17:08
  • $\begingroup$ @RobinBetts I had to lower the frame rate to 8 fps to satisfy the 2 MB GIF restriction. In the blend file you can set a longer animation time to see better the pattern direction. There are just two key frames in total. The longer the animation time the better you see the poor transition between shapes. As I mentioned this approach requires good animation skills and patience, which I am lacking. You have to play with the animation curve to correct the speeds between the shape keys or add more in-between shapes to smoothen the movement. It is indeed faster than the original movement. $\endgroup$ Commented Jul 17, 2021 at 17:46
7
$\begingroup$

I wanted to come up with Lattice version, because there is not a way to adjust wave shape inside modifier in a shape I would like to. With Lattice deformer it is possible in some limited way, also with lattice you can completely fix snake's head position ... the biggest issue here is material.


  • Instead of curve objects you can go with mesh object, because with mesh you can set a vertex group to be affected by Wave modifier.

enter image description here

  • Add Lattice like resolution U 12 / V 6 / W 1 and transform basic shape in object mode to cover wavy strip
  • To make final bended waves less spiky go to edit mode select middle controls points and with proportional editing enabled scale on X axis t move grid closer to sides.
  • Add Simple Deform > Bend modifier to Lattice object

enter image description here

  • As final step - create mesh Snake object and with all modifiers of wavy strip disabled add Surface Deform modifier > Target – wavy strip and Bind it.

enter image description here

Notes:

  • use Subdivision modifiers as many you need
  • you can also move lattice vertices in snake tail part closer to head - like that bended tail became closer to fat part of snake body (same in your reference)

The biggest issue is shader that calculates texture coordinates before lattice ...

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ Another great solution @vklidu! One thing I like about it is that you have excluded the Curve object as helper. It seems this solution gives very stable result. One thing I don't like about the Wave modifier is that it doesn't produce very symmetric waves and I am thinking about using Displacement Modifier with Wood Sine Texture. I will post a solution here as soon as I polish it. You have my up-vote on this one :) $\endgroup$ Commented Jul 23, 2021 at 20:52
5
$\begingroup$

i use many animated curves to join 2 big curves, then use sverchok to combine those 2 curves into final animated curve.

enter image description here

enter image description here

enter image description here

$\endgroup$
2
  • $\begingroup$ I am happy to see Sverchok in action and I love the mechanical feel of this animation. I don't understand the node set-up very well but it will be a nice challenge to reverse engineer what you did in the blend file. There is obvious curve manipulation and mathematical parts in the node tree. I believe that this motion can be described mathematically I already have some ideas. Also the snake model rocks! Do you give permission for using it by other users? $\endgroup$ Commented Aug 2, 2021 at 17:47
  • $\begingroup$ The model is not my works, here is the link. blendswap.com/blend/7985 $\endgroup$
    – user41149
    Commented Aug 3, 2021 at 20:00
4
$\begingroup$

Here is a modified and optimized version of the vklidu's approach. It differs by replacing the Wave modifier with Displacement modifier.


For the Surface Deform object I start with a straight line of connected vertices alnog Y axis and making sure there is bigger vertex density at the "tail" section. I add all vertices to a vertex group which will control the displacement effect. Also added an Empty object at the "head" section to be used for the vertex group modification using the Vertex Weight Proximity Modifier.

Surface_Deform Object

I add Wave_Animation_Control Empty which will control the displacement texture and its animation. Rotating the Empty 45 degrees along Y axis gives good alignment of the texture with the Surface_Deform object The Texture is parametric Wood Sine texture which gives nice symmetric sine waves. The Color Ramp is enabled to take advantage of the Ease interpolation for more round/flat crests of the waves. That helps with the pointiness of the snake's body bending points.

Displacement

Lastly I add the Simple Deform modifier and a Screw modifier to generate a polygonal surface to be used in the surface deformation (see below). At this point you can test the animation by moving the Wave_Animation_Control along the Y axis.

Deforming the mesh

Here is a set up of the Snake object using only modifiers. One could try with a realistic snake model. The important part is to Y-scale (squish) the snakes body to the length of the Surface_Deform object or less. The most important modifier in the snake's model is the Surface Deform modifier. Before binding both meshes, make sure to disable the deforming modifiers as shown below.

Adding Snake mesh and binding

After the binding you can enable the remaining of the SurfaceDeform object modifiers. The result:

enter image description here

and you can download the blend file here:

I also did a Lattice Deform version which gives additional control over the waves spacing:

enter image description here

the blend file is here:

Both set-up give better real-time responsiveness than the previous solutions.

The cons of these solutions is that the Snake's body is too squishy when moving, which can be seen with the texture enabled. It is more worm-like than a rigid snake body. Having a Curve to keep the snake's body unchanged in length is preferable in my opinion.

$\endgroup$
1
  • 1
    $\begingroup$ I didnt check your file closer for now, but result is issued by the same things like wave-lattice version ... too small radius in turns and uneven texture that is stretched/squized imgur.com/eR9q2u8 ... sorry $\endgroup$
    – vklidu
    Commented Jul 26, 2021 at 8:10
0
$\begingroup$

Path follow it, the effect is mainly that the texture of the snake is small in size, so the movement over the path causes the effect, you might even animate the path a bit

another way to do it would be through a mesh deform modifier with a mesh of the curvature ( partly (using empty bindings)).

the problem here would be to overcome stretching, so you get chain alike constructs (empties with distance restrictions)..

I think there are a few solutions possible this way, though they take some time to configure, (currently dont have that time to create a demo file).

$\endgroup$
2
  • 2
    $\begingroup$ Thank you for your answer. Following a path - like moving on a rails won't help much, but using a curve to control the shape of the snake is a good approach. I would love to see what you came up with using the Mesh Deform Modifier. I haven't thought about using it as part of the solution. A screenshots or example blend file could be very helpful. $\endgroup$ Commented Jul 17, 2021 at 12:04
  • $\begingroup$ Sorry not having the time for that, though its pretty simple, you model it all traight (as a long line alike cube, you put a straightned snake in , and then deform that cube to a circle (snake will deform as well), pushing the snake forward, will move it through the mesh deformer (following it) $\endgroup$
    – Peter
    Commented Jul 23, 2021 at 7:27

You must log in to answer this question.

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