Piston/shock rigging question

Hey all. I’m getting my feet wet in rigging and I’ve been trying to figure out how to get this working. I’ll try to explain it, but I’ve also included a drawing of the intended functionality.

The end goal is for this to be incorporated into a shock tower system on a vehicle but for now I’d just like to learn how to get the basic functionality working. The two ends should be able to track to one another and once the upper arm of the shock is extended to the maximum distance i’d like for it to have some stretch to it. Also, some squash after it’s pushed all the way in. I’m wondering if maybe there’s a solution with the new bendy bones system? Thanks for the help!

Hello,

Hope that answers your question . . . :slight_smile:


Attachments


Thank you for the reply. I’ve managed to get that motion working but this solution doesn’t seem to address the squash and stretch i’d like to incorporate.

I think you will be better off using an armature IMHO! That way you can both animate the mechanism and deform the various parts as required. Below is my standard “Pistons” blend file that I post quite frequently for this type of question, if you cannot find an appropriate solution in there, let me know EXACTLY what you want to do and I will update the file with some more options. There are options for both armatures and constraints, I suggest you use the armature method, either with the Stretch To constraint (easiest to build and understand), or the IK chain.


cylinder-problem-ver3.blend (1.84 MB)

Just press Play to see them all working.

If you are using constraints be aware of the Cyclic Dependancy trap - where one object is targeted to another that in turn is targeted back to the first (maybe even through a parent/child relationship) this causes these systems to go all wonky at times. :spin:

Cheers, Clock. :slight_smile:

Thank you for the response. I’ve got the in and out motion figured out. It’s the stretching and squashing I’ve yet to get working. Again, the idea is that once the arm reaches the maximum extension, it will then stretch. I’m assuming either using an IK setup or maybe bendy bones. Perhaps it is more complicated then it seemed.

Post a drawing of what you intend to do please, having said that - you can simply scale the bone that is associated with the piston or cylinder in one axis only, or you could even use Shapekeys that you activate after the cylinder has been extended - this may be the better way to go. Are you familiar with Shapekeys?

Tiredness after a long days gliding means I am now going to get some rest, but I will post a simple Shapekey/Armature solution tomorrow.

Cheers, Clock.

EDIT:

I forgot to say that you need to Check “Autorun Python Scripts” in User Prefs or the Drivers in that file I posted won’t work.

There is a drawing of the intended motion in the first post. Here’s the link. http://imgur.com/a/8kYHA Thanks for the help! I’ll look into shape keys this morning.

OK - I couldn’t get your picture to load - website just sat there doing nothing, but I did this for you anyway:


It shows the principle of shapekeys and armatures, if I have not guessed right at the “shrinking” you wanted, just try to post the image file here so I can see it, or PM it to me.

There is plenty of help around on how to set up shapekeys, basically just add the “Basis” key in Object mode, then add the “Factor” keys, also in Object mode. Select a key and then move the vertices to your new shape in Edit mode. Then back in Object mode just move the shapekey factor from 0 to 1 to see the deformation.

Here is the blend file:

shapekey-cylinder.blend (538 KB)

Just press PLAY to see it working, any questions, just ask. :slight_smile:

Cheers, Clock.

PS. sorry for the delay in doing this - I had a slight “Family” issue…

1 Like

Aha! your image has loaded at last… :spin:

New blend file:

shapekey-cylinder-2.blend (560 KB)

Cheers, Clock. :stuck_out_tongue:

1 Like