shteeve3d / blender-wiggle-2

Rewrite of blender-wiggle with new features and physics
GNU General Public License v3.0
700 stars 40 forks source link

Randomly Stiff bones #21

Open MikelSotomonte opened 1 year ago

MikelSotomonte commented 1 year ago

Sometimes simulation just doesn't happen, keyframes get created when baking but both in viewport and after the bake there is no animation. Sometimes if I create a different rig and give it wiggle the previous skeleton will react and get simulated, but it's very random and most of the time it will stay stiff.

It feels similar to the fix introduced in 2.2.1, but I still can't get it to simulate some of the times after changing values.

shteeve3d commented 1 year ago

sounds very peculiar! if you've got a test file demonstrating the problem its always helpful. are you linking in rigs by chance? using multiple view layers?

MikelSotomonte commented 1 year ago

I am linking it. In this particular case, it's happening in a scene where I linked the rig. I went into the source .blend and there it got fixed by changing a value, but not in the scene that it's linked in, even after reloading it. It's tricky because I'm not able to replicate it, nor replicate the "fix". I can send you both files, but you will have to re-link the rig into the scene.

Oh, deleting other files in preparation to send you the files fixed the issue? Maybe it can have something to do with objects with the same names or data of some sort? I will send the scene without deleting the other objects. Annoying that it's so hard to pin-point.

rig: https://drive.google.com/file/d/12tD5vxih5oD4ck-UwRxCqXEknsjHZJmh/view?usp=sharing scene: https://drive.google.com/file/d/15cdw_gPmyMjh76RCaxD-wc6XhIFy0tbu/view?usp=drive_link

If I could very sloppily add a button that clears some flag or forces something to simulate it'd be awesome, I am trying to complete this project by a deadline, but I do understand that this bug is so hard to reproduce so probably hard to find the source of the problem too. Thanks for taking the time!

shteeve3d commented 1 year ago

quick note, i think the scene file isn't set for sharing on the drive link :)

also yeah a duplicate linked rig seems like a likely culprit. i'll see if there's any workarounds i can think of

MikelSotomonte commented 1 year ago

Oops! Link should be good now

MikelSotomonte commented 1 year ago

It could also be where the original file is bugged (like before updating a value with the glitch fixed in 2.2.1), and then when you update a value in the linked version it doesn't overwrite that flag?

shteeve3d commented 1 year ago

when i reconnected the provided rig in the scene, it the wiggle effect seemed to be updating ok. to test the namespace issue, i tried creating a duplicate of the linked collection.

inititally the duplicate doesn't show any wiggle physics (its stiff like you mention), this is because the scene (not the linked file) keeps track of the list of wiggling bones, and that list is only updated when either of the "bone head" or "bone tail" variables are toggled. this is to avoid having to iterate through every single bone in every single armature in the scene to check if its wiggle is enabled on every frame.

but by toggling one of the bone tails off and back on again, it forced a list update and the wiggle started working on both copies of the linked rig. to verify that each duplicate is doing its own unique simulation i also offset the animation action of the duplicate rig, and it still looked like everything was updating correctly:

Screenshot 2023-06-12 at 9 47 01 PM

i suspect why deleting objects in preparation of sharing the scene file might have "fixed" your issue is that if you deleted bones referenced in that scene wiggle list, it also would force a list update when the list encounters a bone that no longer exists in the scene.

try toggling one of the "bone head" or "bone tail" checkboxes off and back on again the next time the issue shows up and see if it gets things running again!

assuming that ends up being the issue, i think i can add a few more toggles that force an update of the scene wiggle list, like the top row of toggles on the wiggle addon panel for muting the scene/selected armature/selected bone, or when closing and reopening the file. (basically more actions a person might take when trying to troubleshoot why the wiggle isn't working)

MikelSotomonte commented 1 year ago

Toggling bone head or bone tail does not fix the bug. I haven't had much luck replicating the bug either, there isn't a step by step way to get the bug that I've found it seems like. Thanks for looking into this either way!!