Figure setup and Inverse Kinematics Problem



  • Hi,
    I would greatly appreciate if someone could help me identify the issue I have with IK for newly created figures.

    Once I create IK chains and turn IK ON, when I try to move figure's hands and feet a bit further from the body, outlined object for hands and feet appear outside the selected object that I move. When I release the object that I'm moving the outlines disappear. This seems to be the indicator that something is wrong with the figure setup.

    When I pose the figure while IK is ON and when I save the project and reopen it, the pose is completely ruined since both feet and arms are now rotated to some "unnatural" position. The pose and the animation is now completely useless since limbs are no longer positioned properly.

    Also, when I pose the figure with IK turned ON, and when I turn IK OFF, suddenly hands and feet move to some other position and the pose is ruined again. This is happening with every figure I setup. I have the same issue in both Poser Pro 2014 and Poser Pro 11.

    I am not sure if I am explaining the issue well, so I have attached a link to the video that will probably present the issue better.


    I'm really stuck here so any suggestion is more than welcome.



  • IK works by moving the end points or the beginning of the chain. Load any figure Andy being a good choice. His hip is start/end of the feet IK chains. With IK on you can move the Hip or Foot and it will make the leg bend. As in real life your leg is only so long, if you move the foot target the beyond reach of the foot Poser will let you do that and you see the ghost outline appear which shows where the foot is trying to get to. Now if you place the foot outside the reach then move the Hip IK will try to match them up. Try this with Andy loaded and IK on for both feet grab his hip and move him up and to the side and watch what happens to his feet. The toes will point towards the IK target.

    As far as IK is concerned you either leave it on or off. At least until you learn how it works. Small movements are best. What you can do is turn on IK make your movements with the endpoints (feet/hands) or start point Hip or Chest. Turn off the IK then turn it back on right away. What this does is place Key Frames at the movement points. But as the Curves are Spline they most likely will have over shoot. TO get around this is go to the animation tab and select Resample Key Frames and choose every 1 frame. What this does is place a key frame at each joint that would not have had them if you just used IK. This bakes in the motions as you see them with IK on. The only issue with this is that it makes for a large number of frames that will be harder to change.



  • Hi,
    That makes sense, thank you for the effort. However, I am familiar with posing figures, animation frames and how to use IK. I've been working with other figures on the market and I have no issues using them. The only problem I have is with my own, custom figures that I've created from scratch. You see, other figures such as Andy do not have this issue I'm experiencing using custom figures and IK chains. Also, when I move Andy's limbs outside the reach, the outlines for "goals" (goals=feet and hands) do not appear. Furthermore, when I save and reload the project with Andy and IK turned on while posing it, it works well. Hands and feet are in correct positions upon reopening the project.

    Creating IK chains is quite straightforward and is easy enough to setup. Looking at the example figure and it's bones, the lower part of the figure consists of the hip and left/right bones for thighs, shins, feet and toes. For the left leg IK chain would be the left thigh as the root+left shin+left foot as the goal. and that's it. IK Chains are working correctly when I setup IK chains for my figures. However, when I save the project with some poses applied to the custom figure on the timeline, "goals" are rotated upon reopening the project. From here I can only zero the figure and pose it without IK on, the figure itself is not messed up, only the pose.

    I also tried to delete default IK chains from Andy and recreate them. I've created new IK chains and renamed them, applied pose to Andy with IK ON, saved the project, reopened it, and everything was working well.

    Then I did the same for my custom figure, deleted all IK chains, created new ones, turned IK ON, applied pose to the figure, saved the project, reopened it, and all "goals" were messed up again.

    What am I missing? Do you know what could go wrong with the figure setup to make IK chains behave like this?

    Thanks!



  • @richard60
    Hi,
    That makes sense, thank you for the effort. However, I am familiar with posing figures, animation frames and how to use IK. I've been working with other figures on the market and I have no issues using them. The only problem I have is with my own, custom figures that I've created from scratch. You see, other figures such as Andy do not have this issue I'm experiencing using custom figures and IK chains. Also, when I move Andy's limbs outside the reach, the outlines for "goals" (goals=feet and hands) do not appear. Furthermore, when I save and reload the project with Andy and IK turned on while posing it, it works well. Hands and feet are in correct positions upon reopening the project.

    Creating IK chains is quite straightforward and is easy enough to setup. Looking at the example figure and it's bones, the lower part of the figure consists of the hip and left/right bones for thighs, shins, feet and toes. For the left leg IK chain would be the left thigh as the root+left shin+left foot as the goal. and that's it. IK Chains are working correctly when I setup IK chains for my figures. However, when I save the project with some poses applied to the custom figure on the timeline, "goals" are rotated upon reopening the project. From here I can only zero the figure and pose it without IK on, the figure itself is not messed up, only the pose.

    I also tried to delete default IK chains from Andy and recreate them. I've created new IK chains and renamed them, applied pose to Andy with IK ON, saved the project, reopened it, and everything was working well.

    Then I did the same for my custom figure, deleted all IK chains, created new ones, turned IK ON, applied pose to the figure, saved the project, reopened it, and all "goals" were messed up again.

    What am I missing? Do you know what could go wrong with the figure setup to make IK chains behave like this?
    Thanks!



  • I'm guessing this has to do something with the fact that IK re-parents goals to the body while IK is on, so I am not sure what I'm missing.



  • @kojot303 that's exactly right. If you ever look at a scene file which has been saved with active IK, you'll notice things like:

    actor rFoot:1
    	{
    	name    rFoot
    	on
    	bend 1
    	animatableOrigin 0
    	animatableOrientation 0
    	dynamicsLock		0
    	hidden		0
    	addToMenu	1
    	castsShadow		1
    	includeInDepthCue		1
    	useZBuffer		1
    	parent BODY:1
    	inkyParent BODY:1
    	nonInkyParent rShin:1
    

    Note the inkyParent and nonInkyParent lines. These are not normally saved for an actor whose IK has never been enabled or is not part of an IK chain.

    In the figure section of the scene or character file, you'll see the actual IK Chains

    	inkyChain     RightLeg  
    		{
    		on
    		name RightLeg
    		addLink rThigh:1
    		addLink rShin:1
    		goal rFoot:1
    		linkWeight 0 1
    		linkWeight 1 0.2
    		}
    

    The last thing which you would expect to see in a figure with IK, is visible translation channels in the IK goal actor, that are invisible when IK is turned off. You won't normally see the translation channels on a foot, since without IK, their position and attitude is entirely determined by the rotations of the parent actors, all the way up to the hip, which again has visible translations.

    The visibility of these translation channels will also affect how saved poses are stored. IK enabled poses will have extra translations specified. If you then turn IK off and apply the pose, whatever rotations happened to be in the channels of the link actors will be applied, regardless of whether they show the actual rotation values of the IK pose, which they commonly do not.

    This, I think, is the important point which can make things appear to go wrong. IK poses care only about the goal position (translations) and orientation (rotations). Every other IK chain joint rotation is derived by the solver. Also important to recognise, is that when IK is on, the goal's orientation is relative to it's parent, which will be the BODY, not it's geometry parent, so the angles recorded will not necessarily be the same as those required to place the goal actor in the same position and orientation with IK disabled, and the goal parented to its nonInkyParent.

    My solution to this, when I've needed to save both an IK and non-IK version of the same pose, is to use a second figure of the same type with IK turned off to match the pose from the IK figure. It's tedious and one would have thought to be unnecessary, but it's the safest way to avoiding the risks of corrupting poses by continually switching IK on and off. IK is also notorious for applying rotations to joints that are physically restrained on living humans, like side-side rotations of the forearm or shin, which are normally zero (or very small). They should be implemented for realism, by rotating the parent actor until the bent limb is aligned with the correct plane, but the solver doesn't work that way. It just minimises the rotations of the current actor.



  • @anomalaus Thanks for the explanation.
    However, I wish I could dig deeper into the problem since other figures such as Andy, V4, M4, etc, don't have this issue. If you take Andy for example, it doesn't matter how long I stretch its arms and feet while IK is ON, reopening the project with saved poses will stay intact, IK chain "goals" will stay in the saved position. If I try to do the same with my custom figures and save the pose while IK is ON, upon reopening the project "goals" will be rotated in some other position.
    There must be something that can be done with the figure setup to avoid this issue.



  • I am really desperate for help regarding this issue. Any ideas?



  • @kojot303 it's a while since I've played with IK. When I was doing so regularly, I adopted a technique of loading two identical figures, one with IK on, and the other with IK off. Make the non-IK figure appear in outline mode. Save poses for individual frames to the library from the IK figure, and then apply them to the non-IK figure. this will give you a direct indication of what the uncalculated rotations of the IK limbs are set to. Adjust the non-IK figure's rotations to make the limbs coincide with the IK figure's limbs again, and then apply the same rotations to the IK figure. Repeat the cycle to confirm that the IK pose preserves the correct joint rotations when applied to the non-IK figure. This will give you a pose file that works whether IK is turned on or not.

    I know this is unnecessarily tedious, but it's the only solution I found, since the IK solver does not properly calculate all of the IK joint rotations to allow the pose to remain identical regardless of the IK state. This is understandable from the viewpoint that translations of the endpoint of an IK limb are not constrained sufficiently to prevent the limb being stretched beyond its non-IK limits. IK also pays no regard whatever to joint rotation limits, when translating the endpoint. This is especially frustrating when dealing with human knees and elbows which do not have six degrees of freedom. Forearms and shins do not normally (OK, people with looser joints do have a small range of movement) bend side-side. That movement is achieved by twisting the upper arm or thigh. IK frustratingly ignores that restriction.