Blender V4.5
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;
19
20/* The following structures are defined in DNA_action_types.h, and DNA_anim_types.h */
22struct BoneColor;
23struct FCurve;
24struct ID;
25struct Main;
26struct Object;
27struct bAction;
28struct bActionGroup;
29struct bItasc;
30struct bPose;
31struct bPoseChannel;
33
34namespace blender::animrig {
35
50
51} // namespace blender::animrig
52
53/* Action Lib Stuff ----------------- */
54
55/* Allocate a new bAction with the given name */
56bAction *BKE_action_add(Main *bmain, const char name[]);
57
58/* Action API ----------------- */
59
66
67/* Action Groups API ----------------- */
68
75
81void set_active_action_group(bAction *act, bActionGroup *agrp, short select);
82
86void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp);
87
91void action_group_colors_set(bActionGroup *grp, const BoneColor *color);
92
102
108bActionGroup *action_groups_add_new(bAction *act, const char name[]);
109
117void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve);
118
125
134
140bActionGroup *BKE_action_group_find_name(bAction *act, const char name[]);
141
148
149/* Pose API ----------------- */
150
156void BKE_pose_channel_free_ex(bPoseChannel *pchan, bool do_id_user) ATTR_NONNULL(1);
157
166
171
176
182void BKE_pose_channels_free_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1);
183
189
194 bool (*filter_fn)(const char *bone_name, void *user_data),
195 void *user_data) ATTR_NONNULL(1, 2);
196
197void BKE_pose_free_data_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1);
199void BKE_pose_free(bPose *pose);
203void BKE_pose_free_ex(bPose *pose, bool do_id_user);
210void BKE_pose_copy_data_ex(bPose **dst, const bPose *src, int flag, bool copy_constraints);
211void BKE_pose_copy_data(bPose **dst, const bPose *src, bool copy_constraints);
219void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from);
225bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name);
241bPoseChannel *BKE_pose_channel_active(Object *ob, bool check_bonecoll);
267bPoseChannel *BKE_pose_channel_ensure(bPose *pose, const char *name) ATTR_NONNULL(2);
272 const char *name) ATTR_WARN_UNUSED_RESULT;
273
275
276#ifndef NDEBUG
278#endif
279
285
290
295
300
304void BKE_pose_itasc_init(bItasc *itasc);
305
310
311/* Bone Groups API --------------------- */
312
316bActionGroup *BKE_pose_add_group(bPose *pose, const char *name) ATTR_NONNULL(1);
317
322void BKE_pose_remove_group(bPose *pose, bActionGroup *grp, int index) ATTR_NONNULL(1);
326void BKE_pose_remove_group_index(bPose *pose, int index) ATTR_NONNULL(1);
327
328/* Assorted Evaluation ----------------- */
329
335 Object *workob,
336 bPose *pose,
337 bAction *act,
338 int32_t action_slot_handle,
339 char groupname[],
340 const AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1, 2);
341
343 ATTR_NONNULL(1, 2);
347bool BKE_pose_copy_result(bPose *to, bPose *from);
351void BKE_pose_rest(bPose *pose, bool selected_bones_only);
352
356void BKE_pose_tag_recalc(Main *bmain, bPose *pose) ATTR_NONNULL(1, 2);
357
358void BKE_pose_blend_write(BlendWriter *writer, bPose *pose, bArmature *arm) ATTR_NONNULL(1, 2, 3);
359void BKE_pose_blend_read_data(BlendDataReader *reader, ID *id_owner, bPose *pose)
360 ATTR_NONNULL(1, 2);
362 ATTR_NONNULL(1, 2);
363
364/* `action_mirror.cc` */
365
371
372namespace blender::bke {
373
374using FoundFCurveCallback = blender::FunctionRef<void(FCurve *fcurve, const char *bone_name)>;
376 blender::FunctionRef<void(const FCurve *fcurve, const char *bone_name)>;
377
385 FoundFCurveCallback callback);
388 FoundFCurveCallbackConst callback);
389
390}; // 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 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 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)
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)
void void BKE_pose_blend_write(BlendWriter *writer, bPose *pose, bArmature *arm) ATTR_NONNULL(1
#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
Definition DNA_ID.h:404
uint8_t flag
Definition wm_window.cc:139