Mwni / blender-animation-retargeting

Add-on for Blender that allows the transfer of animations and poses from one armature to another
484 stars 48 forks source link

Corrects seem to clear / reset the rest of the rig? #9

Closed joshcamas closed 4 years ago

joshcamas commented 4 years ago

Hello! First off, thank you so much for building this addon. It's incredible seeing a retargetting tool finally come back to blender.

I'm having an issue with corrections - both hands and feet. Once I enable it (and set both hand+upper arm bones), the pose seems to reset, clearing all drivers on the whole rig. Strangely the arms seem to somewhat be animated, even without drivers. I'm guessing that has to do with the hands correction strategy?

Regardless, odd bug. Is this a known issue? It's almost like it had an error and stopped halfway through, but there are no errors in the command window.

Mwni commented 4 years ago

It's almost like it had an error and stopped halfway through

That is exactly what it sound like to me aswell. This is not common, in fact the first time i heard of this.

I'd need something to troubleshoot, like a copy of the armatures used, or more details about your setup. Are you using 1.81+?

joshcamas commented 4 years ago

I'm using 1.83. I realized I had a copy rotation bone constraint on the hand bone (it was disabled, but still it was there), and it looks like removing it somehow allowed some errors to print. Maybe it got a little bit further then still failed.

ERROR (bke.anim_sys): C:\b\buildbot-worker-windows\windows_lts_283\blender.git\source\blender\blenkernel\intern\anim_sys.c:2815 BKE_animsys_eval_driver: invalid driver - pose.bones["lowerarm.l"].constraints["IK"].influence[0] ERROR (bke.anim_sys): C:\b\buildbot-worker-windows\windows_lts_283\blender.git\source\blender\blenkernel\intern\anim_sys.c:2815 BKE_animsys_eval_driver: invalid driver - pose.bones["palm.r"].constraints["Copy Rotation"].influence[0]

This is interesting. Both of these constraints (IK on lower arm, Copy Rotation on palm) were constraints I had but removed during testing to see if it would fix things. Is this a coincidence?

Mwni commented 4 years ago

These errors pop up even after you removed those two constraints? If so, when exactly do they show up?

Mwni commented 4 years ago

You know what I think is going on here, blender internally uses drivers to implement constraints, and my addon somehow pinned the internal drivers so they remain even if the constraint was removed. that is basically what the errors say, it tried to access the constraints properties, but the constraints are not there anymore.

Can you try the setup without constraints before applying the retargeting so we have a baseline?

joshcamas commented 4 years ago

Hmm, it looks like it's almost "corrupted". I'll have to start from a fresh rig.

joshcamas commented 4 years ago

Alright, it looks like this may be the case. I started from a fresh rig, removed the constraints, and then retargetted. Same issue, same errors.

Interestingly, when I removed the constraints, it threw the driver error once. Is this normal, or could this point towards a possible blender bug? ;o

Mwni commented 4 years ago

Yeah this is starting to look like a blender bug. The fact that the errors were thrown before the addon even had the chance to mess with it is evidence of that. One last thing you could try is restart blender without the addon, then do it again to see if really has nothing to do with it. Other than that i'd need a copy of the setup to know.

joshcamas commented 4 years ago

Yep, I disabled the addon and restarted blender, and it still throws the error. Pretty sure this means it's a blender bug. Here's my setup, the retarget config is included. As for the hand fixing bones, it'd be "upper_arm.l" and "palm.l".

Thank you so much for working so hard on helping me, it's beyond helpful.

https://drive.google.com/file/d/10J35pued_Unv4Kma_GfSizKVS6qMkx3C/view?usp=sharing

Mwni commented 4 years ago

So, luckily the only real problem was, that you had some of your bones marked as protected, and the addon bit its teeth out trying to modify the rotation mode of the bones. Just uncheck protection from all bone layers, and everything works. Will consider this case in the next patch.

On a side note, i see your model is having rather unexpected hip movement, if you have any ideas what to incorporate into the addon to help against such, feel free.

Mwni commented 4 years ago

About the last part, i just saw that your targets root bone was half a meter behind the back, moving it to the center of the hips in edit mode alleviated the strong hip sway.

joshcamas commented 4 years ago

Ah, I forgot I had removed that line of code that set the rotation, since there originally was a reason for those bones to be protected. However, even if I do indeed uncheck protection, it still doesn't work. (correct hands or feet position). Did you try correcting one of them, and it still worked?

Mwni commented 4 years ago

Yes, it all worked perfectly. I've mailed you the .blend.

joshcamas commented 4 years ago

This is very strange. I downloaded the blend, and am still having issues. When I enable "Correct Hands Position" and fill in the bones, the rest of the body stops animating, with just the arms animating. Screenshot_341 Screenshot_342

Am I missing something? I feel like I must be going crazy...

Mwni commented 4 years ago

Can you try quickly turning 'Disable Drivers' on and off. It sometimes glitches directly after loading and doing that makes the addon rebuild all the drivers

joshcamas commented 4 years ago

Hm seems to not work. I'm using blender 2.83, and I tried removing all other addons. I suppose there's nothing that can be done if it can't be replicated on your end, very strange...

Mwni commented 4 years ago

You said

When I enable "Correct Hands Position"

.. that option should have been enabled already in the file i sent you. you did use the .blend file i sent in the email attachment, right?

joshcamas commented 4 years ago

I did, although when I opened the blend file you sent me, it doesn't seem to load the state correctly, so I still had to load the config, apply alignment, and so on. Here's what it looks like when I open it: Screenshot_343

Mwni commented 4 years ago

Ah, you see, the file you opened is still your old file. I didn't send you a google drive link, I replied to your google drive link with an actual email attachment and you must've mistaken that google drive link with the attachment. ;)

joshcamas commented 4 years ago

OH I finally downloaded the correct file. Alright, when I open it up, this is what I get: https://www.youtube.com/watch?v=N5MQKwfNMCY&feature=youtu.be

Essentially, whenever any correction is enabled, the drivers that modify the various positions and rotations on the stomach and such are no longer active.

Mwni commented 4 years ago

Well, there's not much i can do anymore. We run the same version with the same setup and your system console prints no errors...

joshcamas commented 4 years ago

Yep, all I get is that blender driver error. Well, thank you so much for all of your dedication! Hopefully it'll magically fix itself somehow, clearly something is wonky on my end :)

Mwni commented 4 years ago

Maybe try to delete those faulty drivers on all bones that cause these errors: driver Other than that, good luck :D

joshcamas commented 4 years ago

Alright, I seemed to have found the problem. Somewhat. I decided to just copy my base rig file and apply everything, and it worked, without needing to delete my various bone constraints, and thus avoiding the odd driver brokenness errors.

The issue seemed to have stemmed from the fact that this rig that I was experimenting on was a linked proxy. I had unlinked it to see if that would fix it, and it didn't. It seems somehow if the armature was ever linked at one point, somehow that breaks it permanently. At least, on my machine. That has to be some sort of blender bug.

Thus, I guess I can't have a linked armature and use the tool. Darn! Regardless, as long as I avoid linking at any point when dealing with this tool it works perfectly! Thank you so much for your help, and the tool itself. It's a huge lifesaver.

Mwni commented 4 years ago

Good to hear! That also explains why it worked for me. Didn't even know linking armatures was a thing tbh. Anyways, it's on the list for the next patch. Take care.

joshcamas commented 4 years ago

Yep, the issue stems from when linking an armature and converting it into a proxy. Apparently blender is working on a new feature called "Library Overrides" which will replace proxies, perhaps when they implement it these issues will be solved on their end. :))