fix #5 animation manager for gp layer data

1.9.8

- fix: animation manager `GP anim on/off` also toggle layers animation datas
This commit is contained in:
Pullusb
2022-03-04 02:18:41 +01:00
parent 8404e16633
commit 26c71f7bb3
3 changed files with 17 additions and 4 deletions
+12 -3
View File
@@ -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'}