diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-22 19:29:35 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-22 20:37:08 +0300 |
commit | d3e81ceb35f25752632698126128cdee6e07795e (patch) | |
tree | 7b59d58edf4c9faa28555dddd4ff50b699f32ed8 /rigify/ui.py | |
parent | 6b753382d69015a70e158e340b2d49b54790d4b6 (diff) |
Rigify: fix the use_global_undo change and fix driver creation for 2.8.
Using obj.animation_data.drivers[-1] in driver creation is very
bad and error prone. After recent change in Blender, that won't
even work for drivers on Bone, so fix all such uses.
Diffstat (limited to 'rigify/ui.py')
-rw-r--r-- | rigify/ui.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/rigify/ui.py b/rigify/ui.py index 0091f7b9..48f34e0e 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -1277,17 +1277,15 @@ class OBJECT_OT_ClearAnimation(bpy.types.Operator): anim_type: StringProperty() def execute(self, context): + rig = context.object + scn = context.scene + if not rig.animation_data: + return {'FINISHED'} + act = rig.animation_data.action + if not act: + return {'FINISHED'} - try: - rig = context.object - scn = context.scene - if not rig.animation_data: - return {'FINISHED'} - act = rig.animation_data.action - if not act: - return {'FINISHED'} - - clearAnimation(act, self.anim_type, names=get_limb_generated_names(rig)) + clearAnimation(act, self.anim_type, names=get_limb_generated_names(rig)) return {'FINISHED'} |