88from bpy .props import (StringProperty , BoolProperty , IntProperty , CollectionProperty , FloatProperty )
99from typing import Optional , Tuple
1010import mathutils
11+ from .compat import get_action_fcurves
1112from ..main .bartmoss_functions import *
1213from ..cyber_props import cp77riglist
1314from ..icons .cp77_icons import get_icon
2122#from .jali_integration import *
2223from .draw import (_handle , _running , _draw_callback )
2324from . import root_motion
25+ from . import anim_events
2426
2527def CP77AnimsList (self , context ):
2628 for action in bpy .data .actions :
@@ -944,9 +946,13 @@ def execute(self, context):
944946 return {'CANCELLED' }
945947
946948 # Remove all F-curves
947- fcurves_to_remove = list (action .fcurves )
949+ fcurves = get_action_fcurves (action )
950+ if fcurves is None :
951+ self .report ({'INFO' }, 'No F-curves found (action has no fcurves collection).' )
952+ return {'CANCELLED' }
953+ fcurves_to_remove = list (fcurves )
948954 for fc in fcurves_to_remove :
949- action . fcurves .remove (fc )
955+ fcurves .remove (fc )
950956
951957 self .report ({'INFO' }, f'Cleared { len (fcurves_to_remove )} F-curves.' )
952958 return {'FINISHED' }
@@ -1677,6 +1683,9 @@ def register_animtools():
16771683 # Register root motion tools
16781684 root_motion .register_rm ()
16791685
1686+ # Register animation events UI
1687+ anim_events .register_anim_events ()
1688+
16801689def unregister_animtools ():
16811690 """Unregister all animation tool classes"""
16821691
@@ -1690,6 +1699,9 @@ def unregister_animtools():
16901699 pass
16911700 _handle = None
16921701
1702+ # Unregister animation events UI
1703+ anim_events .unregister_anim_events ()
1704+
16931705 # Unregister root motion tools
16941706 root_motion .unregister_rm ()
16951707
0 commit comments