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
This commit is contained in:
		
							parent
							
								
									26c71f7bb3
								
							
						
					
					
						commit
						f36b31e3aa
					
				@ -1,5 +1,10 @@
 | 
				
			|||||||
# Changelog
 | 
					# 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
 | 
					1.9.8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- fix: animation manager `GP anim on/off` also toggle layers animation datas
 | 
					- fix: animation manager `GP anim on/off` also toggle layers animation datas
 | 
				
			||||||
 | 
				
			|||||||
@ -377,14 +377,13 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator):
 | 
				
			|||||||
        self.selection = event.shift
 | 
					        self.selection = event.shift
 | 
				
			||||||
        return self.execute(context)
 | 
					        return self.execute(context)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def disable_action(self, act):
 | 
					    def set_action_mute(self, act):
 | 
				
			||||||
        for i, fcu in enumerate(act.fcurves):
 | 
					        for i, fcu in enumerate(act.fcurves):
 | 
				
			||||||
            print(i, fcu.data_path, fcu.array_index)
 | 
					            print(i, fcu.data_path, fcu.array_index)
 | 
				
			||||||
            # fcu.group don't have mute attribute in api.
 | 
					            # fcu.group don't have mute attribute in api.
 | 
				
			||||||
            fcu.mute = self.mute
 | 
					            fcu.mute = self.mute
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def execute(self, context):
 | 
					    def execute(self, context):
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if self.selection:
 | 
					        if self.selection:
 | 
				
			||||||
            pool = context.selected_objects
 | 
					            pool = context.selected_objects
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
@ -395,6 +394,12 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator):
 | 
				
			|||||||
                continue
 | 
					                continue
 | 
				
			||||||
            if self.skip_obj and o.type != 'GPENCIL':
 | 
					            if self.skip_obj and o.type != 'GPENCIL':
 | 
				
			||||||
                continue
 | 
					                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:
 | 
					            if not o.animation_data:
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
@ -402,12 +407,9 @@ class GPTB_OT_toggle_mute_animation(bpy.types.Operator):
 | 
				
			|||||||
            if not act:
 | 
					            if not act:
 | 
				
			||||||
                continue
 | 
					                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'}
 | 
					        return {'FINISHED'}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -466,6 +468,18 @@ class GPTB_OT_list_disabled_anims(bpy.types.Operator):
 | 
				
			|||||||
            #     continue
 | 
					            #     continue
 | 
				
			||||||
            # if self.skip_obj and o.type != 'GPENCIL':
 | 
					            # if self.skip_obj and o.type != 'GPENCIL':
 | 
				
			||||||
            #     continue
 | 
					            #     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:
 | 
					            if not o.animation_data:
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
            act = o.animation_data.action
 | 
					            act = o.animation_data.action
 | 
				
			||||||
@ -476,9 +490,8 @@ class GPTB_OT_list_disabled_anims(bpy.types.Operator):
 | 
				
			|||||||
                if fcu.mute:
 | 
					                if fcu.mute:
 | 
				
			||||||
                    if o not in oblist:
 | 
					                    if o not in oblist:
 | 
				
			||||||
                        oblist.append(o)
 | 
					                        oblist.append(o)
 | 
				
			||||||
                        li.append(f'{o.name} : {fcu.data_path} {fcu.array_index}')
 | 
					                        li.append(f'{o.name}:')
 | 
				
			||||||
                    else:
 | 
					                    li.append(f'    - {fcu.data_path} {fcu.array_index}')
 | 
				
			||||||
                        li.append(f'{" "*len(o.name)}  - {fcu.data_path} {fcu.array_index}')
 | 
					 | 
				
			||||||
        if li:
 | 
					        if li:
 | 
				
			||||||
            utils.show_message_box(li)
 | 
					            utils.show_message_box(li)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
 | 
				
			|||||||
@ -15,7 +15,7 @@ bl_info = {
 | 
				
			|||||||
"name": "GP toolbox",
 | 
					"name": "GP toolbox",
 | 
				
			||||||
"description": "Tool set for Grease Pencil in animation production",
 | 
					"description": "Tool set for Grease Pencil in animation production",
 | 
				
			||||||
"author": "Samuel Bernou, Christophe Seux",
 | 
					"author": "Samuel Bernou, Christophe Seux",
 | 
				
			||||||
"version": (1, 9, 8),
 | 
					"version": (1, 9, 9),
 | 
				
			||||||
"blender": (2, 91, 0),
 | 
					"blender": (2, 91, 0),
 | 
				
			||||||
"location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
 | 
					"location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
 | 
				
			||||||
"warning": "",
 | 
					"warning": "",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user