From 26c71f7bb3e9af9d08285901bb515d19ed158c38 Mon Sep 17 00:00:00 2001 From: Pullusb Date: Fri, 4 Mar 2022 02:18:41 +0100 Subject: [PATCH] fix #5 animation manager for gp layer data 1.9.8 - fix: animation manager `GP anim on/off` also toggle layers animation datas --- CHANGELOG.md | 4 ++++ OP_helpers.py | 15 ++++++++++++--- __init__.py | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1314b12..3466cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +1.9.8 + +- fix: animation manager `GP anim on/off` also toggle layers animation datas + 1.9.7 - changed: `list modifiers visibility conflict` (used in `check file` or through search menu) now not limited to GP objects type. diff --git a/OP_helpers.py b/OP_helpers.py index f70c036..4007f6f 100644 --- a/OP_helpers.py +++ b/OP_helpers.py @@ -377,6 +377,12 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator): self.selection = event.shift return self.execute(context) + def disable_action(self, act): + for i, fcu in enumerate(act.fcurves): + print(i, fcu.data_path, fcu.array_index) + # fcu.group don't have mute attribute in api. + fcu.mute = self.mute + def execute(self, context): if self.selection: @@ -396,9 +402,12 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator): if not act: continue - for i, fcu in enumerate(act.fcurves): - print(i, fcu.data_path, fcu.array_index) - fcu.mute = self.mute + self.disable_action(act) + + if o.type == 'GPENCIL' and o.data.animation_data: + gp_act = o.data.animation_data.action + if gp_act: + self.disable_action(gp_act) return {'FINISHED'} diff --git a/__init__.py b/__init__.py index f4e8433..b034a2b 100755 --- a/__init__.py +++ b/__init__.py @@ -15,7 +15,7 @@ bl_info = { "name": "GP toolbox", "description": "Tool set for Grease Pencil in animation production", "author": "Samuel Bernou, Christophe Seux", -"version": (1, 9, 7), +"version": (1, 9, 8), "blender": (2, 91, 0), "location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties", "warning": "",