Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AmimOffset Not working in Blender 4.1 on some Rigify control bones #101

Open
MihaMS opened this issue May 10, 2024 · 8 comments
Open

AmimOffset Not working in Blender 4.1 on some Rigify control bones #101

MihaMS opened this issue May 10, 2024 · 8 comments

Comments

@MihaMS
Copy link

MihaMS commented May 10, 2024

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

AmimOffsetNotWorking.mp4
@augmero
Copy link

augmero commented May 18, 2024

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

@MihaMS
Copy link
Author

MihaMS commented May 19, 2024

@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.

@MihaMS MihaMS closed this as completed May 19, 2024
@MihaMS MihaMS reopened this May 19, 2024
@MihaMS
Copy link
Author

MihaMS commented May 23, 2024

@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!

@MihaMS
Copy link
Author

MihaMS commented Jun 6, 2024

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:

AO-TP.mp4

Unfortunately in complex animations of characters interacting with the environment only this doesn’t help, something else prevents it from working properly…

@Lateasusual
Copy link

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.

@Lateasusual
Copy link

It is caused by this upstream (bug/API change) issue in blender: https://projects.blender.org/blender/blender/issues/122843

augmero added a commit to augmero/animaide that referenced this issue Jun 6, 2024
@augmero
Copy link

augmero commented Jun 6, 2024

Fix worked on my end with the provided file on blender 4.2, merged change into that PR. Thanks!

@MihaMS
Copy link
Author

MihaMS commented Jun 6, 2024

@Lateasusual @augmero Thanks a lot!!! I tested this fix also - now it's working fine! You're awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants