completed fix #5 for gp layer data action toggle

1.9.9

- fix: Bug setting GP layers actions on/off
- fix: Add GP layers animation datas in `list disabled animation` report
gpv2
Pullusb 2022-03-05 15:36:01 +01:00
parent 26c71f7bb3
commit f36b31e3aa
3 changed files with 29 additions and 11 deletions

View File

@ -1,5 +1,10 @@
# Changelog
1.9.9
- fix: Bug setting GP layers actions on/off
- fix: Add GP layers animation datas in `list disabled animation` report
1.9.8
- fix: animation manager `GP anim on/off` also toggle layers animation datas

View File

@ -377,14 +377,13 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator):
self.selection = event.shift
return self.execute(context)
def disable_action(self, act):
def set_action_mute(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:
pool = context.selected_objects
else:
@ -395,6 +394,12 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator):
continue
if self.skip_obj and o.type != 'GPENCIL':
continue
if o.type == 'GPENCIL' and o.data.animation_data:
gp_act = o.data.animation_data.action
if gp_act:
print(f'\n---{o.name} data:')
self.set_action_mute(gp_act)
if not o.animation_data:
continue
@ -402,12 +407,9 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator):
if not act:
continue
self.disable_action(act)
print(f'\n---{o.name}:')
self.set_action_mute(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'}
@ -466,6 +468,18 @@ class GPTB_OT_list_disabled_anims(bpy.types.Operator):
# continue
# if self.skip_obj and o.type != 'GPENCIL':
# continue
if o.type == 'GPENCIL':
if o.data.animation_data:
gp_act = o.data.animation_data.action
if gp_act:
for i, fcu in enumerate(gp_act.fcurves):
if fcu.mute:
if o not in oblist:
oblist.append(o)
li.append(f'{o.name}:')
li.append(f' - {fcu.data_path} {fcu.array_index}')
if not o.animation_data:
continue
act = o.animation_data.action
@ -476,9 +490,8 @@ class GPTB_OT_list_disabled_anims(bpy.types.Operator):
if fcu.mute:
if o not in oblist:
oblist.append(o)
li.append(f'{o.name} : {fcu.data_path} {fcu.array_index}')
else:
li.append(f'{" "*len(o.name)} - {fcu.data_path} {fcu.array_index}')
li.append(f'{o.name}:')
li.append(f' - {fcu.data_path} {fcu.array_index}')
if li:
utils.show_message_box(li)
else:

View File

@ -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, 8),
"version": (1, 9, 9),
"blender": (2, 91, 0),
"location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
"warning": "",