Wiggle bones (a jiggle bone implementation for 2.8)

You are using it wrong. If you animated at 30 fps and the animation is 100 frames long and then if you ever want or need the animation to play at 60 fps then you need to scale the animation to 200 frames long, set to 60fps in the render tab and then set the frame scaling to your original framerate which would be 30 fps.
Works great!!!

also i’m pretty sure i could make it slightly closer. as of right now, it scales dampening linearly, but i’m pretty sure its more nuanced (like compound interest based on how many times you’ve sampled the dampen) i’ll have to do the proper math later :stuck_out_tongue:

1 Like

Oooh I see. I thought it would just be designed to be an independent slider. Didn’t quite get that at first, my bad. Just tried it that way and it works significantly better.

Hey Shteeve -

I recently installed a dual boot system on my Win machine to try Blender on Linux. It appears the performance issues I mentioned a while back were completely associated with being on Windows. I know you have had performance improvements since then but even with those changes comparing the way it works between them is night and day.

I can now appreciate your hard work fully! I have to say what you have done here is sooo wonderful and your efforts are very appreciated.

The one issue I AM running into is that bake bug where things bake with what looks like drastically different/inconsistent wiggle settings UNTIL you copy into another scene or project in which case it works.

feature request update!

-you can now toggle ‘reset on loop’ to control whether the wiggle physics state resets on the start frame or will be continuous when looping playback

-a ‘reset physics state’ button that lets you manually force a physics reset, which can be useful if you’re jumping around the timeline

-when using the ‘bake wiggle’ operator, it will automatically ‘pre-warm’ the timeline by playing through once before baking if ‘reset on loop’ is unchecked.

Some other misc notes:
-right now the looping bake tries to be ‘automagical’ in prewarming the loops, but realistically maybe it should let the user choose how many prewarm frames to run. opinions welcome!

-i changed some under the hood code for the bake operator because it was a little glitchy getting the right context for doing NLA stuff. let me know if there are issues!

-i see that in 2.81 there has supposedly been some updates to the depsgraph for frame change handler addons like this one that are supposed to help unlock the issues with rendering/crashing on rendering. i’m pretty sure it’ll require some code cleanup and some more effort to figure out the logic behind this depsgraph stuff, but i’m at least a little hopeful.

-i was trying to test more extreme cases with the frame rate changing code, and i don’t think it holds up very well. i was spinning my wheels a bit with the logic, but hopefully i’ll have an epiphany at some point.

wiggle_bones1_5_b11.py (47.0 KB)

2 Likes

i looked at that example file you’d provided again to see if i could isolate anything that could be causing it and i’m truly stumped.

-making a full copy of the scene, and the problem persists.

-create a new scene and copy and paste all objects between the scenes and it works.

-even doing “copy scene settings” on a new scene and then copying in the objects seems to fix the issue.

and since it happens entirely within blender’s own ‘bake action’ operator, its hard to know what could be interacting to cause the issue since its not present outside the operator.

are all the instances of this issue still with files authored in 2.79 or has it been affecting files created in 2.8 as well?

1 Like

I am actually not the other guy who had this issue so I haven’t sent you a sample file! In my case I have been exclusively in 2.81. I ran into it once while stress testing with an MB-Lab character - I’ll let you know if I continue to run into it in real scenes.

Can’t wait to try your new release above as well! Thanks again for your hard work!

The greatest addon ever! Thank you so much for creating such amazing thing :smiley: You helped us alot. I have a file that contains some action strips, other physics and particle system. Whenever I click Bake, I receive this error and the NLA editor appear instead of the properties menu that contains the bake button.

bpy.context.area.ui_type = 'PROPERTIES'
Traceback (most recent call last):
  File "C:\Users\Benky\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\wiggle_bones1_4_3.py", line 747, in execute
    bpy.ops.nla.action_pushdown(channel_index=1)
  File "F:\Programs\Open Source & Freeware\blender-2.80-windows64\2.80\scripts\modules\bpy\ops.py", line 201, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Animation channel at index 1 is not a NLA 'Active Action' channel


location: <unknown location>:-1

bpy.context.area.ui_type = 'OUTLINER'
bpy.context.area.ui_type = 'INFO'

I’m using version: wiggle_bones1_4_3
Please, help me what can I do? I rendered before baking and there was no animation at all. I have to re-render again. Your assistance is really appreciated. Thank you.

1 Like

Dude! this addon is amazing.much much better and faster than the other one :slight_smile:
There’s just one thing if you could do here…Can you please please add the option to bake as
keyframes like the jigglearmature does.This nla tracks and stuff it’s just not reliable enough.I’m
constantly having troubles with actions.and
for short looping animations,baking it directly to keyframes would be the easiest option…i think…

3 Likes

for what its worth, you can still totally bake the normal way (no additive nla layers) using blender’s bake action operator. the bake button i made isn’t really doing anything special other than automating a couple of steps for the user.

although as geogo_go correctly identified, it was being finicky in earlier versions. i think i’ve fixed that now.

yeah i ran into the same issues with errors on my bake button. i won’t go into the coding details, but i tried to address this in version 1_5_b11 posted above. you can give that a try, or failing that you can always just bake the normal way.

regarding rendering, its a known issue that frame handlers have had some bugginess when rendering in 2.8. there’ve been some partial fixes in 2.81 but there will need to be some re-coding to make use of them. solution for the time being is to bake before rendering.

Awesome!
How did i not know about this…great addon,please keep working on it,it has soo much
potential…can’t wait for collision :slight_smile:

And issue wasn’t in your addon but in blender and myself :slight_smile:

Thank you!

1 Like

naw my thing has plenty of issues! but i’m hoping to use it on the project i’m working on, so i’ll keep trying to push fixes as i encounter them :slight_smile:

3 Likes

Hi again,
Still smashing my head against the wall trying to get this to work the way I want.
I’ve managed to make the physics behave sort of the way I want now, but I cannot figure out how to bake it all down to one simple animation. Hitting the “Bake wiggle” button just returns an error message I don’t understand:


However, if I call the Bake Wiggle function from the search bar it does something. Though it seems that what it does is create a new NLA strip with JUST the wiggle data, which is blended with the normal action. When I export it, it ends up as two different animation actions in the resulting FBX file.
Blender’s own “bake action” function also gives me nothing but error reports:

Also, the new reset on looping action function doesn’t seem to do anything? I still get the same “twitch” on all wiggle bones at the start of every loop.

Here is my project file, if you would take a look: https://ufile.io/m5lw0yzb (cleaned it up - only 16mb this time)

Again, thank you for your time, and sorry for all the stupid questions!

oddly enough i don’t get any errors attempting to bake your file using either the bake wiggle button in my addon, or blender’s regular bake action operator. i looked up that error and it does appear there is some open bug report in 2.8, but it has to do with follow path constraints which you don’t seem to be using, so its a mystery to me!

with regards to the looping functionality, a couple notes:
-‘reset on looping’ is the the undesired behaviour for your case, you want that button disabled, not enabled
-unchecking reset on loop does indeed create a clean loop when i tested your file using my ‘bake wiggle’ button, however i realize you don’t want the additive animation…
-you can use regular bake, however you have to manually ‘prewarm’ the loop, such as playing the animation through in the viewport, and then advancing from the last frame back to the first frame

1 Like

as an additional follow up, i’ve made an updated version with the following fixes:

-‘Additive’ checkbox below the wiggle bake button that allows you to select between the additive baking i was doing previously and the flattened down baking from the normal bake action. This allows you to always take advantage of the auto-prewarming for looped animations that the jiggle bake button does

-disabling the armature or scene after baking was incorrectly disabling/enabling sets of bones as well. this should work better now

-stretch jiggle always assumed a rest scale of 1 if there was no keyframing. now it behaves like rotation and translation where non-keyframed rest poses are set to whatever a bone’s transform is when its enabled

-i tested on theonian’s scene, and things seemed to work, with caveat that for whatever reason the rest states were all messed up, so i selected all wiggle bones and toggled the enabled checkbox for the bones, which reset these rest states, then everything worked fine. i’ll look into why this happened, as it may be its own bug.

enjoy!

wiggle_bones1_5_b12.py (47.5 KB)

4 Likes

Thanks for the super fast reply!

That’s exactly the result I’m looking for!
Strange that the errors only seem to happen on my end. Ticking the reset on loop on or off makes no difference here, and I can’t get it baked (at least not the way I want) :frowning:

Will try out the new version and the new features you mentioned as soon as possible, but would you be so kind as to upload the file you managed to fix too? Either as FBX or a baked .blend?
It would be very much appreciated :smiley:

here’s the file with it baked using my wiggle bake button, reset on loop turn off, and additive bake turned off.

1 Like

also updated fix, turns out that issue i noted with b12 was in fact me not properly initializing a variable.

wiggle_bones1_5_b13.py (47.6 KB)

4 Likes