Added sanity check baseline made by claude.

Also changed the location to a panel in VIEW_3D instead of menu.
This commit is contained in:
Nero Frame 13 committed 2026-10-13 16:33:03 +02:00
1 parent 71b1a61b5c
commit 4617c47ad0
33 files changed
+2771 -52

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
import bpy
from ...core import Check, Issue, contexts, is_local
_ANIMATABLE = [
"objects", "meshes", "curves", "armatures", "grease_pencils", "materials",
"node_groups", "shape_keys", "cameras", "lights", "worlds", "scenes",
]
def _animated_ids():
for collection_name in _ANIMATABLE:
for id_block in getattr(bpy.data, collection_name, ()):
if not is_local(id_block):
continue
ad = id_block.animation_data
if ad is not None and (ad.action is not None or len(ad.nla_tracks)):
yield id_block, ad
class AnimationCheck(Check):
id = "animation"
label = "No animation"
description = "No action or NLA track is assigned (drivers are allowed)."
category = "Animation"
contexts = contexts.ASSET
fix_description = "Unassign actions and remove NLA tracks (drivers are kept)"
def run(self, ctx):
for id_block, ad in _animated_ids():
parts = []
if ad.action is not None:
parts.append(f"action '{ad.action.name}'")
if len(ad.nla_tracks):
parts.append(f"{len(ad.nla_tracks)} NLA track(s)")
name = id_block.user.name if isinstance(id_block, bpy.types.Key) else id_block.name
yield Issue.for_id(f"{name}: {', '.join(parts)}", id_block)
def fix(self, ctx, issues):
for issue in issues:
id_block = issue.get_id()
ad = id_block.animation_data if id_block is not None else None
if ad is None:
continue
ad.action = None
for track in list(ad.nla_tracks):
ad.nla_tracks.remove(track)
if not len(ad.drivers):
id_block.animation_data_clear()