Blender V5.0
BKE_action.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
10
11#include "BLI_compiler_attrs.h"
12#include "BLI_function_ref.hh"
13#include "BLI_span.hh"
14
15struct BlendDataReader;
16struct BlendLibReader;
17struct BlendWriter;
18struct bArmature;
20
21/* The following structures are defined in DNA_action_types.h, and DNA_anim_types.h */
23struct BoneColor;
24struct FCurve;
25struct ID;
26struct Main;
27struct Object;
28struct bAction;
29struct bActionGroup;
30struct bItasc;
31struct bPose;
32struct bPoseChannel;
34
35namespace blender::animrig {
36
51
52} // namespace blender::animrig
53
54/* Action Lib Stuff ----------------- */
55
56/* Allocate a new bAction with the given name */
57bAction *BKE_action_add(Main *bmain, const char name[]);
58
59/* Action API ----------------- */
60
67
68/* Action Groups API ----------------- */
69
76
82void set_active_action_group(bAction *act, bActionGroup *agrp, short select);
83
87void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp);
88
92void action_group_colors_set(bActionGroup *grp, const BoneColor *color);
93
103
110
118void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve);
119
126
135
142
149
150/* Pose API ----------------- */
151
157void BKE_pose_channel_free_ex(bPoseChannel *pchan, bool do_id_user) ATTR_NONNULL(1);
158
167
172
177
183void BKE_pose_channels_free_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1);
184
190
195 bool (*filter_fn)(const char *bone_name, void *user_data),
196 void *user_data) ATTR_NONNULL(1, 2);
197
198void BKE_pose_free_data_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1);
200void BKE_pose_free(bPose *pose);
204void BKE_pose_free_ex(bPose *pose, bool do_id_user);
211void BKE_pose_copy_data_ex(bPose **dst, const bPose *src, int flag, bool copy_constraints);
212void BKE_pose_copy_data(bPose **dst, const bPose *src, bool copy_constraints);
220void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from);
226bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name);
242bPoseChannel *BKE_pose_channel_active(Object *ob, bool check_bonecoll);
273 const char *name) ATTR_WARN_UNUSED_RESULT;
274
276
277#ifndef NDEBUG
279#endif
280
286
291
296
301
305void BKE_pose_itasc_init(bItasc *itasc);
306
311
316 const bPoseChannel *pose_bone,
317 float r_pose_space_pivot[3]);
318
324 const bPoseChannel *pose_bone,
325 float r_pose_orientation[3][3]);
326
327/* Bone Groups API --------------------- */
328
333
338void BKE_pose_remove_group(bPose *pose, bActionGroup *grp, int index) ATTR_NONNULL(1);
342void BKE_pose_remove_group_index(bPose *pose, int index) ATTR_NONNULL(1);
343
344/* Assorted Evaluation ----------------- */
345
351 Object *workob,
352 bPose *pose,
353 bAction *act,
354 int32_t action_slot_handle,
355 char groupname[],
356 const AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1, 2);
357
359 ATTR_NONNULL(1, 2);
363bool BKE_pose_copy_result(bPose *to, bPose *from);
367void BKE_pose_rest(bPose *pose, bool selected_bones_only);
368
372void BKE_pose_tag_recalc(Main *bmain, bPose *pose) ATTR_NONNULL(1, 2);
373
375void BKE_pose_blend_read_data(BlendDataReader *reader, ID *id_owner, bPose *pose)
376 ATTR_NONNULL(1, 2);
378 ATTR_NONNULL(1, 2);
379
380/* `action_mirror.cc` */
381
387
388namespace blender::bke {
389
390using FoundFCurveCallback = blender::FunctionRef<void(FCurve *fcurve, const char *bone_name)>;
392 blender::FunctionRef<void(const FCurve *fcurve, const char *bone_name)>;
393
401 FoundFCurveCallback callback);
404 FoundFCurveCallbackConst callback);
405
406}; // namespace blender::bke
void BKE_pose_channels_remove(Object *ob, bool(*filter_fn)(const char *bone_name, void *user_data), void *user_data) ATTR_NONNULL(1
void action_group_colors_set_from_posebone(bActionGroup *grp, const bPoseChannel *pchan)
void BKE_pose_channel_transform_orientation(const bArmature *arm, const bPoseChannel *pose_bone, float r_pose_orientation[3][3])
void void bool BKE_pose_copy_result(bPose *to, bPose *from)
void void void void BKE_pose_blend_read_after_liblink(BlendLibReader *reader, Object *ob, bPose *pose) ATTR_NONNULL(1
void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
void action_group_colors_set(bActionGroup *grp, const BoneColor *color)
bActionGroup * BKE_pose_add_group(bPose *pose, const char *name) ATTR_NONNULL(1)
void BKE_pose_channel_runtime_free(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
void BKE_pose_free_data(bPose *pose) ATTR_NONNULL(1)
void set_active_action_group(bAction *act, bActionGroup *agrp, short select)
bPoseChannel * BKE_pose_channel_active(Object *ob, bool check_bonecoll)
void BKE_pose_tag_recalc(Main *bmain, bPose *pose) ATTR_NONNULL(1
const char * BKE_pose_ikparam_get_name(bPose *pose) ATTR_WARN_UNUSED_RESULT
void BKE_pose_channel_runtime_reset_on_copy(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
bActionGroup * get_active_actiongroup(bAction *act) ATTR_WARN_UNUSED_RESULT
void void void BKE_pose_blend_read_data(BlendDataReader *reader, ID *id_owner, bPose *pose) ATTR_NONNULL(1
void action_groups_clear_tempflags(bAction *act)
bool BKE_pose_channels_is_valid(const bPose *pose) ATTR_WARN_UNUSED_RESULT
void BKE_pose_channels_free_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1)
void BKE_pose_channel_runtime_reset(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
void BKE_pose_ikparam_init(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_itasc_init(bItasc *itasc)
void BKE_pose_remove_group_index(bPose *pose, int index) ATTR_NONNULL(1)
void BKE_pose_remove_group(bPose *pose, bActionGroup *grp, int index) ATTR_NONNULL(1)
void void BKE_pose_blend_write(BlendWriter *writer, bPose *pose) ATTR_NONNULL(1
void BKE_pose_free_ex(bPose *pose, bool do_id_user)
void BKE_action_groups_reconstruct(bAction *act)
void BKE_pose_channel_session_uid_generate(bPoseChannel *pchan)
void BKE_pose_channels_hash_free(bPose *pose) ATTR_NONNULL(1)
void void void void void BKE_action_flip_with_pose(bAction *act, blender::Span< Object * > objects) ATTR_NONNULL(1)
void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
void BKE_pose_update_constraint_flags(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_channels_hash_ensure(bPose *pose) ATTR_NONNULL(1)
bPoseChannel * BKE_pose_channel_active_or_first_selected(Object *ob) ATTR_WARN_UNUSED_RESULT
void BKE_action_fcurves_clear(bAction *act)
void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, int32_t action_slot_handle, char groupname[], const AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bPoseChannel * BKE_pose_channel_get_mirrored(const bPose *pose, const char *name) ATTR_WARN_UNUSED_RESULT
void void BKE_pose_free_data_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1)
void BKE_pose_channels_free(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_free(bPose *pose)
void action_groups_remove_channel(bAction *act, FCurve *fcu)
void BKE_pose_channel_free(bPoseChannel *pchan) ATTR_NONNULL(1)
void BKE_pose_channel_transform_location(const bArmature *arm, const bPoseChannel *pose_bone, float r_pose_space_pivot[3])
bool BKE_pose_is_bonecoll_visible(const bArmature *arm, const bPoseChannel *pchan) ATTR_WARN_UNUSED_RESULT
bool BKE_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
bPoseChannel * BKE_pose_channel_ensure(bPose *pose, const char *name) ATTR_NONNULL(2)
bPoseChannel * BKE_pose_channel_active_if_bonecoll_visible(Object *ob) ATTR_WARN_UNUSED_RESULT
void BKE_pose_copy_data(bPose **dst, const bPose *src, bool copy_constraints)
void BKE_pose_tag_update_constraint_flags(bPose *pose) ATTR_NONNULL(1)
bAction * BKE_action_add(Main *bmain, const char name[])
void BKE_pose_channel_free_ex(bPoseChannel *pchan, bool do_id_user) ATTR_NONNULL(1)
bActionGroup * action_groups_add_new(bAction *act, const char name[])
void BKE_pose_channel_free_bbone_cache(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp)
void void BKE_pose_copy_pchan_result(bPoseChannel *pchanto, const bPoseChannel *pchanfrom) ATTR_NONNULL(1
void BKE_pose_copy_data_ex(bPose **dst, const bPose *src, int flag, bool copy_constraints)
bActionGroup * BKE_action_group_find_name(bAction *act, const char name[])
void BKE_pose_check_uids_unique_and_report(const bPose *pose)
void BKE_pose_rest(bPose *pose, bool selected_bones_only)
#define ATTR_WARN_UNUSED_RESULT
#define ATTR_NONNULL(...)
#define select(A, B, C)
decltype(::ActionSlot::handle) slot_handle_t
blender::FunctionRef< void(const FCurve *fcurve, const char *bone_name)> FoundFCurveCallbackConst
void BKE_action_find_fcurves_with_bones(bAction *action, blender::animrig::slot_handle_t slot_handle, FoundFCurveCallback callback)
blender::FunctionRef< void(FCurve *fcurve, const char *bone_name)> FoundFCurveCallback
const char * name
Definition DNA_ID.h:414
uint8_t flag
Definition wm_window.cc:145