FlailingFog / KK-Blender-Porter-Pack

Plugin pack for exporting Koikatsu characters to Blender.
310 stars 29 forks source link

KKBP armature has a bad knee deform driver for when the leg is bent #417

Open nemeannostream opened 1 year ago

nemeannostream commented 1 year ago

It seems that the rotation driver added to bone cf_s_leg01_L (or _R) causes the knee to scale down in an unnatural manner.

With the driver: Bad KKBP knee deform with driver

Without the driver: Not bad KKBP knee deform without driver

I've tested this with two other models, and have confirmed that this doesn't happen with the Rigify armature.

ilcane87 commented 1 year ago

Hi @nemeannostream, you are right, that driver wasn't there until this commit in february: https://github.com/FlailingFog/KK-Blender-Porter-Pack/commit/571662bb92a10fd6a713a991bea948ace712a296. Seems like it's something that was added to correct the looks of the knees when kneeling, but it was probably only tested with the Rigify armature since that's the one used for retargeting animations.

@FlailingFog The Rigify armature has no axes differences in the bones involved, and the values resulting from the driver are the same, but the effects of scaling that bone are much less pronounced compared to the KKBP armature: Scene Supposedly this is happening because of the weights of the lower leg being subdivided in three separate parts, though I wouldn't be able to point out exactly which constraints are affecting them.

I think the best bet to fix this is to either find different values that look good for the KKBP armature or just not add the driver for it, then I can revert the changes in the Rigify conversion script.

FlailingFog commented 1 year ago

That's very weird because I remember making the driver while using the KKBP armature... I put a check to only add that driver if it's a Rigify armature.

@ilcane87 It probably makes more sense to do it that way, but for now I've added a check in the import scripts. If you want to add it to the rigify conversion scripts instead, let me know and I'll remove it from the import scripts.

ilcane87 commented 1 year ago

@FlailingFog I implemented the drivers in the script, but I haven't uploaded the new version yet because there's something I'm not clear on: I noticed in the code that there's also a related driver on the 'cf_d_thigh03_L/R' bone, but that bone has no effect after the Rigify conversion because the weights it used to influence are transferred to a different bone, so it just ends up in the Junk layer of the metarig, which is emptied after generating the control rig: Scene Since you said you tested these drivers on the KKBP armature, maybe that one needs to be added to a different bone for the Rigify one? Do you have a reference to verify that the drivers are doing what they are supposed to do?

FlailingFog commented 1 year ago

No, I don't think I have the reference file anymore. I also don't remember what the thigh03 driver was supposed to do... I just tried to make the knees thicken when the legs were in a kneeling pose. If it still looks thick during a kneeling pose without that bone, I don't think it will matter too much if it is not used.

ilcane87 commented 1 year ago

Uhm, I tried retargeting a kneeling pose ("Sitting 2"), and this is the result without and with the driver on the left knee, compared to Koikatsu on the right: Scene2 So the driver is actually making the knee thinner rather than thicker when bending the leg, although that does seem to be more consistent with Koikatsu; maybe it's not super clear from the image, but you can see that with the driver the X scale is decreased, and while the Z scale is slightly increased, the effects of increasing that in the Rigify armature actually result in a thinner knee: 2023-05-01 12_46_35-

If you confirm that this is the expected behavior I'll upload the new version of the scripts in the usual thread.

eavme commented 1 year ago

By the way, yes, I also noticed a problem with the knees of the models. And it doesn't matter what type of armature you use. If I'm not mistaken, rigify is even worse than KKPB

ilcane87 commented 1 year ago

Hi @eavme , are you talking about the same problem discussed earlier, or is it something else? If it's the latter, can you elaborate?

eavme commented 1 year ago

Hi @eavme , are you talking about the same problem discussed earlier, or is it something else? If it's the latter, can you elaborate?

I'm talking about the same problem as above. I wanted to open a similar discussion myself, but I stumbled upon this. Any choice of armatures severely deforms the knees and elbows when rotated 90 degrees.

FlailingFog commented 1 year ago

@ilcane87 I guess I have a terrible memory. I was really just trying to get the intense bent poses like abdata/studio/anime/00/floor/f_sadou_00_00 (or character > sitting on floor > tea ceremony in game) to look somewhat better. I'll take a second look at the driver. It's looking like the cf_s_leg01_R bone needs to move away from the body, but I'll double check.

@eavme I see this issue on the knees, but I believe the elbows are deforming correctly at 90 deg and higher. Can you take a screenshot of what's happening on the elbows?

FlailingFog commented 1 year ago

@ilcane87 ~It's still not exact, but I'm much more satisfied with the new driver values in the latest commit (only applied if rigify armature option is selected).~ sorry found another issue, don't use these I also commented out the thigh03 and cf_s_leg02 bones in the rigify conversion script so that they're preserved.

image image image

ilcane87 commented 1 year ago

Finally had a little time to check things out.

I also commented out the thigh03 and cf_s_leg02 bones in the rigify conversion script so that they're preserved.

This creates a few issues with the scaling of the legs as well as the tweak controls, because those weights are supposed to be controlled by the Rigify leg mechanics; see the picture below (no drivers on the left, new drivers on the right): Scene

The drivers on 'cf_s_leg01_L/R' and 'cf_d_kneeF_L/R' should work fine even without those changes, it's just the one on 'cf_d_thigh03_L/R' that's not as easy to replicate since those weights are controlled solely by the tweak bone, but I can't apply the same driver to it directly both because that would make it unmovable manually and also because there's some cyclic dependency issue that arises. If I had more time I may find a workaround with some typical rigging cyclejerkish arrangement, though it may be a while since I'm quite busy these days.

By the way, I noticed in the commit that you also restricted the knee tip correction drivers to the Rigify armature, was that intentional? I'm asking because I remember those being there even before I did the conversion thing.

sorry found another issue, don't use these

Just read this now, I'll check out the new version when it's ready then.