- 編集済み
Possible to use IK to stretch a bone?
I know it's possible to use an IK target to stretch a path, and this path can be used to stretch bones within it set to ChainScale.
Example:
^^from forum thread: http://esotericsoftware.com/forum/Squashy-Stretchy-Seaslug-Animation-Experiment-7510
However, I'm looking for a way to stretch a bone toward an IK target without the use of a path. So I want it to both rotate toward the IK target bone, and to scale relative to how far away the IK target moves. Is this possible?
This is the best I've been able to come up with - a path, one stretched bone constrained to the path (set to chainscale), and the path is weighted to an anchor bone on one end, and a target bone on the other. So I didn't actually have to use IK, but rather made a target bone that behaves like an IK target for the path.
I have one extra bone that would be unnecessary (stretcher_horz is not needed), but I wanted to use one bone for vertical scaling and one for moving the target left and right, because I'm weird. Anyway, this is still more complex than I'd like it to be.
This does what I would like for it to do, but I would really like to be able to achieve it without the path being necessary.
It would be very helpful to my current character rig if I could just use an IK to stretch the green "stretched_bone" in the screenshots. It would currently require (in my specific skeleton) the use of about 4-5x the number of bones/paths/etc compared to the one bone and one IK target that could be used if IK constraints could also stretch their constrained bones. I'm trying to limit complexity, but so I can more efficiently work on animations with fewer bones / less fuss, and so that our game doesn't end up with slowdown due to my overly-ambitious skeletons
If it is not possible, is this something that could be added - to have bones stretch (scale) relative to an IK's movement?
Thoughts? Thanks everyone!
Nate, if you're reading this, I just realized this is a similar request to something else I saw someone requesting, but can't find now
I believe someone was just asking if it would be possible to bind one type of transform constraint to another - so bind scale to translation, or rotation to scale, etc. I believe that if you implemented this, it could be another way to achieve what I'm requesting above, and also answers your question of "to what degree should scale be bound to translation"?
There isn't a way to make IK stretch. As you found, paths can make a bone stretch, so that is probably how I would solve it. Though, why does it matter if the bone stretches? If you have 1 bone IK and bind the constrained bone and the target bone to a mesh, you can make the mesh stretch between them without actually having a bone between them.
I'm actually not needing a mesh to stretch at all - I need multiple parts to be moved proportionally to the "stretching" of the bone... which is why I need the bone to stretch. Again, it's basically the same thing that would be achieved with ChainScale within paths... I am just trying to get around having to use a path or a mesh to achieve what I could (in theory) do by only using bones.
Gotcha. Using a path is the way to go, I don't think there's any other way for now.
Would it be possible for you guys to add the capability for users to remove or collapse the bezier handle(s) on a path? For example, if I wanted a path that was always a straight line, or series of straight lines/angles. Thoughts?
We considered it. The issue was finding a way to do it without making the UI more complex, so for v1.0 of paths we decided to keep it simple. It's something we can look into again in the future.
BTW, 3.6.00-beta is up and has a few of the new features you requested.
Awesome! I just got the update last night, but hadn't had a chance to look into what's new, but I will do so shortly. Thanks for implementing my suggestions! You guys rock.
All of the improvements to showing the relationships of bones/constraints are excellent - showing the arrow and constraint name when hovering over the icon, and highlighting related bones/constraints in the tree. Great job!
One more question about constraints - sorry this should probably go in another thread, but I didn't want to keep filling up the forums...
Let's say Bone B has a parent, Bone A - they are both rotated to 0 degrees. But Bone B is set up with a transform constraint to a totally unrelated Bone C - set to 100% rotation, and nothing else. Bone C is also set to 0 degrees rotation.
Currently, whether Bone B has "inherit rotation" checked seems not to matter. It will always match Bone C's rotation, so if you rotate Bone C to 30 degrees, Bone B will be at 30 degrees. If you then rotate Bone A to 10 degrees, Bone B stays at 30 degrees. So ultimately, Bone B is behaving as if it has "inherit rotation" unchecked with relation to its parent - and is rather directly inheriting "world" rotation from Bone B.
However, I would like to be able to check "inherit rotation" on Bone B, so that when I rotate Bone A 10 degrees, Bone B follows by 10 degrees (so that it is at 0 degrees "parent rotation"). If I then rotate Bone C by 30 degrees, Bone B rotates these 30 degrees "locally", meaning it is now at 10+30 = 40 degrees. This would be the same transformation as changing the transform scope from "world" to "parent" and setting rotation from parent to 30 degrees. If on the other hand I had done the same action with "inherit rotation" unchecked to begin with, Bone B would completely ignore it's parent's rotation as it currently does and would be at 30 degrees.
Currently I can find no other way to make the rotation of these two bones additive, unless Bone C the constraint target of Bone A instead. In some cases, this is not currently possible for me, since Bone C may have another rotation constraint, and whichever is last in the constraint order wins. So... I'm stuck.
ryancbaker wroteThis would be the same transformation as changing the transform scope from "world" to "parent" and setting rotation from parent to 30 degrees.
Note this is only true when nonuniform scale is not used. With nonuniform scale rotations cause the tip of a bone to trace an oval path.
It's not hard to change transform constraint to use additive for rotation. Can you explain your use case? So far you have only explained what you want to do, but I'd like to hear why. It would need to be useful enough that others might also want to do it.
This will be really hard to explain with my skeleton (which is WAY more complex), but I've tried to boil down the problem into a very simple example that illustrates the same issues.
Imagine that this is a character in a top-down, isometric perspective. So the camera is not a side view, but slightly above (think Final Fantasy Tactics, Zelda, etc). My character here is facing Southeast. The eye and mouth are the character's actual eye and mouth, and those are children of a head bone (in gray). The other two green arrow bones are the bones to which I would attach their torso and legs, etc. which are children of the main character spine (also in gray).
Below the skeleton, I have a bone (Character Heading - the one that's currently selected) that controls the character's facing direction. I have transform-constrained the angle of all the green body part bones to this Heading bone (set to 100%).
In the game, we will programmatically change the angle of the orange Character Heading bone as the character faces different directions, plus swapping textures, etc - don't worry about the details of how the character's textures would be changed to face those directions, since that's another issue entirely.
So when the orange Heading bone rotates, the eyes and mouth will rotate to follow it:
This works perfectly.
However, if I want to tilt the character's head slightly to one side (let's say they are aiming down the barrel of a gun, cocking their head, or some other body motion like that)... then we run into issues:
As you see, since the eye and mouth are inheriting their rotation verbatim from the Heading bone, they do not rotate with the head. Rather than the eye still looking like it's positioned above the mouth (with respect to the entire head), they are now side-by-side, and my character looks even more like a mutant There are all kinds of ways that I could correct this issue, but I would really like a more direct solution:
Allowing constraint transforms to be additive.
If the angle of the eye and mouth could be both inherited from their parent (the head bone) and added to the rotation of the Heading bone, then they would appear as desired, here:
(this is just an approximation, the angle probably isn't exactly correct since I did it by hand rather than mathematically):
*one correction - my constraint called "head angle constraint" should have been called "eye angle constraint". Sorry for any confusion there - the head bone (in gray) is not constrained to anything.
Thanks. Hmmm. It seems like that's a pretty unique setup. Would the Relative
checkbox be useful for scale and shear?
Another checkbox we've considered is Local
. When unchecked it matches the world transform to the target (as it currently does), when checked it matches the local transform. Do you think that would be useful?
I'm all for giving additional control options of any sort - so I would probably answer yes to both the relative and local checkboxes.
The more complex my rig gets, the more I rely on transform constraint target bones that I put off to the side (like the master rotation heading bone in my example above). These "controller" bones are often parented to nothing, so they can't inherit rotation that is coming from the character, unless I want even more constraints, and a general inheritance mess.
As another example: if I wanted a character to be covered in buzz-saw blades, and wanted that external bone to control the rotation of all buzz-saws at once, they would all need to spin at a speed based on the constraint target, but also relative to their parent - so their parent's rotation plus the rotation of that external constraint bone. That way the buzz-saw on the character's arms will seem to spin at the same speed as the one on their head or torso, whether the character is waving their arms or standing still.
I think Buzz Saw Man is a good use case.
I can actually see a lot of use cases for a Transform Constraint with an option to apply the transform locally. For rotation you can achieve the same result by using multiple bones like this:
Loading Image
But it does complicate the skeleton somewhat and it would not work with translation.
I could see this being useful in motion graphics especially.
In 3.6.05-beta:
Loading Image
Shiu wroteansform locally. For rotation you can achieve the same result by using multiple bones like this:
But it does complicate the skeleton somewhat and it would not work with translation.
Yes, it allows for some nifty tricks. I do have several instances where I'm using child bones at different angles like you have, with their parents all inheriting from a single constraint target. But as you say, it does double the number of bones needed to pull off the effect. But in a lot of cases, it can be quite useful.
@Nate - thank you so much for the addition.
You guys rock even more every time you respond.
I'm updated to 3.6.04 beta, but I'm not seeing the new Local / Relative checkmarks in my transform constraints. Maybe it will be in the next update? :party:
Nevermind, I just looked at the changelog and see that it's coming in 3.6.05 instead. Thanks again!
How is the first animation in this thread accomplished? I can get the IK constraint to move a path like Stretchyman, but can't seem to figure out how to scale the IK bones up when the IK constraint is moved (ie stretch the path)
I believe that the original creator explains a bit about the method in the original post, but you may want to check with him/her for more details: Squashy & Stretchy Seaslug: Animation Experiment
I dont even know how to use an IK to stretch a path. Can someone explain it to me, plz