diff --git a/scripts/startup/bl_operators/wm.py b/scripts/startup/bl_operators/wm.py index ea273c86dec..94906791cd7 100644 --- a/scripts/startup/bl_operators/wm.py +++ b/scripts/startup/bl_operators/wm.py @@ -27,6 +27,7 @@ from bpy.app.translations import ( pgettext_rpt as rpt_, contexts as i18n_contexts, ) +from bpy_extras import anim_utils def _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs): @@ -1841,15 +1842,19 @@ class WM_OT_properties_edit(Operator): def _update_strips(strips): for st in strips: - if st.type == 'CLIP' and st.action: - _update(st.action.fcurves) + if st.type == 'CLIP': + channelbag = anim_utils.action_get_channelbag_for_slot(st.action, st.action_slot) + if not channelbag: + continue + _update(channelbag.fcurves) elif st.type == 'META': _update_strips(st.strips) adt = getattr(item, "animation_data", None) if adt is not None: - if adt.action: - _update(adt.action.fcurves) + channelbag = anim_utils.action_get_channelbag_for_slot(adt.action, adt.action_slot) + if channelbag: + _update(channelbag.fcurves) if adt.drivers: _update(adt.drivers) if adt.nla_tracks: diff --git a/source/blender/blenkernel/intern/anim_data.cc b/source/blender/blenkernel/intern/anim_data.cc index d249b73d917..2d857fa3b71 100644 --- a/source/blender/blenkernel/intern/anim_data.cc +++ b/source/blender/blenkernel/intern/anim_data.cc @@ -868,15 +868,10 @@ static bool nlastrips_path_rename_fix(ID *owner_id, LISTBASE_FOREACH (NlaStrip *, strip, strips) { /* fix strip's action */ if (strip->act != nullptr) { + const Vector fcurves = blender::animrig::legacy::fcurves_for_action_slot( + strip->act, strip->action_slot_handle); const bool is_changed_action = fcurves_path_rename_fix( - owner_id, - prefix, - oldName, - newName, - oldKey, - newKey, - blender::animrig::legacy::fcurves_all(strip->act), - verify_paths); + owner_id, prefix, oldName, newName, oldKey, newKey, fcurves, verify_paths); if (is_changed_action) { DEG_id_tag_update(&strip->act->id, ID_RECALC_ANIMATION); } @@ -1036,28 +1031,20 @@ void BKE_animdata_fix_paths_rename(ID *owner_id, newN = BLI_sprintfN("[%d]", newSubscript); } /* Active action and temp action. */ - if (adt->action != nullptr) { - if (fcurves_path_rename_fix(owner_id, - prefix, - oldName, - newName, - oldN, - newN, - blender::animrig::legacy::fcurves_all(adt->action), - verify_paths)) + if (adt->action != nullptr && adt->slot_handle != blender::animrig::Slot::unassigned) { + const Vector fcurves = blender::animrig::legacy::fcurves_for_action_slot( + adt->action, adt->slot_handle); + if (fcurves_path_rename_fix( + owner_id, prefix, oldName, newName, oldN, newN, fcurves, verify_paths)) { DEG_id_tag_update(&adt->action->id, ID_RECALC_SYNC_TO_EVAL); } } if (adt->tmpact) { - if (fcurves_path_rename_fix(owner_id, - prefix, - oldName, - newName, - oldN, - newN, - blender::animrig::legacy::fcurves_all(adt->tmpact), - verify_paths)) + const Vector fcurves = blender::animrig::legacy::fcurves_for_action_slot( + adt->tmpact, adt->tmp_slot_handle); + if (fcurves_path_rename_fix( + owner_id, prefix, oldName, newName, oldN, newN, fcurves, verify_paths)) { DEG_id_tag_update(&adt->tmpact->id, ID_RECALC_SYNC_TO_EVAL); }