bugfix animation data ui

2.3.3

- fixed: Bug with animation manager objects data
gpv2
pullusb 2023-05-03 12:16:15 +02:00
parent 990b18f665
commit 2191be97cb
3 changed files with 34 additions and 31 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
2.3.3
- fixed: Bug with animation manager objects data
2.3.2 2.3.2
- fixed: Bug with animation manager when there is empty object in scene - fixed: Bug with animation manager when there is empty object in scene

View File

@ -4,7 +4,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": (2, 3, 2), "version": (2, 3, 3),
"blender": (3, 0, 0), "blender": (3, 0, 0),
"location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties", "location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
"warning": "", "warning": "",

View File

@ -1193,14 +1193,8 @@ def anim_status(objects) -> tuple((str, str)):
on_count = off_count = count = 0 on_count = off_count = count = 0
for o in objects: for o in objects:
## Skip object with no animation
if not (o.animation_data and o.animation_data.action):
if o.type == 'EMPTY':
continue
if not (o.data.animation_data and o.data.animation_data.action):
continue
## Also skip hidden objects ## Skip hidden objects
if o.hide_get() and o.hide_render: if o.hide_get() and o.hide_render:
continue continue
@ -1212,6 +1206,7 @@ def anim_status(objects) -> tuple((str, str)):
# off_count += 1 # off_count += 1
### Consider All channels individually ### Consider All channels individually
if o.animation_data and o.animation_data.action:
for grp in o.animation_data.action.groups: for grp in o.animation_data.action.groups:
## Check if groups are muted ## Check if groups are muted
if grp.mute: if grp.mute:
@ -1230,9 +1225,13 @@ def anim_status(objects) -> tuple((str, str)):
count += 1 count += 1
if o.type in ('GPENCIL', 'CAMERA'): if o.type in ('GPENCIL', 'CAMERA'):
if o.data.animation_data and o.data.animation_data.action: datablock = o.data
if datablock.animation_data is None:
continue
if not datablock.animation_data.action:
continue
## Check if object data attributes fcurves are muted ## Check if object data attributes fcurves are muted
for fcu in o.animation_data.action.fcurves: for fcu in datablock.animation_data.action.fcurves:
if fcu.mute: if fcu.mute:
off_count += 1 off_count += 1
else: else: