I want to create an animation where one end of a spiral tube (existing object) is attached to a fixed point and the other end is attached to a moving object. How would I go about doing that in blender?
-
1$\begingroup$ maybe try with a bendy bone? youtube.com/watch?v=JS8V4_Ncn0w ... youtube.com/watch?v=WG3PhuzGz_o $\endgroup$– moonbootsJun 20, 2018 at 11:54
-
$\begingroup$ @moonboots Thats looks pretty good but is there a way of doing it without changing the shape of the tube (the diameter) when I move it? $\endgroup$– storm113Jun 21, 2018 at 6:01
-
$\begingroup$ there's also the Spline IK, I don't know if it fits better to your needs: youtube.com/watch?v=Px44mtdLND4& ... also you can find tutorials about rigging a spring: google.fr/… $\endgroup$– moonbootsJun 21, 2018 at 14:09
1 Answer
There are a few different issues here, and there are a few different solutions. The not-quite-spoken issue is that with a lot of ways of doing this, you're going to have undesirable deformation on the spring. Actually making it stretch to another point is trivial.
One way to solve this is to create your spring by running a long cylinder through a curve modifier. Why? Because it makes it easy to get good vertex weights on the spring. Disable the curve modifier on the spring, add two vertex groups ("base" and "spring") and assign all vertices to "base". Now switch to weight paint mode and draw a linear gradient for "spring" along the length of your cylinder. Finally, lock "spring" and normalize all.
Now you can re-enable the curve modifier and write it. You have a mesh that will deform properly with two bones. Create an armature containing two bones laid end to end along the axis of the spring (named "base" and "spring") and parent your spring mesh to this armature. Try moving (not scaling) "spring" along the length of the spring and notice your deformation.
Finally, you need appropriate relationships and constraints for your armature. Parent "spring" to "base" (unconnected.) Parent "base" or the entire armature to an appropriate object. Give "base" a damped track to your target object. Give "spring" a copy position from your target object. You're done.