Blender V5.3
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.hh"
12#include "BLI_function_ref.hh"
13#include "BLI_span.hh"
14
15#include "BKE_pose.hh"
16
17namespace blender {
18
19struct BlendDataReader;
20struct BlendLibReader;
21struct BlendWriter;
22struct bArmature;
24
25/* The following structures are defined in DNA_action_types.h, and DNA_anim_types.h */
27struct BoneColor;
28struct FCurve;
29struct ID;
30struct Main;
31struct Object;
32struct bAction;
33struct bActionGroup;
34struct bItasc;
35struct bPose;
36struct bPoseChannel;
38
39namespace animrig {
40
55
56} // namespace animrig
57
58/* Action Lib Stuff ----------------- */
59
60/* Allocate a new bAction with the given name */
61bAction *BKE_action_add(Main *bmain, const char name[]);
62
63/* Action Groups API ----------------- */
64
73
78
88
89/* Pose API ----------------- */
90
96void BKE_pose_channel_free_ex(bPoseChannel *pchan, bool do_id_user) ATTR_NONNULL(1);
97
106
111
116
122void BKE_pose_channels_free_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1);
123
129
134 bool (*filter_fn)(const char *bone_name, void *user_data),
135 void *user_data) ATTR_NONNULL(1, 2);
136
137void BKE_pose_free_data_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1);
143void BKE_pose_free_ex(bPose *pose, bool do_id_user);
150void BKE_pose_copy_data_ex(bPose **dst, const bPose *src, int flag, bool copy_constraints);
151void BKE_pose_copy_data(bPose **dst, const bPose *src, bool copy_constraints);
159void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from);
165bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name);
181bPoseChannel *BKE_pose_channel_active(Object *ob, bool check_bonecoll);
212 const char *name) ATTR_WARN_UNUSED_RESULT;
213
215
216#ifndef NDEBUG
218#endif
219
225
230
235
240
244void BKE_pose_itasc_init(bItasc *itasc);
245
250
255 const bPoseChannel *pose_bone,
256 float r_pose_space_pivot[3]);
257
263 const bPoseChannel *pose_bone,
264 float r_pose_orientation[3][3]);
265
266/* Bone Groups API --------------------- */
267
272
282
283/* Assorted Evaluation ----------------- */
284
290 Object *workob,
291 bPose *pose,
292 bAction *act,
293 int32_t action_slot_handle,
294 const char groupname[],
295 const AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1, 2);
296
297void BKE_pose_copy_pchan_result(bPoseChannel *pchanto, const bPoseChannel *pchanfrom)
298 ATTR_NONNULL(1, 2);
302bool BKE_pose_copy_result(bPose *to, bPose *from);
306void BKE_pose_rest(Object &pose_ob, bool selected_bones_only);
307
311void BKE_pose_tag_recalc(Main *bmain, bPose *pose) ATTR_NONNULL(1, 2);
312
314void BKE_pose_blend_read_data(BlendDataReader *reader, ID *id_owner, bPose *pose)
315 ATTR_NONNULL(1, 2);
317 ATTR_NONNULL(1, 2);
318
319/* `action_mirror.cc` */
320
326
327namespace bke {
328
329using FoundFCurveCallback = FunctionRef<void(FCurve *fcurve, const char *bone_name)>;
330using FoundFCurveCallbackConst = FunctionRef<void(const FCurve *fcurve, const char *bone_name)>;
331
338 animrig::slot_handle_t slot_handle,
339 FoundFCurveCallback callback);
341 animrig::slot_handle_t slot_handle,
342 FoundFCurveCallbackConst callback);
343
344}; // namespace bke
345
346} // namespace blender
decltype(blender::ActionSlot::handle) slot_handle_t
PChanBoneT< const bPoseChannel, const Bone > PChanBoneConst
Definition BKE_pose.hh:89
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
BMesh Iterators.
bPoseChannel * BKE_pose_channel_ensure(bPose *pose, const char *name) ATTR_NONNULL(2)
bPoseChannel * BKE_pose_channel_active(Object *ob, bool check_bonecoll)
void BKE_pose_tag_recalc(Main *bmain, bPose *pose) ATTR_NONNULL(1
void void bool BKE_pose_copy_result(bPose *to, bPose *from)
void action_group_colors_set(bActionGroup *grp, const BoneColor *color)
void BKE_pose_channel_free_bbone_cache(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
void BKE_pose_free_ex(bPose *pose, bool do_id_user)
void BKE_pose_free_data(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_channels_hash_free(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_free(bPose *pose)
void BKE_pose_tag_update_constraint_flags(bPose *pose) ATTR_NONNULL(1)
void void BKE_pose_copy_pchan_result(bPoseChannel *pchanto, const bPoseChannel *pchanfrom) ATTR_NONNULL(1
void BKE_pose_remove_group(bPose *pose, bActionGroup *grp, int index) ATTR_NONNULL(1)
void BKE_pose_channels_hash_ensure(bPose *pose) ATTR_NONNULL(1)
bAction * BKE_action_add(Main *bmain, const char name[])
void void void void void BKE_action_flip_with_pose(bAction *act, Span< Object * > objects) ATTR_NONNULL(1)
void BKE_pose_channel_runtime_reset(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
void BKE_pose_channel_transform_orientation(const bArmature *arm, const bPoseChannel *pose_bone, float r_pose_orientation[3][3])
void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, int32_t action_slot_handle, const char groupname[], const AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1
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])
bPoseChannel * BKE_pose_channel_get_mirrored(const bPose *pose, const char *name) ATTR_WARN_UNUSED_RESULT
void BKE_pose_channels_free(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_copy_data_ex(bPose **dst, const bPose *src, int flag, bool copy_constraints)
bool BKE_pose_channels_is_valid(const bPose *pose) ATTR_WARN_UNUSED_RESULT
const char * BKE_pose_ikparam_get_name(bPose *pose) ATTR_WARN_UNUSED_RESULT
void void BKE_pose_blend_write(BlendWriter *writer, bPose *pose) ATTR_NONNULL(1
void BKE_pose_channel_free_ex(bPoseChannel *pchan, bool do_id_user) ATTR_NONNULL(1)
void BKE_pose_channels_remove(Object *ob, bool(*filter_fn)(const char *bone_name, void *user_data), void *user_data) ATTR_NONNULL(1
void BKE_pose_channel_session_uid_generate(bPoseChannel *pchan)
void BKE_pose_update_constraint_flags(Object &pose_ob)
void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
void BKE_pose_channel_runtime_reset_on_copy(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
void BKE_pose_remove_group_index(bPose *pose, int index) ATTR_NONNULL(1)
void BKE_pose_copy_data(bPose **dst, const bPose *src, bool copy_constraints)
bool BKE_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
void void void void BKE_pose_blend_read_after_liblink(BlendLibReader *reader, Object *ob, bPose *pose) ATTR_NONNULL(1
void void void BKE_pose_blend_read_data(BlendDataReader *reader, ID *id_owner, bPose *pose) ATTR_NONNULL(1
void BKE_pose_channels_free_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1)
signed int int32_t
Definition BKE_text.h:78
bPoseChannel * BKE_pose_channel_active_if_bonecoll_visible(Object *ob) ATTR_WARN_UNUSED_RESULT
void BKE_pose_channel_runtime_free(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
bool BKE_pose_is_bonecoll_visible(const bArmature *arm, const bPoseChannel *pchan) ATTR_WARN_UNUSED_RESULT
void void BKE_pose_free_data_ex(bPose *pose, bool do_id_user) ATTR_NONNULL(1)
bool ATTR_WARN_UNUSED_RESULT
void action_group_colors_sync(bActionGroup *grp)
void ATTR_NONNULL(1, 2)
void BKE_pose_rest(Object &pose_ob, bool selected_bones_only)
bPoseChannel * BKE_pose_channel_active_or_first_selected(Object *ob) ATTR_WARN_UNUSED_RESULT
void BKE_pose_check_uids_unique_and_report(const bPose *pose)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
void BKE_pose_ikparam_init(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_itasc_init(bItasc *itasc)
void action_group_colors_set_from_posebone(bActionGroup *grp, bke::PChanBoneConst pchanbone)
bActionGroup * BKE_pose_add_group(bPose *pose, const char *name) ATTR_NONNULL(1)