Unable to create linear bone slip, slid or stretch on Inverse Kinematics

ques

This is a simplified version of part of a complex project I am currently working on. See image to understand my description. The slider is the input that is powered be continuous linear back and forth motion. Permanently attached to the slider is a pin that fits into the slotted end of the linkage. When the slider slides in either direction it should first slide to the end of the slot and then begin pushing or pulling the arm with the linkage. Animating it without the sliding motion that this project requires is simple. Just use a simple IK bone constraint and it just works. (See GIF) The problems begin after I attempt to create the sliding. I have tried using stretch on the linkage bone and use a limit scale constraint to limit how far the bone stretches to emulate the distance it could travel in the slot. But, I must not be fully understanding how the stretch works on IK bones because I can get nothing to work. Any ideas or workarounds?

Blend file with simple example
question.blend (552.7 KB)

Hi! What you ask for is unfortunately impossible as an ik constraint at the moment. There are work arounds but nothing perfect yet, see my thread here for info /ideas: How to make limited stretch on an IK chain?
I even thought about trying to code a patch for it, but I havenā€™t become that desperate yet :wink:

You might want to pm clockmender. He is really great on anything mechanical and Iā€™m sure he would help. He is a goto guru on animation nodes as well as mechanical rigging.

OK, I go check your thread. Been thinking of trying to achieve this with drivers if I canā€™t get armatures to work.

Its been years since ivā€™e been on this forum so iā€™m not familiar with who your are referring to, but I might trying searching for him or getting in touch somehow. Thanks!

Hey, The ā€˜stretchā€™ allows the bone(s) to stretch of course, but you have to enable it in the Bone Panel > Inverse Kinematics > Stretch - and of course tick the box in the IK constraint.
Here is your file back with one solution, if thats not what your looking for just let me know, I tried to preserve as much of your original stuff as possible, but I did have to fix several things also. I could of done a better job on the animation but its just a helper file. :wink:

https://drive.google.com/open?id=1ACQFlWOxgI1-ld8jQjE2IYPSNjCRhkRh

If I understand correctly, you donā€™t want anything to stretch, you want the ik target to not be the slider, but another bone thatā€™s constrained (limit distance) to the slider, or have a driver that does the same thing.

I think you may have uploaded the wrong file.

Yes, correct. I donā€™t want any of the solid parts to stretch. But if I could achieve what iā€™m trying to do by using bone stretch (limiting how much it stretches to emulate slot) , then I could just have my solid linkage copy rotation and location of bone that is stretching and not scale.

Alright. Thatā€™s a system thatā€™s history-dependent, in the sense that given a particular position of the slider bone, there can be different solutions for the ā€˜armā€™ thing depending on the way it is sliding (if itā€™s in the process of sliding to the right, the pin will be at the right edge of the slot, and if itā€™s sliding to the left the pin will be at the left edge). So, in any case youā€™ll have to animate it because Blender does not support history-dependent rigging (in other words, simulation). I can have a quick stab at it tomorrow.

Hadrien

OOOPPSā€¦Sorry about that, I fixed the link in my post. :frowning_face:

I actually was looking for a way to do this that is totally automatic. If it was a simple animation I would keyframe it but this final rig in my project needs to work without manually animation, since it will be used in various different scenes at random speeds. I may need to write a script in animation nodes to handle it if its not possible with bones, shouldnā€™t be to hard after I figure out a simple procedural way to calculate it.

Iā€™m not really interested in manually animating it for reasons I stated in my last post. I do understand what you are referring to when you say history dependent thought. Ivā€™e sometimes used an objects custom properties as a variable when trying to programmatically figure out rotational direction. Maybe I could implement something similar and use drivers to procedurally animate the scale of the linkage bone based on the direction the slider is moving.

Ok - if the slot was parallel to the slider/frame and you used emptyā€™s or objects, you could use the ā€˜delay parentā€™ hack.

Iā€™m not aware of this ā€œDelayed Parentā€ technique.

Its in the Object Data > Relations Extras > ā€œSlow Parentā€.

This had me excited for a bit but after some testing I donā€™t think it will work. If there would be a feature in which we could modify the method used for calculating the delay it could be possible. So I guess iā€™m going to keep attempting this in the animation nodes.

So I thought I would leave a little update with my progress! I have a somewhat functional system, some glitch is happening in the animation nodes I think. The Gif is my current output.

almost_gud

I have a custom property on a object that I use to adjust according to the size of the slot. I then get that value in the nodes and use it to create a trailing value that trails the Y location value of the slider. After that I use some trigonometry to animate the Y and Z of another empty that the arm will follow. Iā€™ll upload the file so everyone can confuse themselves.

This is not method Iā€™m going to use for my final product since itā€™s much to complex and not entirely accurate. I have another idea that I may try yet and post when I get done. Any ideas or suggestions are still welcome though!

Current blend file. Ivā€™e been using 2.8

questionv2.blend (940.0 KB)

1 Like

Hi, just seen your message, sorry to say I am in Vietnam on holiday just now without my laptop, so canā€™t build a solution for you. I am back home 12 February and will do so then. I have built this kind of system before using IK, or AN or combination of both. It might involve using my own ā€œboneā€ nodes for AN, not sure yet, but I can tell you how to get these if needed, they are on my website: https://clockmender.uk read the bit on installation carefully though, saves hours of frustration!!

Also, I had a quick look at your node tree on my phone, I have to say it is massively over complicated and can be made far more efficient with the use of expression, or script nodes depending how good your python is. I tend to experiment with script nodes then write my own node once I have the technique sorted, if I cannot do the job easily with standard AN.

Anyway, I will look at this when I get home, if you have not already sorted it by then. Sorry I canā€™t help until then, but there is no iPhone version of Blender yet. :rofl:

Cheers, Clock :beers:

OK iā€™ll check out your site. Regarding the python scripting, I had started with a python script but then used nodes as I wanted to see how some of my calculations as I was building the logic. If I were to put it in a python script now it would probably be only 15-20 lines of code. Iā€™m not going to bother though because like you said, its over complicated and can be done much easier. Iā€™ll try a different method with nodes that I thought up and also your suggestion and post back the results. Thanks for the input!