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?
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
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.
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.
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.
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.
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.
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!
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.
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!