35 #include "RNA_prototypes.h"
111 for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
131 for (fcu = act->
curves.
first; fcu; fcu = fcu->next) {
133 char pchan_name[
sizeof(pchan->name)];
141 if (
STREQ(pchan_name, pchan->name)) {
146 ((fcu->grp) ? (fcu->grp->name) : (
NULL)),
159 bool do_loc =
false, do_rot =
false, do_scale =
false;
235 if (targetless_con) {
237 *temp_con_data = *targetless_con;
263 for (; con; con = con->
next) {
307 if (
data->rootbone == 0) {
370 data->max_rootbone =
data->rootbone;
379 short wentdeeper = 0, added = 0;
388 if (wentdeeper == 0) {
452 return (tot_ik) ? 1 : 0;
488 bool is_mirror_relative)
509 if (is_mirror_relative) {
510 float pchan_mtx[4][4];
511 float pchan_mtx_mirror[4][4];
513 float flip_mtx[4][4];
520 mul_m4_m4m4(pchan_mtx_mirror, pchan_mtx_mirror, flip_mtx);
521 mul_m4_m4m4(pchan_mtx_mirror, flip_mtx, pchan_mtx_mirror);
540 float pmat[3][3], omat[3][3];
541 float cmat[3][3], tmat[3][3];
561 td->loc = pchan->
loc;
678 td->loc =
data->grabtarget;
710 bool has_translate_rotate_buf[2] = {
false,
false};
721 if ((arm ==
NULL) || (pose ==
NULL)) {
732 Bone *bone = pchan->bone;
739 if (has_translate_rotate !=
NULL) {
740 if (has_translate_rotate[0] && has_translate_rotate[1]) {
747 has_translate_rotate[0] =
true;
752 has_translate_rotate[0] =
true;
756 has_translate_rotate[1] =
true;
760 has_translate_rotate[0] =
true;
765 if (tc->data_len == 0) {
778 int total_mirrored = 0;
790 "PoseInitData_Mirror");
795 tc->custom.type.data = pid;
796 tc->custom.type.use_free =
true;
801 if (tc->data_len == 0) {
826 for (i = 0; i < tc->data_len; i++, td++, tdx++) {
848 has_translate_rotate[0] =
true;
861 if (td != (tc->data + tc->data_len)) {
873 if (has_translate_rotate[1]) {
891 int total_mirrored = 0;
894 for (ebo = edbo->
first; ebo; ebo = ebo->
next) {
895 const int data_len_prev = tc->data_len;
918 if (mirror && (data_len_prev < tc->data_len)) {
935 tc->custom.type.data = bid;
936 tc->custom.type.use_free =
true;
938 t->data_len_all += tc->data_len;
942 t->data_len_all = -1;
953 float mtx[3][3], smtx[3][3], bonemat[3][3];
963 for (ebo = edbo->
first; ebo; ebo = ebo->
next) {
1028 td->
ob = tc->obedit;
1043 td->
ob = tc->obedit;
1064 td->loc = ebo->
tail;
1082 td->
ob = tc->obedit;
1089 td->loc = ebo->
head;
1105 td->
ob = tc->obedit;
1112 if (mirror && (td_old != td)) {
1115 bid[i].
bone = eboflip;
1173 for (ebo_child = arm->
edbo->
first; ebo_child; ebo_child = ebo_child->
next) {
1206 for (ebo = edbo->
first; ebo; ebo = ebo->
next) {
1253 for (i = 0; i < tc->data_len; i++, td++) {
1255 float vec[3], up_axis[3];
1304 float flip_mtx[4][4];
1306 flip_mtx[0][0] = -1;
1320 for (
int i = tc->
data_len; i--; td++) {
1325 if (pchan ==
NULL) {
1339 float pchan_mtx_final[4][4];
1341 mul_m4_m4m4(pchan_mtx_final, pchan_mtx_final, flip_mtx);
1342 mul_m4_m4m4(pchan_mtx_final, flip_mtx, pchan_mtx_final);
1422 Object *ob = tc->poseobj;
1448 Object *ob = tc->poseobj;
1472 int targetless_ik = (
t->flag &
T_AUTOIK);
1487 GSET_ITER (gs_iter, motionpath_updates) {
1505 for (; bone; bone = bone->
next) {
1561 int segcount, apply = 0;
1583 for (; parchan; parchan = parchan->
parent) {
1584 chanlist[segcount] = parchan;
1587 if (segcount ==
data->rootbone || segcount > 255) {
1591 for (; segcount; segcount--) {
1600 parchan = chanlist[segcount - 1];
1601 bone = parchan->
bone;
1607 float rmat3[3][3], qrmat[3][3], imat3[3][3], smat[3][3];
1649 bool relations_changed =
false;
1663 relations_changed =
true;
1681 if (relations_changed) {
1707 short targetless_ik = 0;
1715 struct Object *pose_ob = tc->poseobj;
1760 GSET_ITER (gs_iter, motionpath_updates) {
void BIK_clear_data(struct bPose *pose)
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
struct bPoseChannel * BKE_pose_channel_get_mirrored(const struct bPose *pose, const char *name)
bool BKE_pose_is_layer_visible(const struct bArmature *arm, const struct bPoseChannel *pchan)
void BKE_animsys_free_nla_keyframing_context_cache(struct ListBase *cache)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
void BKE_bone_parent_transform_calc_from_pchan(const struct bPoseChannel *pchan, struct BoneParentTransform *r_bpt)
void BKE_pchan_to_mat4(const struct bPoseChannel *pchan, float r_chanmat[4][4])
struct bArmature * BKE_armature_from_object(struct Object *ob)
void BKE_pchan_apply_mat4(struct bPoseChannel *pchan, const float mat[4][4], bool use_compat)
void BKE_pchan_mat3_to_rot(struct bPoseChannel *pchan, const float mat[3][3], bool use_compat)
void BKE_armature_mat_pose_to_bone(struct bPoseChannel *pchan, const float inmat[4][4], float outmat[4][4])
#define PBONE_VISIBLE(arm, bone)
void BKE_pose_where_is(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
void BKE_pchan_rot_to_mat3(const struct bPoseChannel *pchan, float r_mat[3][3])
struct bConstraint * BKE_constraint_add_for_pose(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type)
struct ReportList * CTX_wm_reports(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void BKE_report(ReportList *reports, eReportType type, const char *message)
GSet * BLI_gset_ptr_new(const char *info)
void BLI_gset_insert(GSet *gs, void *key)
#define GSET_ITER(gs_iter_, gset_)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
BLI_INLINE void * BLI_gsetIterator_getKey(GSetIterator *gsi)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4(float R[4][4])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
#define PSEUDOINVERSE_EPSILON
void unit_m4(float m[4][4])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
bool invert_m3_m3(float R[3][3], const float A[3][3])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
#define mul_m3_series(...)
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void mat3_to_size(float size[3], const float M[3][3])
void pseudoinverse_m3_m3(float Ainv[3][3], const float A[3][3], float epsilon)
float angle_compat_rad(float angle, float angle_compat)
void rotation_between_vecs_to_quat(float q[4], const float v1[3], const float v2[3])
void mul_qt_v3(const float q[4], float r[3])
void copy_qt_qt(float q[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
bool bool BLI_str_quoted_substr(const char *__restrict str, const char *__restrict prefix, char *result, size_t result_maxlen)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ MOTIONPATH_BAKE_HAS_PATHS
@ BONE_HINGE_CHILD_TRANSFORM
@ CONSTRAINT_TYPE_KINEMATIC
@ V3D_AROUND_LOCAL_ORIGINS
@ POSE_PATH_CALC_RANGE_CURRENT_FRAME
@ POSE_PATH_CALC_RANGE_CHANGED
#define EBONE_VISIBLE(arm, ebone)
#define ANIM_KS_LOC_ROT_SCALE_ID
#define IS_AUTOKEY_FLAG(scene, flag)
#define ANIM_KS_LOCATION_ID
#define ANIM_KS_SCALING_ID
#define IS_AUTOKEY_ON(scene)
#define ANIM_KS_ROTATION_ID
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float align_axis[3], const bool axis_only)
void ED_armature_edit_transform_mirror_update(Object *obedit)
void ED_armature_ebone_to_mat3(EditBone *ebone, float r_mat[3][3])
EditBone * ED_armature_ebone_get_mirrored(const ListBase *edbo, EditBone *ebo)
const Depsgraph * depsgraph
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
eInsertKeyFlags ANIM_get_keyframing_flags(Scene *scene, const bool use_autokey_mode)
int insert_keyframe(Main *bmain, ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, const AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, ListBase *nla_cache, eInsertKeyFlags flag)
int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra)
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
KeyingSet * ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[])
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data)
void(* MEM_freeN)(void *vmemh)
size_t(* MEM_allocN_len)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob, ePosePathCalcRange range)
struct bPoseChannel * pchan
struct PoseInitData_Mirror::@602 orig
struct ToolSettings * toolsettings
TransCustomDataContainer custom
float axismtx_gimbal[3][3]
struct bConstraint * next
struct bPoseChannel * parent
struct bPoseChannel * next