tornavis/source/blender/blenkernel/BKE_action.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

419 lines
14 KiB
C
Raw Normal View History

/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
*
* SPDX-License-Identifier: GPL-2.0-or-later */
2002-10-12 13:37:38 +02:00
#pragma once
2019-09-13 13:11:41 +02:00
/** \file
* \ingroup bke
* \brief Blender kernel action and pose functionality.
*/
2002-10-12 13:37:38 +02:00
#include "BLI_compiler_attrs.h"
#include "DNA_listBase.h"
#ifdef __cplusplus
extern "C" {
#endif
struct BlendDataReader;
2020-12-16 06:26:23 +01:00
struct BlendLibReader;
struct BlendWriter;
struct bArmature;
/* The following structures are defined in DNA_action_types.h, and DNA_anim_types.h */
T77086 Animation: Passing Dependency Graph to Drivers Custom driver functions need access to the dependency graph that is triggering the evaluation of the driver. This patch passes the dependency graph pointer through all the animation-related calls. Instead of passing the evaluation time to functions, the code now passes an `AnimationEvalContext` pointer: ``` typedef struct AnimationEvalContext { struct Depsgraph *const depsgraph; const float eval_time; } AnimationEvalContext; ``` These structs are read-only, meaning that the code cannot change the evaluation time. Note that the `depsgraph` pointer itself is const, but it points to a non-const depsgraph. FCurves and Drivers can be evaluated at a different time than the current scene time, for example when evaluating NLA strips. This means that, even though the current time is stored in the dependency graph, we need an explicit evaluation time. There are two functions that allow creation of `AnimationEvalContext` objects: - `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time)`, which creates a new context object from scratch, and - `BKE_animsys_eval_context_construct_at(AnimationEvalContext *anim_eval_context, float eval_time)`, which can be used to create a `AnimationEvalContext` with the same depsgraph, but at a different time. This makes it possible to later add fields without changing any of the code that just want to change the eval time. This also provides a fix for T75553, although it does require a change to the custom driver function. The driver should call `custom_function(depsgraph)`, and the function should use that depsgraph instead of information from `bpy.context`. Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D8047
2020-07-17 17:38:09 +02:00
struct AnimationEvalContext;
struct BoneColor;
struct FCurve;
struct ID;
struct Main;
struct Object;
struct bAction;
struct bActionGroup;
struct bItasc;
struct bPose;
2002-10-12 13:37:38 +02:00
struct bPoseChannel;
struct bPoseChannel_Runtime;
2002-10-12 13:37:38 +02:00
/* Action Lib Stuff ----------------- */
/* Allocate a new bAction with the given name */
struct bAction *BKE_action_add(struct Main *bmain, const char name[]);
2.5: Blender "Animato" - New Animation System Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future. Highlights of the new system: * Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action. - F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves. - The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc. * F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated. * Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place) * F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place) * NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still) There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details: http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html So, what currently works: * I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code. * Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock. * Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc. Notes: * Drivers haven't been hooked up yet * Only objects and data directly linked to objects can be animated. * Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change). * Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor) * I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review. In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 04:12:50 +01:00
/* Action API ----------------- */
/**
* Types of transforms applied to the given item:
* - these are the return flags for #BKE_action_get_item_transform_flags()
*/
typedef enum eAction_TransformFlags {
/* location */
ACT_TRANS_LOC = (1 << 0),
/* rotation */
ACT_TRANS_ROT = (1 << 1),
/* scaling */
ACT_TRANS_SCALE = (1 << 2),
Bendy Bones: Advanced B-Bones for Easier + Simple Rigging This commit/patch/branch brings a bunch of powerful new options for B-Bones and for working with B-Bones, making it easier for animators to create their own rigs, using fewer bones (which also means hopefully lighter + faster rigs ;) This functionality was first demoed by Daniel at BConf15 Some highlights from this patch include: * You can now directly control the shape of B-Bones using a series of properties instead of being restricted to trying to indirectly control them through the neighbouring bones. See the "Bendy Bones" panel... * B-Bones can be shaped in EditMode to define a "curved rest pose" for the bone. This is useful for things like eyebrows and mouths/eyelids * You can now make B-Bones use custom bones as their reference bone handles, instead of only using the parent/child bones. To do so, enable the "Use Custom Reference Handles" toggle. If none are specified, then the BBone will only use the Bendy Bone properties. * Constraints Head/Tail option can now slide along the B-Bone shape, instead of just linearly interpolating between the endpoints of the bone. For more details, see: * http://aligorith.blogspot.co.nz/2016/05/bendy-bones-dev-update.html * http://aligorith.blogspot.co.nz/2016/05/an-in-depth-look-at-how-b-bones-work.html -- Credits -- Original Idea: Daniel M Lara (pepeland) Original Patch/Research: Jose Molina Additional Development + Polish: Joshua Leung (aligorith) Testing/Feedback: Daniel M Lara (pepeland), Juan Pablo Bouza (jpbouza)
2016-05-17 17:19:06 +02:00
/* bbone shape - for all the parameters, provided one is set */
ACT_TRANS_BBONE = (1 << 3),
/* strictly not a transform, but custom properties are also
* quite often used in modern rigs
*/
Bendy Bones: Advanced B-Bones for Easier + Simple Rigging This commit/patch/branch brings a bunch of powerful new options for B-Bones and for working with B-Bones, making it easier for animators to create their own rigs, using fewer bones (which also means hopefully lighter + faster rigs ;) This functionality was first demoed by Daniel at BConf15 Some highlights from this patch include: * You can now directly control the shape of B-Bones using a series of properties instead of being restricted to trying to indirectly control them through the neighbouring bones. See the "Bendy Bones" panel... * B-Bones can be shaped in EditMode to define a "curved rest pose" for the bone. This is useful for things like eyebrows and mouths/eyelids * You can now make B-Bones use custom bones as their reference bone handles, instead of only using the parent/child bones. To do so, enable the "Use Custom Reference Handles" toggle. If none are specified, then the BBone will only use the Bendy Bone properties. * Constraints Head/Tail option can now slide along the B-Bone shape, instead of just linearly interpolating between the endpoints of the bone. For more details, see: * http://aligorith.blogspot.co.nz/2016/05/bendy-bones-dev-update.html * http://aligorith.blogspot.co.nz/2016/05/an-in-depth-look-at-how-b-bones-work.html -- Credits -- Original Idea: Daniel M Lara (pepeland) Original Patch/Research: Jose Molina Additional Development + Polish: Joshua Leung (aligorith) Testing/Feedback: Daniel M Lara (pepeland), Juan Pablo Bouza (jpbouza)
2016-05-17 17:19:06 +02:00
ACT_TRANS_PROP = (1 << 4),
/* all flags */
ACT_TRANS_ONLY = (ACT_TRANS_LOC | ACT_TRANS_ROT | ACT_TRANS_SCALE),
ACT_TRANS_ALL = (ACT_TRANS_ONLY | ACT_TRANS_PROP),
} eAction_TransformFlags;
/**
* Return flags indicating which transforms the given object/posechannel has
2018-11-14 02:53:15 +01:00
* - if 'curves' is provided, a list of links to these curves are also returned
* whose nodes WILL NEED FREEING.
*/
eAction_TransformFlags BKE_action_get_item_transform_flags(struct bAction *act,
struct Object *ob,
struct bPoseChannel *pchan,
ListBase *curves)
ATTR_WARN_UNUSED_RESULT;
/**
* Calculate the extents of given action.
*/
void BKE_action_frame_range_calc(const struct bAction *act,
bool include_modifiers,
float *r_start,
float *r_end) ATTR_NONNULL(3, 4);
/**
* Retrieve the intended playback frame range, using the manually set range if available,
* or falling back to scanning F-Curves for their first & last frames otherwise.
*/
void BKE_action_frame_range_get(const struct bAction *act, float *r_start, float *r_end)
ATTR_NONNULL(2, 3);
/**
* Check if the given action has any keyframes.
*/
bool BKE_action_has_motion(const struct bAction *act) ATTR_WARN_UNUSED_RESULT;
/**
* Is the action configured as cyclic.
*/
bool BKE_action_is_cyclic(const struct bAction *act) ATTR_WARN_UNUSED_RESULT;
/**
* Remove all fcurves from the action.
*/
void BKE_action_fcurves_clear(struct bAction *act);
/* Action Groups API ----------------- */
/**
* Get the active action-group for an Action.
*/
struct bActionGroup *get_active_actiongroup(struct bAction *act) ATTR_WARN_UNUSED_RESULT;
/**
* Make the given Action-Group the active one.
*/
void set_active_action_group(struct bAction *act, struct bActionGroup *agrp, short select);
/**
* Sync colors used for action/bone group with theme settings.
*/
void action_group_colors_sync(struct bActionGroup *grp, const struct bActionGroup *ref_grp);
/**
* Set colors used on this action group.
*/
void action_group_colors_set(struct bActionGroup *grp, const struct BoneColor *color);
/**
* Set colors used on this action group, using the color of the pose bone.
*
* If `pchan->color` is set to a non-default color, that is used. Otherwise the
* armature bone color is used.
*/
void action_group_colors_set_from_posebone(bActionGroup *grp, const bPoseChannel *pchan);
/**
* Add a new action group with the given name to the action>
*/
struct bActionGroup *action_groups_add_new(struct bAction *act, const char name[]);
/**
* Add given channel into (active) group
* - assumes that channel is not linked to anything anymore
* - always adds at the end of the group
*/
void action_groups_add_channel(struct bAction *act,
struct bActionGroup *agrp,
struct FCurve *fcurve);
/**
* Remove the given channel from all groups.
*/
void action_groups_remove_channel(struct bAction *act, struct FCurve *fcu);
/**
* Reconstruct group channel pointers.
* Assumes that the groups referred to by the FCurves are already in act->groups.
* Reorders the main channel list to match group order.
*/
void BKE_action_groups_reconstruct(struct bAction *act);
/**
* Find a group with the given name.
*/
struct bActionGroup *BKE_action_group_find_name(struct bAction *act, const char name[]);
/**
* Clear all 'temp' flags on all groups.
*/
void action_groups_clear_tempflags(struct bAction *act);
/**
* Return whether the action has one unique point in time keyed.
*
* This is mostly for the pose library, which will have different behavior depending on whether an
* Action corresponds to a "pose" (one keyframe) or "animation snippet" (multiple keyframes).
*
* \return `false` when there is no keyframe at all or keys on different points in time, `true`
* when exactly one point in time is keyed.
*/
bool BKE_action_has_single_frame(const struct bAction *act) ATTR_WARN_UNUSED_RESULT;
2018-06-17 17:05:51 +02:00
/* Pose API ----------------- */
2002-10-12 13:37:38 +02:00
void BKE_pose_channel_free(struct bPoseChannel *pchan) ATTR_NONNULL(1);
/**
* Deallocates a pose channel.
* Does not free the pose channel itself.
*/
void BKE_pose_channel_free_ex(struct bPoseChannel *pchan, bool do_id_user) ATTR_NONNULL(1);
== Bone Groups == I'm committing some work-in-progress code for "bone groups" now, as I there have been are some major bugs caused by the timeoffset stuff (some of my test files were not loading, and other files were showing all sorts of weird problems). Anyway, in this commit, the following things for "bone groups" have been done: * Bone groups are stored per armature (internally, this is per bPose block) * Added controls for editing bone-groups per armature - "add", "remove", "rename". These can be found in the "Links and Materials" panel in PoseMode, beside the settings for PoseLib. * Reorganised buttons for editing selected bones in PoseMode. I've replaced the "dist" and "weight" buttons (they existed in EditMode anyway) with a menu to choose the bone-group and the custom-shape-ob field. In the place of the old custom-shape-ob field, I've restored the "Hide" button. This might break muscle-memory a bit, but there isn't a lot of space to play with there. Some stuff I'd been originally planning to do before committing: * When adding keyframes for bones, an action-group with the same name as the bone's group will be added to the action, and the action-channel will be made a member of that. * New action/bone groups have unique names (renaming/adding new should check if name exists before assigning it) * There's a setting under Bone-Groups stuff which sets which custom-colour set is used to colour that group's bones. Currently, this is non-functional, as the necessary drawing code for armatures is not in place yet.
2008-01-20 03:55:35 +01:00
/**
* Clears the runtime cache of a pose channel without free.
*/
void BKE_pose_channel_runtime_reset(struct bPoseChannel_Runtime *runtime) ATTR_NONNULL(1);
/**
* Reset all non-persistent fields.
*/
void BKE_pose_channel_runtime_reset_on_copy(struct bPoseChannel_Runtime *runtime) ATTR_NONNULL(1);
/**
* Deallocates runtime cache of a pose channel
*/
void BKE_pose_channel_runtime_free(struct bPoseChannel_Runtime *runtime) ATTR_NONNULL(1);
/**
* Deallocates runtime cache of a pose channel's B-Bone shape.
*/
void BKE_pose_channel_free_bbone_cache(struct bPoseChannel_Runtime *runtime) ATTR_NONNULL(1);
void BKE_pose_channels_free(struct bPose *pose) ATTR_NONNULL(1);
/**
* Removes and deallocates all channels from a pose.
* Does not free the pose itself.
*/
void BKE_pose_channels_free_ex(struct bPose *pose, bool do_id_user) ATTR_NONNULL(1);
2002-10-12 13:37:38 +02:00
/**
* Removes the hash for quick lookup of channels, must be done when adding/removing channels.
*/
void BKE_pose_channels_hash_ensure(struct bPose *pose) ATTR_NONNULL(1);
void BKE_pose_channels_hash_free(struct bPose *pose) ATTR_NONNULL(1);
2002-10-12 13:37:38 +02:00
/**
* Selectively remove pose channels.
*/
void BKE_pose_channels_remove(struct Object *ob,
bool (*filter_fn)(const char *bone_name, void *user_data),
void *user_data) ATTR_NONNULL(1, 2);
void BKE_pose_free_data_ex(struct bPose *pose, bool do_id_user) ATTR_NONNULL(1);
void BKE_pose_free_data(struct bPose *pose) ATTR_NONNULL(1);
void BKE_pose_free(struct bPose *pose);
/**
* Removes and deallocates all data from a pose, and also frees the pose.
*/
void BKE_pose_free_ex(struct bPose *pose, bool do_id_user);
/**
* Allocate a new pose on the heap, and copy the src pose and its channels
* into the new pose. *dst is set to the newly allocated structure, and assumed to be NULL.
*
* \param dst: Should be freed already, makes entire duplicate.
*/
void BKE_pose_copy_data_ex(struct bPose **dst,
const struct bPose *src,
int flag,
bool copy_constraints);
void BKE_pose_copy_data(struct bPose **dst, const struct bPose *src, bool copy_constraints);
/**
* Copy the internal members of each pose channel including constraints
* and ID-Props, used when duplicating bones in edit-mode.
* (unlike copy_pose_channel_data which only does posing-related stuff).
*
* \note use when copying bones in edit-mode (on returned value from #BKE_pose_channel_ensure)
*/
void BKE_pose_channel_copy_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
void BKE_pose_channel_session_uuid_generate(struct bPoseChannel *pchan);
/**
* Return a pointer to the pose channel of the given name
* from this pose.
*/
struct bPoseChannel *BKE_pose_channel_find_name(const struct bPose *pose, const char *name);
/**
* Checks if the bone is on a visible bone collection
*
* \return true if on a visible layer, false otherwise.
*/
bool BKE_pose_is_bonecoll_visible(const struct bArmature *arm,
const struct bPoseChannel *pchan) ATTR_WARN_UNUSED_RESULT;
/**
* Find the active pose-channel for an object
*
* \param check_bonecoll: checks if the bone is on a visible bone collection (this might be skipped
* (e.g. for "Show Active" from the Outliner).
* \return #bPoseChannel if found or NULL.
* \note #Object, not #bPose is used here, as we need info (collection/active bone) from Armature.
*/
struct bPoseChannel *BKE_pose_channel_active(struct Object *ob, bool check_bonecoll);
/**
* Find the active pose-channel for an object if it is on a visible bone collection
* (calls #BKE_pose_channel_active with check_bonecoll set to true)
*
* \return #bPoseChannel if found or NULL.
* \note #Object, not #bPose is used here, as we need info (collection/active bone) from Armature.
*/
struct bPoseChannel *BKE_pose_channel_active_if_bonecoll_visible(struct Object *ob)
ATTR_WARN_UNUSED_RESULT;
/**
* Use this when detecting the "other selected bone",
* when we have multiple armatures in pose mode.
*
* In this case the active-selected is an obvious choice when finding the target for a
* constraint for eg. however from the users perspective the active pose bone of the
* active object is the _real_ active bone, so any other non-active selected bone
* is a candidate for being the other selected bone, see: #58447.
*/
struct bPoseChannel *BKE_pose_channel_active_or_first_selected(struct Object *ob)
ATTR_WARN_UNUSED_RESULT;
/**
* Looks to see if the channel with the given name already exists
* in this pose - if not a new one is allocated and initialized.
*
* \note Use with care, not on Armature poses but for temporal ones.
* \note (currently used for action constraints and in rebuild_pose).
*/
struct bPoseChannel *BKE_pose_channel_ensure(struct bPose *pose, const char *name) ATTR_NONNULL(2);
/**
* \see #ED_armature_ebone_get_mirrored (edit-mode, matching function)
*/
struct bPoseChannel *BKE_pose_channel_get_mirrored(const struct bPose *pose,
const char *name) ATTR_WARN_UNUSED_RESULT;
void BKE_pose_check_uuids_unique_and_report(const struct bPose *pose);
#ifndef NDEBUG
bool BKE_pose_channels_is_valid(const struct bPose *pose) ATTR_WARN_UNUSED_RESULT;
#endif
/**
* Checks for IK constraint, Spline IK, and also for Follow-Path constraint.
* can do more constraints flags later. pose should be entirely OK.
*/
void BKE_pose_update_constraint_flags(struct bPose *pose) ATTR_NONNULL(1);
Result of 2 weeks of quiet coding work in Greece :) Aim was to get a total refresh of the animation system. This is needed because; - we need to upgrade it with 21st century features - current code is spaghetti/hack combo, and hides good design - it should become lag-free with using dependency graphs A full log, with complete code API/structure/design explanation will follow, that's a load of work... so here below the list with hot changes; - The entire object update system (matrices, geometry) is now centralized. Calls to where_is_object and makeDispList are forbidden, instead we tag objects 'changed' and let the depgraph code sort it out - Removed all old "Ika" code - Depgraph is aware of all relationships, including meta balls, constraints, bevelcurve, and so on. - Made depgraph aware of relation types and layers, to do smart flushing of 'changed' events. Nothing gets calculated too often! - Transform uses depgraph to detect changes - On frame-advance, depgraph flushes animated changes Armatures; Almost all armature related code has been fully built from scratch. It now reveils the original design much better, with a very clean implementation, lag free without even calculating each Bone more than once. Result is quite a speedup yes! Important to note is; 1) Armature is data containing the 'rest position' 2) Pose is the changes of rest position, and always on object level. That way more Objects can use same Pose. Also constraints are in Pose 3) Actions only contain the Ipos to change values in Poses. - Bones draw unrotated now - Drawing bones speedup enormously (10-20 times) - Bone selecting in EditMode, selection state is saved for PoseMode, and vice-versa - Undo in editmode - Bone renaming does vertexgroups, constraints, posechannels, actions, for all users of Armature in entire file - Added Bone renaming in NKey panel - Nkey PoseMode shows eulers now - EditMode and PoseMode now have 'active' bone too (last clicked) - Parenting in EditMode' CTRL+P, ALT+P, with nice options! - Pose is added in Outliner now, with showing that constraints are in the Pose, not Armature - Disconnected IK solving from constraints. It's a separate phase now, on top of the full Pose calculations - Pose itself has a dependency graph too, so evaluation order is lag free. TODO NOW; - Rotating in Posemode has incorrect inverse transform (Martin will fix) - Python Bone/Armature/Pose API disabled... needs full recode too (wait for my doc!) - Game engine will need upgrade too - Depgraph code needs revision, cleanup, can be much faster! (But, compliments for Jean-Luc, it works like a charm!) - IK changed, it now doesnt use previous position to advance to next position anymore. That system looks nice (no flips) but is not well suited for NLA and background render. TODO LATER; We now can do loadsa new nifty features as well; like: - Kill PoseMode (can be option for armatures itself) - Make B-Bones (Bezier, Bspline, like for spines) - Move all silly button level edit to 3d window (like CTRL+I = add IK) - Much better & informative drawing - Fix action/nla editors - Put all ipos in Actions (object, mesh key, lamp color) - Add hooks - Null bones - Much more advanced constraints... Bugfixes; - OGL render (view3d header) had wrong first frame on anim render - Ipo 'recording' mode had wrong playback speed - Vertex-key mode now sticks to show 'active key', until frame change -Ton-
2005-07-03 19:35:38 +02:00
/**
* Tag constraint flags for update.
*/
void BKE_pose_tag_update_constraint_flags(struct bPose *pose) ATTR_NONNULL(1);
/**
* Return the name of structure pointed by `pose->ikparam`.
*/
const char *BKE_pose_ikparam_get_name(struct bPose *pose) ATTR_WARN_UNUSED_RESULT;
/**
* Allocate and initialize `pose->ikparam` according to `pose->iksolver`.
*/
void BKE_pose_ikparam_init(struct bPose *pose) ATTR_NONNULL(1);
/**
* Initialize a #bItasc structure with default value.
*/
void BKE_pose_itasc_init(struct bItasc *itasc);
/**
* Checks if a bone is part of an IK chain or not.
*/
bool BKE_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
2018-06-17 17:05:51 +02:00
/* Bone Groups API --------------------- */
/**
* Adds a new bone-group (name may be NULL).
*/
struct bActionGroup *BKE_pose_add_group(struct bPose *pose, const char *name) ATTR_NONNULL(1);
/**
* Remove the given bone-group (expects 'virtual' index (+1 one, used by active_group etc.))
* index might be invalid ( < 1), in which case it will be find from grp.
*/
void BKE_pose_remove_group(struct bPose *pose, struct bActionGroup *grp, int index)
ATTR_NONNULL(1);
/**
* Remove the indexed bone-group (expects 'virtual' index (+1 one, used by active_group etc.)).
*/
void BKE_pose_remove_group_index(struct bPose *pose, int index) ATTR_NONNULL(1);
2018-06-17 17:05:51 +02:00
/* Assorted Evaluation ----------------- */
/**
* For the calculation of the effects of an Action at the given frame on an object
* This is currently only used for the Action Constraint
*/
2011-06-15 16:06:25 +02:00
void what_does_obaction(struct Object *ob,
struct Object *workob,
struct bPose *pose,
struct bAction *act,
char groupname[],
const struct AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1, 2);
2002-10-12 13:37:38 +02:00
void BKE_pose_copy_pchan_result(struct bPoseChannel *pchanto, const struct bPoseChannel *pchanfrom)
ATTR_NONNULL(1, 2);
/**
* Both poses should be in sync.
*/
2013-01-24 15:48:08 +01:00
bool BKE_pose_copy_result(struct bPose *to, struct bPose *from);
/**
* Zero the pose transforms for the entire pose or only for selected bones.
*/
void BKE_pose_rest(struct bPose *pose, bool selected_bones_only);
/**
* Tag pose for recalculation. Also tag all related data to be recalculated.
*/
void BKE_pose_tag_recalc(struct Main *bmain, struct bPose *pose) ATTR_NONNULL(1, 2);
void BKE_pose_blend_write(struct BlendWriter *writer, struct bPose *pose, struct bArmature *arm)
ATTR_NONNULL(1, 2, 3);
void BKE_pose_blend_read_data(struct BlendDataReader *reader,
struct ID *id_owner,
struct bPose *pose) ATTR_NONNULL(1, 2);
2023-08-25 01:39:26 +02:00
void BKE_pose_blend_read_after_liblink(struct BlendLibReader *reader,
struct Object *ob,
struct bPose *pose) ATTR_NONNULL(1, 2);
/* `action_mirror.cc` */
void BKE_action_flip_with_pose(struct bAction *act, struct Object *ob_arm) ATTR_NONNULL(1, 2);
2002-10-12 13:37:38 +02:00
#ifdef __cplusplus
};
#endif