AmimOffset Not working in Blender 4.1 on some Rigify control bones
Hello! I used AnimOffset feature of this amazing add-on for a long time and it works great. But lately I moved to Blender 4.1 and sometime this important function (Anim Offset) stop working and sadly I can’t move back to previous version of blender because the rig will be broken. I’m using Rigify Human Rig and some controls just not moves or rotates when AnimOffset is On. Please help! When for example hand ik control doesn’t have keys - it rotates, but after i insert a couple of keys - it stops… I tried to dig into the code - but it’s too hard for me, so maybe someone can adapt this cool addon for new Blender. To speed up testing I created new Rigify Rig and inserted some keys, so anybody can just download the file, open it, Enable AnimOffset mode and try to rotate hand_ik.L and to see this problem. But this happend with other bones too, just I can’t find clear logic when and why they don't want to work with AnimOffset Enabled. Thanks! 4-1AnimOffsetNotWorking.zip
https://github.com/aresdevo/animaide/assets/23280578/2634ecc1-6b53-4b2b-9a31-5ee06cc9c017
no idea what would cause this but I deleted the two keyframes on the 'Torso' bone and now it works fine. no other keyframes seem to be related and I was able to add keyframes to 'Torso' again afterwards
@augmero Thanks for taking a look! Yeah, it's a very strange case. In practice, in finished animations - to delete part of the keys to make AnimOffset work on other bones - it is unfortunately not a solution... Well, thanks anyway) I guess I'll have to stay with 4.0 for now.
@aresdevo @Sharaf5 Hello! First of all, thank you very much for working on such a wonderful addon! Sorry to bother you, but do you have some time to look at this problem with AnimOffset in Blender 4.1? Thank you very much!
After some experimentation, I have identified some pattern of when this problem appears. At least in this case, with the hand - the animation key in the “Torso Parent” of the torso control. (By the way, this part of the panel, which was somewhat redesigned in Blender 4.1) If you remove this key - the hand with AnimOffset will start to rotate and move. If you put this key back on the torso - it will stop again:
https://github.com/aresdevo/animaide/assets/23280578/d1ad0852-e619-4064-bd9e-a8c8af34c420
Unfortunately in complex animations of characters interacting with the environment only this doesn’t help, something else prevents it from working properly…
here is a diff which fixes the issue in 4.1+
diff --git a/anim_offset/support.py b/anim_offset/support.py
index 04083da..452a04c 100644
--- a/anim_offset/support.py
+++ b/anim_offset/support.py
@@ -148,7 +148,10 @@ def get_delta(context, obj, fcurve):
target = prop[fcurve.array_index]
except TypeError:
target = prop
- return target - curve_value
+ try:
+ return target - curve_value
+ except TypeError:
+ return 0
else:
return 0
I won't submit a PR for it since it depends on #97, but it can be added on top of those changes.
It is caused by this upstream (bug/API change) issue in blender: https://projects.blender.org/blender/blender/issues/122843
Fix worked on my end with the provided file on blender 4.2, merged change into that PR. Thanks!
@Lateasusual @augmero Thanks a lot!!! I tested this fix also - now it's working fine! You're awesome!