Blender V5.3
action_bones.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BKE_action.hh"
10
11#include "BLI_string.hh"
12
13#include "DNA_action_types.h"
14#include "DNA_anim_types.h"
15#include "DNA_armature_types.h"
16
17#include "ANIM_action_legacy.hh"
18
19namespace blender::bke {
20
22 const animrig::slot_handle_t slot_handle,
23 FoundFCurveCallback callback)
24{
25 auto const_callback = [&](const FCurve *fcurve, const char *bone_name) {
26 callback(const_cast<FCurve *>(fcurve), bone_name);
27 };
29 const_cast<const bAction *>(action), slot_handle, const_callback);
30}
31
33 const animrig::slot_handle_t slot_handle,
35{
36 for (const FCurve *fcu : animrig::fcurves_for_action_slot(action->wrap(), slot_handle)) {
37 char bone_name[MAXBONENAME];
39 fcu->rna_path().c_str(), "pose.bones[", bone_name, sizeof(bone_name)))
40 {
41 continue;
42 }
43 callback(fcu, bone_name);
44 }
45}
46
47} // namespace blender::bke
Functions for backward compatibility with the legacy Action API.
Blender kernel action and pose functionality.
#define MAXBONENAME
decltype(blender::ActionSlot::handle) slot_handle_t
Span< FCurve * > fcurves_for_action_slot(Action &action, slot_handle_t slot_handle)
void BKE_action_find_fcurves_with_bones(bAction *action, animrig::slot_handle_t slot_handle, FoundFCurveCallback callback)
FunctionRef< void(FCurve *fcurve, const char *bone_name)> FoundFCurveCallback
FunctionRef< void(const FCurve *fcurve, const char *bone_name)> FoundFCurveCallbackConst
bool bool BLI_str_quoted_substr(const char *__restrict str, const char *__restrict prefix, char *result, size_t result_maxncpy)