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
2.3.3
- fixed: Bug with animation manager objects data
2.3.2
- fixed: Bug with animation manager when there is empty object in scene

View File

@ -4,7 +4,7 @@ bl_info = {
"name": "GP toolbox",
"description": "Tool set for Grease Pencil in animation production",
"author": "Samuel Bernou, Christophe Seux",
"version": (2, 3, 2),
"version": (2, 3, 3),
"blender": (3, 0, 0),
"location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
"warning": "",

View File

@ -1193,14 +1193,8 @@ def anim_status(objects) -> tuple((str, str)):
on_count = off_count = count = 0
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:
continue
@ -1212,32 +1206,37 @@ def anim_status(objects) -> tuple((str, str)):
# off_count += 1
### Consider All channels individually
for grp in o.animation_data.action.groups:
## Check if groups are muted
if grp.mute:
off_count += 1
else:
on_count += 1
count += 1
if o.animation_data and o.animation_data.action:
for grp in o.animation_data.action.groups:
## Check if groups are muted
if grp.mute:
off_count += 1
else:
on_count += 1
count += 1
for fcu in o.animation_data.action.fcurves:
## Check if fcurves are muted
if fcu.mute:
off_count += 1
else:
on_count += 1
count += 1
for fcu in o.animation_data.action.fcurves:
## Check if fcurves are muted
if fcu.mute:
off_count += 1
else:
on_count += 1
count += 1
if o.type in ('GPENCIL', 'CAMERA'):
if o.data.animation_data and o.data.animation_data.action:
## Check if object data attributes fcurves are muted
for fcu in o.animation_data.action.fcurves:
if fcu.mute:
off_count += 1
else:
on_count += 1
count += 1
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
for fcu in datablock.animation_data.action.fcurves:
if fcu.mute:
off_count += 1
else:
on_count += 1
count += 1
if not on_count and not off_count:
return ('BLANK1', 'BLANK1') # 'NONE'