-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimum distance of TwoBoneIK sometimes leads to disappearence of bones #4
Comments
Just copying my reply from #2 over here, for anyone who hasn't read it yet:
Also, it probably is related to the minimum distance. When the minimum distance is too small, the bones can fold into themselves and I believe that is causing the issue. One potential solution would be setting the minimum distance to a minimum value based on the lengths of the bones, but ideally I should find a fix that makes it where the issue does not occur regardless of the minimum distance.
Sure, it shouldn't be too difficult to add. I'll add a maximum distance property when I'm working on the TwoBoneIK fix! |
Well that sounds reasonable. Because there are no solutions below the Only one point to add. The solution should be tested with those three configurations:
I could create a test_scene for that.
👌😃 |
Interesting. I wonder if the reason is that in 3D it has the benefit of having the pole node to help define the bend axis. That might help give a clue as to why the TwoBoneIK in 2D has the disappearing issue... Something to look into at any rate. Thanks for letting me know! 👍 |
At least it adds lots of stability to the result of the pose calculation: (Just one note: I changed to auto calculated bone lengths - not that this has changed anything as far as I'm aware of.) |
I just recently pushed a commit that should fix the issue. The issue turned out to be that the |
Issue seems fixed. I tried with different samples and nothing disappeared. 👍 Only thing I've noticed while testing is a lack of some kind of visible border (for debugging) when using the minimum or maximum distance. Something like the circle that is shown when using limited angles which should have the radius of the used parameters. |
I’ll see about adding a line or something for debugging to show the minimum and maximum distances when I rebase with master. Or maybe a circle or pair of circles? Hmm, will have to experiment! |
A pair of circles seem like a good fit. But it should be distinct from the angle constraints circle. Not easy to get the visuals right here. Maybe also an Editor switch could be introduced for switching the visibility of the lines on and off. |
I'm not yet sure if the title is correct but I encountered a strange thing where the TwoBoneIK somehow hides the bones if no pose solution can be found and the minimum distance is set to default (which is 6). It looks like that:
Here you can see two TwoBoneIKs trying to reach the target. When getting near the basis the bones disappear (in game and in editor). This can only be reverted by deactivating the SkeletonModification (
enabled = off
).Has this something to do with the
minimum_distance
? Because if I set it to for example 100 the TwoBoneIK is working fine and stops the chain at the distance of 100.Apart from that: Would it be possible to add a
maximum_distance
feature working like the minimum one?The text was updated successfully, but these errors were encountered: