I’m writing an addon for rigging (ChainTools ), and I want to find out if I’ve discovered a bug. If so, I hope someone can give me suggestions on a workaround!
When I change armature layers and then use the operators defined in my addon, and then use the Adjust Last Operation panel, the armature layers are changed back to whatever they were before I used my operators.The change in layers only occurs if I use a float or int bpy_prop and drag my mouse on the Adjust Last Operations panel. Also, the “restore point” is re-set when I do certain operations, like switching modes or moving a bone with the
g key and confirming (it doesn’t work if I don’t move the bone).
Here’s the file I’m using to test my addon:
To get the error, install my addon, then open the file and change the bone layer to layer one. Then press
F3 and search ‘chain’. Choose Select Bone Chain. Now search ‘chain’ again and choose ‘smooth bone chain’ and try moving the slider back and forth. Your Blender should switch back to the previous layer and the operator will no longer be functional.
Is this a bug or is something in my addon causing the problem? I make heavy usage of comparing the layers that bones are one to see if they’re in the same chain or not.
I tried hacking my way around the problem by getting the layers the armature was on in
invoke(), saving them to a class property
self.layers and re-assiging them in
execute(), but that resulted in weird behaviour- random layers were chosen and very rarely were any of them right.
If this is a bug, I’ll be sure to report it, just want to make sure it isn’t my fault first!