Rigging a softbody (?) cable ?

Hi !

Here is a challenge for you rigging masters.
I would like to animate a cable hanging from a crane.
See the pictures. There is also a thread here

I 've started the project and I made a simple mesh that actually is a softbody.
I can put a weight paint of 1 over the vertices that aren’t supposed to move and a weight of 0 to those hanging down. That works.

BUT what when the crane actually lifts objects ? The hanging end would have to be lifted, thus shortening the length where the weight paint has to be 0.

I have added a path and made the cable follow the path using the “curve” modifier. This works well if the cable is not a soft body (and the cable is extremely stiff), but with weight paint I can’t see how to do it…

Now, ther may well be a much better way to do that: I am totally incompetent at rigging with armatures and do everything with constraints. I don’t know what FK/IK is etc…

Maybe soeone has done that before and can give me an hint ?

Attachments


Hi Gwenouille,

This task is deceptively complex. Remember that in CGland, nothing is as it appears to be. You don’t need to literally make the rope go over the pulley and get wound up in the gears. You just need it to look like it did.

In other words, all you need to do is somehow scale your rope so that it retracts up to the pulley. You can use shape keys, you can use scaling, or you can use an armature… there are lots of possibilities that come to mind. Using an armature would probably be the most versatile solution. I just recently realized that dynamic bone chains are possible in Blender, but I haven’t yet put together a tutorial.

I’ve attached a .blend demonstrating how I would do it. To see it in action you will first need to press the ‘bake’ button in the buttons window. Wait for the bake. Then switch to layer 2, and press play.

The setup… is difficult to explain, but in a nutshell:
-dynamic plane with empties parented to the vertices. The empties are IK targets for the bones.
-the top vertices are part of the ‘end’ group, and are also parented to the top empty so the rope can be moved.
-the top empty and top bone are parented to the bone named ‘KING’ in the same armature (there are 2 armatures for simplicity of this demonstration). This bone can be animated and the dynamic chain will follow along.
-The retracting of the chain is done using a simple shape key (which is driven by the bone in ‘armature2’), and applying the armature as only envelopes no vertex groups or the application will be absolute instead of relative. This way the rope always retracts up the bone chain. Make sure the envelope influences are also scaled up with alt+s on the bones, or the rope may pop out.

Note: this setup ignores the orientation of the empties. If you want the orientation the mesh needs to be triangles, and you may need Pole Targets for the IK solvers to keep them from flipping. That information I will ignore for now, because I don’t find the orientation information necessary. And you won’t either unless your rope is so big that twisting is very easy to see.

Special thanks to hamsterhill for his rope tutorial.

EDIT: I updated the file with the unparented hook to fix the dependancy cycle. If you want to move the curve around, parent the top hook and bone to a bone in a separate armature.

VertexPusher’s solution works just as well though, and may be easier to setup.

Attachments

dynamicRope_dependancyFix.blend (128 KB)

Hi Feelgoodcomics !

Waw, that is some reply !
You really find that simple ? :slight_smile: I mean It will take me 3 weeks to work out how it works ! As I said earlier:“I am totally incompetent at rigging with armatures”.

To me it seems quite complex for just a rope hanging and retracting… But maybe it is just the way it looks. Do you have a good tutorial on Armatures and bones somewhere ?

I’ve had a look at hamsterhill’s rope tutorial and it is very nice, but some bits are black magic to me: @7’30’’ this “free” button for instance…

I will chew all that, learn Armatures this WE and answer more deeply later on.

Thanks !

Yes, I still think it’s simple, and I think you would too. It’s just not an easy one to reverse engineer :wink:

I’ll get a tutorial up later tonight or tomorrow, and post the link here. You’ll see… it’s easy.

Um not to rain on your parade feelgoodcomics, but your set up has many cyclic dependencies (look at the console) … sorry :frowning:

A really simple way to do this is to use your original idea Gwenouille, that is use a curve modifier on the cable mesh, but use the softbody on the curve instead of the mesh . You can weight the individual control points with regard to softbodies (hit the “W” next to use goal in the softbody panel), where a weight value of 0.0 is full softbody and 1.0 has no influence . This is like vertex groups/weights for meshes, but for curves . You can change the weights in curve edit mode by hitting the W specials menu, or directly input the value through the Transform Properties subwindow .

By adding some more control points you can make a reasonable pully simulation . Alt-A to play :

Attachments

softbody_rope.blend (155 KB)

Thanks for pointing that out VP, I hadn’t noticed it was cyclic since it was behaving properly. Do you know of a better way to setup a dynamic bone chain? I just stumbled on the idea, and haven’t been able to find any material about it online, so it’s been just trial and error. More error than trial evidently :rolleyes:

I like your solution better, it’s simpler. I’m more of a brute force animator myself, as I rarely use simulations for anything.

Edit: I think I just figured out a way around the cyclic dependancy. I feel stupid to have not realized it. It’s because the hook at the top of the plane is parented to the armature directly. This could be avoided with a second armature. Just unparent that hook and all the dependancy disappears.

OK Thanks to both of you!
I adopted Vertex Pusher’s solution since it felt easier to comprehend and easier to set up, but I stll struggle a bit with those twisty sections where the cable is purely vertical… I will use feelgood’s technic to build up knowledge about armatures
I’ve put a link to a video in the other thread for you to watch the progress.

I’ll keep you up to date.

Do you know of a better way to setup a dynamic bone chain?
What do you mean by “a dynamic bone chain” ? You can do all sorts of crazy setups using constaints and IK along with influence drivers etc., so unless you have something specific in mind, I am not very clear on what you mean …

it’s simpler
Yeah, I just recently started looking into softbodies myself, and though you could easily fake the softbody simulation by manually animating the curve, but since we have this feature why not use it ? There seems to me an almost entropic tendency for unnecessary complexity when it comes to rigging …

but I stll struggle a bit with those twisty sections where the cable is purely vertical…
OK, sorry, I forgot about the nasty Z up twist that happens when you have the curve aligned to the Z up orientation in Blender . To fix this you need to add the curve in the top view and rotate it 90 degrees along the X axis, but do not apply the rotation to the curve, as this is the reason why the curve twists like that … You did a nice job with the model BTW :slight_smile:

Hey VP,

What I meant by “Dynamic Bone Chain” is a term I’ve brought from Maya. In Maya there is an IK solver called a “spline IK” which allows you to solve a bone chain along a curve… which then allows you to make the curve dynamic, for automatic secondary animations. It can come in handy for tentacles, tails, and stylized fur (as a mesh), and I’ve been playing around with adapting some of the Maya rigging techniques over to Blender. The example I gave was using a similar approach, but using a mesh instead of a curve since I was referring to hamsterhill’s video in which he uses polygons. It may be possible to do the same thing with a curve, I’ll have to play around with it…

For a great example of “dynamic bone chains” or “dynamic spline IK” in use, I would recommend checking out the Burning Safari “making of” videos (particularly 1 and 2). They used it for the plants, and the monkey’s fur (which is stylized, so using particles would be unsuitable for this situation). It makes follow-through animations a lot easier on the animator, without sacrificing control.

And while I do agree with you that rigging can become complex very easily, I do think that it usually offers more control in the end. Since it is much easier to override a bone chain than a dynamic curve. Alteast, curves rarely behave for me lol :slight_smile:

Do you know of a better way to setup a dynamic bone chain?
I did not mean this to sound confrontational. I really would like to hear what ideas you have regarding doing this in Blender. Like I said, I’ve only discovered the possibility this week. Since the dependency cycle was such a simple fix, I’m inclined to think you dismissed my idea outright.

Although the setup seems daunting at first, it just has lots of redundant parts to it. In fact, I’m thinking that it could be done with far fewer bones by using B-Bones.

I will attempt to explain the setup a little easier. This setup assumes a horizontal start, but it doesn’t have to be:

1.)create a plane and subdivide it (or make it into triangles like in hamsterhill’s tutorial if orientation information is needed).
2.)create a hook at each vertice that will be solved, and then remove all the hooks (this is the fastest way to create empties in the right location, as far as I know).
3.)parent those empties to the corresponding vertices on the plane so they follow along (3 vertices if you want orientation, or 1 if you don’t. You don’t if twisting is not visible in your rope.).
4.)Create a bone and snap the ends to the ends of the plane. Then select the bone and press “w->subdivide multi” to create the amount of divisions needed.
5.)Use the empty at the end of each bone as the target for the IK solver of each bone.
6.)Select the vertices you want to remain pinned and hook them to a new empty, as well as add them to a vert group which you will use in the cloth solver to pin.
7.)Make the plane a cloth, and pin it. Then bake it, it usually looks pretty good on default.
8.)If you want the chain to move around, you need to parent the top hook, and the top bone to a bone in another armature (to prevent dependency cycles). Then you can move that bone around, and the dynamic chain will follow. It will have to be rebaked if you move it, of course.
9.)Now make a rope, and use the armature of the bone chain to skin it. I added a shape key to compress the rope, but it could also be done in other ways. That is just a quick and dirty method.

This takes 5-10 minutes to setup, and I bet the chain could be replaced with 3 B-Bones to keep it simpler still. In fact, I bet you could curve the bones over the top of the pulley, and build it that way… then you could retract the rope using the shape key and envelopes… I see lots of unexplored possibilities. :yes:

Sorry about the long post. I hope that clears things up though, and makes me appear less crazy! :eyebrowlift2:

I was playing around with the softbodies a bit more, and I thought I would attach an example to illustrate what I was talking about.

By just animating the motion of one bone up and down, and rotating it, the entire chain is solved for secondary animation automatically. And remember the bones can be skinned to any mesh, so the possibilities are quite limitless!

Just press bake in the softbodies panel to see it in action.

(note: the softbody settings could be better, this is really my first time playing with them, but I feel it is a close enough resemblance to what I am trying to achieve…)

Attachments

dynamicBones_Softbody.blend (94.6 KB)

The Maya spline IK makes it’s appearance once again … Sorry about not replying earlier, but a nasty bot took over my laptop and had to fix some security issues …

I have absolutely no experience with Maya (and I believe Autodesk had discontinued the PLE edition since they took over ? … or was that just with XSI ?) so I don’t quite know how the spline IK in Maya behaves … And I wasn’t just dismissing your approach just because of the dependencies issues, but because like I said there is a tendency to over complicate a rigging problem with too many “options” that do not involve the current problem at hand . I have come to believe that “do all” rigging solutions are rather silly and tends towards obfuscating solutions that over tax resources with little gain at a solution .

Lets take Gwenouille’s little problem here : he needs to animate a rope being pulled through a wench . He wanted to use softbodies to simulate some of the animation . He tried softbody on the mesh with bad results . Simple solution : use softbodies on the curve path that “rigs” the mesh … In your solution you kept the softbody on the mesh and then used an armature along with hooks to animate (It seemed to behave properly btw because of the softbody baking involved) and then used the armature to “shrink” the mesh … For me that is too many steps involved … because the problem here is, if you break it down, a simple issue of length and motion to convey an animation …

Don’t get me wrong, it’s not that I object to complex setups (* note polorix servers close down for the Winter holidays so links will be down on Dec & Jan) :
http://uploader.polorix.net//files/307/COMP_FINGERS.avi
http://uploader.polorix.net//files/307/COMP_FLEXION.avi
http://uploader.polorix.net//files/307/COMP_SLING.avi
I did that a couple of years ago when I started Blender . The roll on the palm is automatically controlled by the location of the thumb and so is the animation of the carpals and (this being one of my first rigs) each individual spine has an armature bone . The hand rig is a good “piano player” setup, but sucks at making a fist easily (that was before we got pole targets - maybe I’ll dust it off and fix it up some day), and I would not use 24 individual bones for a spine anymore .

But the point is that I think you need the right tools/solution for the situation . And usually the simplest one is usually the best . I don’t know where and how using a softbody sim to drive an armature would be useful (your old and new setups are akin to setting up for ragdolls in the GE to drive an armature to simulate a fall) …

On the subject of Maya’s spline IK … That link you gave on the the making of Burning Safari didn’t show mush in terms of how it behaves … I guess it is a set of linked bones that behaves like a curve (but without the uncontrollable stretching of a curve) ? Well the closest (and simplest) thing you could set up in Blender is the blend I have below . You could use an actual curve/hook it with control points/use IK etc. etc., but just by using a single constraint type (Copy Rotation) along a chain you can easily get interesting results (I belive the last one comes closest) . Also you could add influence drivers to get more control if wanted … Just a guess though …

Sorry for the long post, but I had some “down time” because of the bot attack . Beside which you seem interested in discussing rigging issues and know your stuff :wink:

Attachments

maybe_IK_spline.blend (189 KB)

Hey thanks VP :slight_smile:

First off, I totally agree, your solution to this thread is much simpler and better suited to the problem, and I recommend it to Gwenouille.

The copy rotation bone chains are great! However I don’t think they would work very well if they brush up against another object (and need to bend non-uniformly). Another advantage of a dynamic spline IK is really that it can be turned off. In the same way you would switch a bone chain from IK to FK and back… you can have it dynamic or not, and you can animate that as well, or tweak part of it if the solver misbehaves. Definitely overkill for this situation, but it has its uses :yes:

I have no idea what Autodesk has done with Maya, as I don’t use it anymore either. I haven’t in over a year now. And I don’t want to sound like one of those guys who goes on constantly about how Maya is better, because I’m more keen on Blender myself :wink: However there are some really great rigging techniques in Maya that I have yet to come across in the Blender community, so I’m doing my best to find equivalent ways to get the same behaviours in Blender.
Spline IK aside, there is also the Ribbon Spine (which takes advantage of surface information, and is hailed for being virtually indestructible!), and the curve on surface technique for rigging lip controls (can’t find an example of that one, but it’s basically getting lip controls to follow the lip surface, but also deform the lip when moved. It’s pretty much a dependency, but in Maya you can get away with it through constraints. I think this can be done in Blender using 2 armatures.).

Your skeleton looks fantastic! :RocknRoll: And I would be very interested in talking rigging further, as I recently rigged a skeleton myself. Although not nearly as detailed because I’m planning to also add muscles and skin to the same armature! I went with the 24 bones on the spine approach, but it was really awkward to solve! I would be very interested to hear your ideas on it…

However, I think this conversation has deviated far enough for one thread :rolleyes:

I have started a new thread to discuss rigging biped characters, starting with realistic humans, and I have posted the skeleton I have been working on. I would be honored if you joined me!
I have also started a thread on quadruped character rigging, if you are interested. It is just a horse so far, which was initially created by Catboy85. I plan to introduce a dragon with an extra long spine and tail when the horse is complete :wink: (fun! :D)

Cheers!