2
$\begingroup$

I have a couple of soft body objects in a scene sitting on a plane. My goal is to smoothly move one of these soft body objects towards a goal position smoothly while still having its 'base' anchored to the same spot (a kind of controllable soft body tentacle). Note that I want the soft body physics still do its job while the object is moving towards the goal position. This means that the object might collide with other objects. I wonder how can this be done?

$\endgroup$
6
  • $\begingroup$ You can apply a force to a soft body by adjusting the Soft Body Goal settings and moving the original mesh after the simulation has been started. The Stiffness and Damping can be keyframed which should allow you to achieve what you require (low stiffness relaxes the 'pull' to the mesh while high stiffness draws it in tighter). I can put together an example later - do you have any images or extra description for what you're trying to achieve so I can make it as relevant as possible? $\endgroup$ Commented Oct 5, 2018 at 12:11
  • $\begingroup$ @RichSedman An example would be great! You can use the .blend file that I have uploaded here as an example. My goal is to somehow make sure I have something like two fingers that are attached to a piece of bone. So moving one would move the other one as well. However, I want to create a shape (say an sphere with collision enabled) at the center and move both of the soft body meshes towards it --> (0, 0, 0). It would be great if you can show how I can do this with one of the meshes. $\endgroup$
    – Amir
    Commented Oct 5, 2018 at 13:01
  • $\begingroup$ @RichSedman The closest thing I've found is this. I'm trying to see if a similar approach would work for my problem. The problem with the rigging/armature setup seems to to be that I possibly cannot move the object to a goal/target point in space since gravity affects the mesh. So I'm trying to see how I can pin my object first before applying such a setup to it. Let me know if you have a better solution in mind $\endgroup$
    – Amir
    Commented Oct 5, 2018 at 19:08
  • $\begingroup$ Ah. From your example it appears that you want them to be pinned at one place and yet free to move and be dragged by the 'force' for the rest of the mesh. Unfortunately, the method I suggested uses the same Goal settings to achieve the result - so it's not possible to achieve a solid pinning (which requires high goal strength and stiffness on a specific set of vertices) while also pulling the remaining vertices out of their natural locations (by using a much smaller goal strength and stiffness and moving the vertices out of place). I'll let you know if I come up with another solution. $\endgroup$ Commented Oct 5, 2018 at 22:33
  • $\begingroup$ @RichSedman I was thinking of moving the objects using a curve path. What do you think? (see here) $\endgroup$
    – Amir
    Commented Oct 8, 2018 at 18:21

1 Answer 1

2
$\begingroup$

The Soft Body Goal can be used to manipulate the soft body by also manipulating the original mesh to apply forces to shape the soft body. Different weights applied to different vertices allow some control over how those forces are applied.

Create your mesh to use as a soft body - in my case I'll use a simple string of vertices and add a Skin modifier later.

string of vertices

In Edit mode (Tab), add a new Vertex Group and name it something appropriate (eg, 'Pin'). Select the two vertices at the 'base' (the point where it is to be anchored) and click Assign to the Vectex Group with a weight of 1.0. These will be effectively unmoveable and 'pinned' to the mesh vertices.

base vertices assigned to vertex group

In order to have the soft body retain its generate shape we need to also assign the rest of the vertices to the vertex group - but with a lower weight. This will give them a force towards the goal while still allowing them to be pulled out of position. While the 'base' vertices are still selected, invert the selection (Ctrl+I). Change the weight to 0.5 and click Assign (different weights will affect how tightly the body tries to return to its 'at-rest' position).

body vertices assigned to vertex group

In order to control the location of the 'tip' of the arm we need to assign a higher weight - almost but not quite 1.0 (1.0 would fix it directly to the control point - we only want to draw it strongly towards the control point). Therefore, select the vertex at the tip, set the weight to 0.999, click Assign.

assign tip

To control the tip we can use a Hook modifier - while the 'tip' vertex is still selected (and still in Edit mode) press Ctrl+H and 'Hook to New Object'. This will create an Empty linked to the selected vertex. Moving the empty will drag the vertex. You can now return to 'Object' mode (Tab).

Add Soft Body physics and set the Goal to the newly created Vertex Group ('Pin'). Assign the Goal to strength 1.0 and you should find that the Base is now pinned to the base and the tip drawn to the location of the 'hooked' vertex. Ensure the Hook modifier is above the Soft Body modifier in the modifier stack.

modifier stack

Increase the Edge spring strengths to the desired soft body settings. Switch off Gravity in the field weights and perhaps set some Friction in the main Soft Body settings so as to dampen the simulation. Also, adjusting the Soft Body Goal Stiffness can affect how strongly the arm is tied to the goal. Now, moving the hook should drag the arm.

You can set up different shape keys for different 'at rest' positions of the arm - but ensure each shape retains the position of the 'tip' - otherwise the hook will be offset from the target empty. The Strength setting on the hook modifier allows the influence to be switched on (1.0) or off (0.0) and this can also be used to have multiple 'hooks' (switching each on/off in turn to affect which empty has the influence - this can be used where multiple shape keys result in different starting hook positions). It's a good idea to start the simulation with the hook strength initially set off, and switch on over a number frames to let the soft body adjust to the new shape (otherwise it can jump to the new location and take a while to settle down).

Once enabled, simply move the Empty to where you want the arm to reach. Any collision objects in the way will deflect the arm.

result

Note that I used a Skin modifier for the skin of the arm. The rotation of the generated geometry is dependent on which vertex in the chain is designated as 'root'. To avoid twisting ensure the 'base' of the arm is the root.

An alternative is to model the whole arm as soft body (rather than a string of vertices with a Skin modifier). Use self-collision to give the soft body volume to prevent it folding together when it encounters obstacles.

Blend file included

$\endgroup$

You must log in to answer this question.

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