From 89d059c5d76292815014db7fa6eb2b5706f1aed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 23 Sep 2025 17:11:39 +0200 Subject: [PATCH] Refactor: convert "Animated Transforms to Deltas" to current Action API Convert the code for the "Animated Transforms to Deltas" operator from the legacy Actions API to the current API. No functional changes. This is part of #146586 Pull Request: https://projects.blender.org/blender/blender/pulls/147060 --- scripts/startup/bl_operators/object.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/startup/bl_operators/object.py b/scripts/startup/bl_operators/object.py index 7c5d1846652..bf58875f403 100644 --- a/scripts/startup/bl_operators/object.py +++ b/scripts/startup/bl_operators/object.py @@ -14,6 +14,7 @@ from bpy.app.translations import ( pgettext_rpt as rpt_, contexts as i18n_contexts, ) +from bpy_extras import anim_utils class SelectPattern(Operator): @@ -843,7 +844,10 @@ class TransformsToDeltasAnim(Operator): # first pass over F-Curves: ensure that we don't have conflicting # transforms already (e.g. if this was applied already) #29110. existingFCurves = {} - for fcu in adt.action.fcurves: + channelbag = anim_utils.action_get_channelbag_for_slot(adt.action, adt.action_slot) + if not channelbag: + continue + for fcu in channelbag.fcurves: # get "delta" path - i.e. the final paths which may clash path = fcu.data_path if path in STANDARD_TO_DELTA_PATHS: @@ -878,7 +882,7 @@ class TransformsToDeltasAnim(Operator): # if F-Curve uses standard transform path # just append "delta_" to this path - for fcu in adt.action.fcurves: + for fcu in channelbag.fcurves: if fcu.data_path == "location": fcu.data_path = "delta_location" obj.location.zero()