diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-23 15:31:15 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-23 15:31:15 +0400 |
commit | ba14beb000fef2c5911b4e17c0bf260de1cf251d (patch) | |
tree | 1fe8bbf7d8ebe9b16672cf856067543c684d010c /source/blender/blenkernel | |
parent | c4a165f168196b52ed66105bbe99fe51da8b5317 (diff) |
Code cleanup: add usual 'BKE_' prefix to 'public' constraint functions from blenkernel...
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_constraint.h | 48 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 17 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 106 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 26 |
9 files changed, 113 insertions, 112 deletions
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index 79e75127763..c79dc62bb61 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -108,8 +108,8 @@ typedef struct bConstraintTypeInfo { } bConstraintTypeInfo; /* Function Prototypes for bConstraintTypeInfo's */ -bConstraintTypeInfo *constraint_get_typeinfo(struct bConstraint *con); -bConstraintTypeInfo *get_constraint_typeinfo(int type); +bConstraintTypeInfo *BKE_constraint_get_typeinfo(struct bConstraint *con); +bConstraintTypeInfo *BKE_get_constraint_typeinfo(int type); /* ---------------------------------------------------------------------------- */ /* Useful macros for testing various common flag combinations */ @@ -120,38 +120,38 @@ bConstraintTypeInfo *get_constraint_typeinfo(int type); /* ---------------------------------------------------------------------------- */ /* Constraint function prototypes */ -void unique_constraint_name(struct bConstraint *con, struct ListBase *list); +void BKE_unique_constraint_name(struct bConstraint *con, struct ListBase *list); -void free_constraints(struct ListBase *list); -void copy_constraints(struct ListBase *dst, const struct ListBase *src, int do_extern); -void relink_constraints(struct ListBase *list); -void id_loop_constraints(struct ListBase *list, ConstraintIDFunc func, void *userdata); -void free_constraint_data(struct bConstraint *con); +void BKE_free_constraints(struct ListBase *list); +void BKE_copy_constraints(struct ListBase *dst, const struct ListBase *src, int do_extern); +void BKE_relink_constraints(struct ListBase *list); +void BKE_id_loop_constraints(struct ListBase *list, ConstraintIDFunc func, void *userdata); +void BKE_free_constraint_data(struct bConstraint *con); /* Constraint API function prototypes */ -struct bConstraint *constraints_get_active(struct ListBase *list); -void constraints_set_active(ListBase *list, struct bConstraint *con); -struct bConstraint *constraints_findByName(struct ListBase *list, const char *name); - -struct bConstraint *add_ob_constraint(struct Object *ob, const char *name, short type); -struct bConstraint *add_pose_constraint(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type); +struct bConstraint *BKE_constraints_get_active(struct ListBase *list); +void BKE_constraints_set_active(ListBase *list, struct bConstraint *con); +struct bConstraint *BKE_constraints_findByName(struct ListBase *list, const char *name); + +struct bConstraint *BKE_add_ob_constraint(struct Object *ob, const char *name, short type); +struct bConstraint *BKE_add_pose_constraint(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type); -int remove_constraint(ListBase *list, struct bConstraint *con); -void remove_constraints_type(ListBase *list, short type, short last_only); +int BKE_remove_constraint(ListBase *list, struct bConstraint *con); +void BKE_remove_constraints_type(ListBase *list, short type, short last_only); /* Constraints + Proxies function prototypes */ -void extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src); -short proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan); +void BKE_extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src); +short BKE_proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan); /* Constraint Evaluation function prototypes */ -struct bConstraintOb *constraints_make_evalob(struct Scene *scene, struct Object *ob, void *subdata, short datatype); -void constraints_clear_evalob(struct bConstraintOb *cob); +struct bConstraintOb *BKE_constraints_make_evalob(struct Scene *scene, struct Object *ob, void *subdata, short datatype); +void BKE_constraints_clear_evalob(struct bConstraintOb *cob); -void constraint_mat_convertspace(struct Object *ob, struct bPoseChannel *pchan, float mat[4][4], short from, short to); +void BKE_constraint_mat_convertspace(struct Object *ob, struct bPoseChannel *pchan, float mat[4][4], short from, short to); -void get_constraint_target_matrix(struct Scene *scene, struct bConstraint *con, int n, short ownertype, void *ownerdata, float mat[4][4], float ctime); -void get_constraint_targets_for_solving(struct bConstraint *con, struct bConstraintOb *ob, struct ListBase *targets, float ctime); -void solve_constraints(struct ListBase *conlist, struct bConstraintOb *cob, float ctime); +void BKE_get_constraint_target_matrix(struct Scene *scene, struct bConstraint *con, int n, short ownertype, void *ownerdata, float mat[4][4], float ctime); +void BKE_get_constraint_targets_for_solving(struct bConstraint *con, struct bConstraintOb *ob, struct ListBase *targets, float ctime); +void BKE_solve_constraints(struct ListBase *conlist, struct bConstraintOb *cob, float ctime); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 83d1538ecbe..63e12dfb99d 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -543,7 +543,7 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon) for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) { /* TODO: rename this argument... */ if (copycon) { - copy_constraints(&listb, &pchan->constraints, TRUE); // copy_constraints NULLs listb + BKE_copy_constraints(&listb, &pchan->constraints, TRUE); // BKE_copy_constraints NULLs listb pchan->constraints = listb; pchan->mpath = NULL; /* motion paths should not get copied yet... */ } @@ -621,7 +621,7 @@ void BKE_pose_channel_free(bPoseChannel *pchan) pchan->mpath = NULL; } - free_constraints(&pchan->constraints); + BKE_free_constraints(&pchan->constraints); if (pchan->prop) { IDP_FreeProperty(pchan->prop); @@ -711,7 +711,7 @@ void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_f pchan->iklinweight = pchan_from->iklinweight; /* constraints */ - copy_constraints(&pchan->constraints, &pchan_from->constraints, TRUE); + BKE_copy_constraints(&pchan->constraints, &pchan_from->constraints, TRUE); /* id-properties */ if (pchan->prop) { diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 9155d67dc36..ad14dee168a 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1620,15 +1620,16 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected * 2. copy proxy-pchan's constraints on-to new * 3. add extracted local constraints back on top * - * Note for copy_constraints: when copying constraints, disable 'do_extern' otherwise - * we get the libs direct linked in this blend. */ - extract_proxylocal_constraints(&proxylocal_constraints, &pchan->constraints); - copy_constraints(&pchanw.constraints, &pchanp->constraints, FALSE); + * Note for BKE_copy_constraints: when copying constraints, disable 'do_extern' otherwise + * we get the libs direct linked in this blend. + */ + BKE_extract_proxylocal_constraints(&proxylocal_constraints, &pchan->constraints); + BKE_copy_constraints(&pchanw.constraints, &pchanp->constraints, FALSE); BLI_movelisttolist(&pchanw.constraints, &proxylocal_constraints); /* constraints - set target ob pointer to own object */ for (con = pchanw.constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -2426,15 +2427,15 @@ void BKE_pose_where_is_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float /* prepare PoseChannel for Constraint solving * - makes a copy of matrix, and creates temporary struct to use */ - cob = constraints_make_evalob(scene, ob, pchan, CONSTRAINT_OBTYPE_BONE); + cob = BKE_constraints_make_evalob(scene, ob, pchan, CONSTRAINT_OBTYPE_BONE); /* Solve PoseChannel's Constraints */ - solve_constraints(&pchan->constraints, cob, ctime); /* ctime doesnt alter objects */ + BKE_solve_constraints(&pchan->constraints, cob, ctime); /* ctime doesnt alter objects */ /* cleanup after Constraint Solving * - applies matrix back to pchan, and frees temporary struct used */ - constraints_clear_evalob(cob); + BKE_constraints_clear_evalob(cob); /* prevent constraints breaking a chain */ if (pchan->bone->flag & BONE_CONNECTED) { diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index c3aab22fe5a..4874a3a019d 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -96,7 +96,7 @@ /* -------------- Naming -------------- */ /* Find the first available, non-duplicate name for a given constraint */ -void unique_constraint_name(bConstraint *con, ListBase *list) +void BKE_unique_constraint_name(bConstraint *con, ListBase *list) { BLI_uniquename(list, con, "Const", '.', offsetof(bConstraint, name), sizeof(con->name)); } @@ -105,7 +105,7 @@ void unique_constraint_name(bConstraint *con, ListBase *list) /* package an object/bone for use in constraint evaluation */ /* This function MEM_calloc's a bConstraintOb struct, that will need to be freed after evaluation */ -bConstraintOb *constraints_make_evalob(Scene *scene, Object *ob, void *subdata, short datatype) +bConstraintOb *BKE_constraints_make_evalob(Scene *scene, Object *ob, void *subdata, short datatype) { bConstraintOb *cob; @@ -169,7 +169,7 @@ bConstraintOb *constraints_make_evalob(Scene *scene, Object *ob, void *subdata, } /* cleanup after constraint evaluation */ -void constraints_clear_evalob(bConstraintOb *cob) +void BKE_constraints_clear_evalob(bConstraintOb *cob) { float delta[4][4], imat[4][4]; @@ -219,7 +219,7 @@ void constraints_clear_evalob(bConstraintOb *cob) * of a matrix from one space to another for constraint evaluation. * For now, this is only implemented for Objects and PoseChannels. */ -void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[4][4], short from, short to) +void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[4][4], short from, short to) { float diff_mat[4][4]; float imat[4][4]; @@ -242,7 +242,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[4][4 /* use pose-space as stepping stone for other spaces... */ if (ELEM(to, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_PARLOCAL)) { /* call self with slightly different values */ - constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to); + BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to); } } break; @@ -278,7 +278,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[4][4 /* use pose-space as stepping stone for other spaces */ if (ELEM(to, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_PARLOCAL)) { /* call self with slightly different values */ - constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to); + BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to); } } break; @@ -293,7 +293,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[4][4 /* use pose-space as stepping stone for other spaces */ if (ELEM(to, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL)) { /* call self with slightly different values */ - constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to); + BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to); } } break; @@ -499,7 +499,7 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m /* Case OBJECT */ if (!strlen(substring)) { copy_m4_m4(mat, ob->obmat); - constraint_mat_convertspace(ob, NULL, mat, from, to); + BKE_constraint_mat_convertspace(ob, NULL, mat, from, to); } /* Case VERTEXGROUP */ /* Current method just takes the average location of all the points in the @@ -512,11 +512,11 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m */ else if (ob->type == OB_MESH) { contarget_get_mesh_mat(ob, substring, mat); - constraint_mat_convertspace(ob, NULL, mat, from, to); + BKE_constraint_mat_convertspace(ob, NULL, mat, from, to); } else if (ob->type == OB_LATTICE) { contarget_get_lattice_mat(ob, substring, mat); - constraint_mat_convertspace(ob, NULL, mat, from, to); + BKE_constraint_mat_convertspace(ob, NULL, mat, from, to); } /* Case BONE */ else { @@ -549,7 +549,7 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m copy_m4_m4(mat, ob->obmat); /* convert matrix space as required */ - constraint_mat_convertspace(ob, pchan, mat, from, to); + BKE_constraint_mat_convertspace(ob, pchan, mat, from, to); } } @@ -4211,7 +4211,7 @@ static void constraints_init_typeinfo(void) /* This function should be used for getting the appropriate type-info when only * a constraint type is known */ -bConstraintTypeInfo *get_constraint_typeinfo(int type) +bConstraintTypeInfo *BKE_get_constraint_typeinfo(int type) { /* initialize the type-info list? */ if (CTI_INIT) { @@ -4236,11 +4236,11 @@ bConstraintTypeInfo *get_constraint_typeinfo(int type) /* This function should always be used to get the appropriate type-info, as it * has checks which prevent segfaults in some weird cases. */ -bConstraintTypeInfo *constraint_get_typeinfo(bConstraint *con) +bConstraintTypeInfo *BKE_constraint_get_typeinfo(bConstraint *con) { /* only return typeinfo for valid constraints */ if (con) - return get_constraint_typeinfo(con->type); + return BKE_get_constraint_typeinfo(con->type); else return NULL; } @@ -4252,7 +4252,7 @@ bConstraintTypeInfo *constraint_get_typeinfo(bConstraint *con) /* ---------- Data Management ------- */ -/* helper function for free_constraint_data() - unlinks references */ +/* helper function for BKE_free_constraint_data() - unlinks references */ static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData)) { if (*idpoin && isReference) @@ -4263,10 +4263,10 @@ static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isRe * be sure to run BIK_clear_data() when freeing an IK constraint, * unless DAG_scene_sort is called. */ -void free_constraint_data(bConstraint *con) +void BKE_free_constraint_data(bConstraint *con) { if (con->data) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); if (cti) { /* perform any special freeing constraint may have */ @@ -4284,13 +4284,13 @@ void free_constraint_data(bConstraint *con) } /* Free all constraints from a constraint-stack */ -void free_constraints(ListBase *list) +void BKE_free_constraints(ListBase *list) { bConstraint *con; /* Free constraint data and also any extra data */ for (con = list->first; con; con = con->next) - free_constraint_data(con); + BKE_free_constraint_data(con); /* Free the whole list */ BLI_freelistN(list); @@ -4298,10 +4298,10 @@ void free_constraints(ListBase *list) /* Remove the specified constraint from the given constraint stack */ -int remove_constraint(ListBase *list, bConstraint *con) +int BKE_remove_constraint(ListBase *list, bConstraint *con) { if (con) { - free_constraint_data(con); + BKE_free_constraint_data(con); BLI_freelinkN(list, con); return 1; } @@ -4310,7 +4310,7 @@ int remove_constraint(ListBase *list, bConstraint *con) } /* Remove all the constraints of the specified type from the given constraint stack */ -void remove_constraints_type(ListBase *list, short type, short last_only) +void BKE_remove_constraints_type(ListBase *list, short type, short last_only) { bConstraint *con, *conp; @@ -4322,7 +4322,7 @@ void remove_constraints_type(ListBase *list, short type, short last_only) conp = con->prev; if (con->type == type) { - remove_constraint(list, con); + BKE_remove_constraint(list, con); if (last_only) return; } @@ -4335,7 +4335,7 @@ void remove_constraints_type(ListBase *list, short type, short last_only) static bConstraint *add_new_constraint_internal(const char *name, short type) { bConstraint *con = MEM_callocN(sizeof(bConstraint), "Constraint"); - bConstraintTypeInfo *cti = get_constraint_typeinfo(type); + bConstraintTypeInfo *cti = BKE_get_constraint_typeinfo(type); const char *newName; /* Set up a generic constraint datablock */ @@ -4385,17 +4385,17 @@ static bConstraint *add_new_constraint(Object *ob, bPoseChannel *pchan, const ch * (otherwise unique-naming code will fail, since it assumes element exists in list) */ BLI_addtail(list, con); - unique_constraint_name(con, list); + BKE_unique_constraint_name(con, list); /* if the target list is a list on some PoseChannel belonging to a proxy-protected * Armature layer, we must tag newly added constraints with a flag which allows them * to persist after proxy syncing has been done */ - if (proxylocked_constraints_owner(ob, pchan)) + if (BKE_proxylocked_constraints_owner(ob, pchan)) con->flag |= CONSTRAINT_PROXY_LOCAL; /* make this constraint the active one */ - constraints_set_active(list, con); + BKE_constraints_set_active(list, con); } /* set type+owner specific immutable settings */ @@ -4419,7 +4419,7 @@ static bConstraint *add_new_constraint(Object *ob, bPoseChannel *pchan, const ch /* ......... */ /* Add new constraint for the given bone */ -bConstraint *add_pose_constraint(Object *ob, bPoseChannel *pchan, const char *name, short type) +bConstraint *BKE_add_pose_constraint(Object *ob, bPoseChannel *pchan, const char *name, short type) { if (pchan == NULL) return NULL; @@ -4428,14 +4428,14 @@ bConstraint *add_pose_constraint(Object *ob, bPoseChannel *pchan, const char *na } /* Add new constraint for the given object */ -bConstraint *add_ob_constraint(Object *ob, const char *name, short type) +bConstraint *BKE_add_ob_constraint(Object *ob, const char *name, short type) { return add_new_constraint(ob, NULL, name, type); } /* ......... */ -/* helper for relink_constraints() - call ID_NEW() on every ID reference the constraint has */ +/* helper for BKE_relink_constraints() - call ID_NEW() on every ID reference the constraint has */ static void con_relink_id_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *UNUSED(userdata)) { /* ID_NEW() expects a struct with inline "id" member as first @@ -4449,20 +4449,20 @@ static void con_relink_id_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED } /* Reassign links that constraints have to other data (called during file loading?) */ -void relink_constraints(ListBase *conlist) +void BKE_relink_constraints(ListBase *conlist) { /* just a wrapper around ID-loop for just calling ID_NEW() on all ID refs */ - id_loop_constraints(conlist, con_relink_id_cb, NULL); + BKE_id_loop_constraints(conlist, con_relink_id_cb, NULL); } /* Run the given callback on all ID-blocks in list of constraints */ -void id_loop_constraints(ListBase *conlist, ConstraintIDFunc func, void *userdata) +void BKE_id_loop_constraints(ListBase *conlist, ConstraintIDFunc func, void *userdata) { bConstraint *con; for (con = conlist->first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); if (cti) { if (cti->id_looper) @@ -4473,14 +4473,14 @@ void id_loop_constraints(ListBase *conlist, ConstraintIDFunc func, void *userdat /* ......... */ -/* helper for copy_constraints(), to be used for making sure that ID's are valid */ +/* helper for BKE_copy_constraints(), to be used for making sure that ID's are valid */ static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *UNUSED(userData)) { if (*idpoin && (*idpoin)->lib) id_lib_extern(*idpoin); } -/* helper for copy_constraints(), to be used for making sure that usercounts of copied ID's are fixed up */ +/* helper for BKE_copy_constraints(), to be used for making sure that usercounts of copied ID's are fixed up */ static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData)) { /* increment usercount if this is a reference type */ @@ -4489,7 +4489,7 @@ static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short } /* duplicate all of the constraints in a constraint stack */ -void copy_constraints(ListBase *dst, const ListBase *src, int do_extern) +void BKE_copy_constraints(ListBase *dst, const ListBase *src, int do_extern) { bConstraint *con, *srccon; @@ -4497,7 +4497,7 @@ void copy_constraints(ListBase *dst, const ListBase *src, int do_extern) BLI_duplicatelist(dst, src); for (con = dst->first, srccon = src->first; con && srccon; srccon = srccon->next, con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); /* make a new copy of the constraint's data */ con->data = MEM_dupallocN(con->data); @@ -4524,13 +4524,13 @@ void copy_constraints(ListBase *dst, const ListBase *src, int do_extern) /* ......... */ -bConstraint *constraints_findByName(ListBase *list, const char *name) +bConstraint *BKE_constraints_findByName(ListBase *list, const char *name) { return BLI_findstring(list, name, offsetof(bConstraint, name)); } /* finds the 'active' constraint in a constraint stack */ -bConstraint *constraints_get_active(ListBase *list) +bConstraint *BKE_constraints_get_active(ListBase *list) { bConstraint *con; @@ -4547,7 +4547,7 @@ bConstraint *constraints_get_active(ListBase *list) } /* Set the given constraint as the active one (clearing all the others) */ -void constraints_set_active(ListBase *list, bConstraint *con) +void BKE_constraints_set_active(ListBase *list, bConstraint *con) { bConstraint *c; @@ -4564,7 +4564,7 @@ void constraints_set_active(ListBase *list, bConstraint *con) /* -------- Constraints and Proxies ------- */ /* Rescue all constraints tagged as being CONSTRAINT_PROXY_LOCAL (i.e. added to bone that's proxy-synced in this file) */ -void extract_proxylocal_constraints(ListBase *dst, ListBase *src) +void BKE_extract_proxylocal_constraints(ListBase *dst, ListBase *src) { bConstraint *con, *next; @@ -4581,7 +4581,7 @@ void extract_proxylocal_constraints(ListBase *dst, ListBase *src) } /* Returns if the owner of the constraint is proxy-protected */ -short proxylocked_constraints_owner(Object *ob, bPoseChannel *pchan) +short BKE_proxylocked_constraints_owner(Object *ob, bPoseChannel *pchan) { /* Currently, constraints can only be on object or bone level */ if (ob && ob->proxy) { @@ -4610,9 +4610,9 @@ short proxylocked_constraints_owner(Object *ob, bPoseChannel *pchan) * None of the actual calculations of the matrices should be done here! Also, this function is * not to be used by any new constraints, particularly any that have multiple targets. */ -void get_constraint_target_matrix(struct Scene *scene, bConstraint *con, int n, short ownertype, void *ownerdata, float mat[4][4], float ctime) +void BKE_get_constraint_target_matrix(struct Scene *scene, bConstraint *con, int n, short ownertype, void *ownerdata, float mat[4][4], float ctime) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintOb *cob; bConstraintTarget *ct; @@ -4679,9 +4679,9 @@ void get_constraint_target_matrix(struct Scene *scene, bConstraint *con, int n, } /* Get the list of targets required for solving a constraint */ -void get_constraint_targets_for_solving(bConstraint *con, bConstraintOb *cob, ListBase *targets, float ctime) +void BKE_get_constraint_targets_for_solving(bConstraint *con, bConstraintOb *cob, ListBase *targets, float ctime) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); if (cti && cti->get_constraint_targets) { bConstraintTarget *ct; @@ -4711,10 +4711,10 @@ void get_constraint_targets_for_solving(bConstraint *con, bConstraintOb *cob, Li /* This function is called whenever constraints need to be evaluated. Currently, all * constraints that can be evaluated are everytime this gets run. * - * constraints_make_evalob and constraints_clear_evalob should be called before and + * BKE_constraints_make_evalob and BKE_constraints_clear_evalob should be called before and * after running this function, to sort out cob */ -void solve_constraints(ListBase *conlist, bConstraintOb *cob, float ctime) +void BKE_solve_constraints(ListBase *conlist, bConstraintOb *cob, float ctime) { bConstraint *con; float oldmat[4][4]; @@ -4726,7 +4726,7 @@ void solve_constraints(ListBase *conlist, bConstraintOb *cob, float ctime) /* loop over available constraints, solving and blending them */ for (con = conlist->first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; /* these we can skip completely (invalid constraints...) */ @@ -4746,10 +4746,10 @@ void solve_constraints(ListBase *conlist, bConstraintOb *cob, float ctime) copy_m4_m4(oldmat, cob->matrix); /* move owner matrix into right space */ - constraint_mat_convertspace(cob->ob, cob->pchan, cob->matrix, CONSTRAINT_SPACE_WORLD, con->ownspace); + BKE_constraint_mat_convertspace(cob->ob, cob->pchan, cob->matrix, CONSTRAINT_SPACE_WORLD, con->ownspace); /* prepare targets for constraint solving */ - get_constraint_targets_for_solving(con, cob, &targets, ctime); + BKE_get_constraint_targets_for_solving(con, cob, &targets, ctime); /* Solve the constraint and put result in cob->matrix */ cti->evaluate_constraint(con, cob, &targets); @@ -4764,7 +4764,7 @@ void solve_constraints(ListBase *conlist, bConstraintOb *cob, float ctime) /* move owner back into worldspace for next constraint/other business */ if ((con->flag & CONSTRAINT_SPACEONCE) == 0) - constraint_mat_convertspace(cob->ob, cob->pchan, cob->matrix, con->ownspace, CONSTRAINT_SPACE_WORLD); + BKE_constraint_mat_convertspace(cob->ob, cob->pchan, cob->matrix, con->ownspace, CONSTRAINT_SPACE_WORLD); /* Interpolate the enforcement, to blend result of constraint into final owner transform * - all this happens in worldspace to prevent any weirdness creeping in ([#26014] and [#25725]), diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 6ba140fcec1..42389564ec0 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -472,7 +472,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { for (con = pchan->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -754,7 +754,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O /* object constraints */ for (con = ob->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -2295,7 +2295,7 @@ static void dag_object_time_update_flags(Object *ob) if (ob->constraints.first) { bConstraint *con; for (con = ob->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -2738,7 +2738,7 @@ static void dag_id_flush_update(Scene *sce, ID *id) for (obt = bmain->object.first; obt; obt = obt->id.next) { bConstraint *con; for (con = obt->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); if (ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) { @@ -3030,7 +3030,7 @@ void DAG_pose_sort(Object *ob) addtoroot = 0; } for (con = pchan->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 23fae2e9de0..0efbd92641b 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -529,7 +529,7 @@ static int subframe_updateObject(Scene *scene, Object *ob, int flags, float fram /* also update constraint targets */ for (con = ob->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; if (cti && cti->get_constraint_targets) { diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 5e01773cab9..1511ac5bb3f 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1192,7 +1192,7 @@ static float dvar_eval_locDiff(ChannelDriver *driver, DriverVar *dvar) /* extract transform just like how the constraints do it! */ copy_m4_m4(mat, pchan->pose_mat); - constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); + BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); /* ... and from that, we get our transform */ copy_v3_v3(tmp_loc, mat[3]); @@ -1217,7 +1217,7 @@ static float dvar_eval_locDiff(ChannelDriver *driver, DriverVar *dvar) /* extract transform just like how the constraints do it! */ copy_m4_m4(mat, ob->obmat); - constraint_mat_convertspace(ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL); + BKE_constraint_mat_convertspace(ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL); /* ... and from that, we get our transform */ copy_v3_v3(tmp_loc, mat[3]); @@ -1288,7 +1288,7 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar) if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { /* just like how the constraints do it! */ copy_m4_m4(mat, pchan->pose_mat); - constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); + BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); } else { /* specially calculate local matrix, since chan_mat is not valid @@ -1315,7 +1315,7 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar) if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { /* just like how the constraints do it! */ copy_m4_m4(mat, ob->obmat); - constraint_mat_convertspace(ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL); + BKE_constraint_mat_convertspace(ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL); } else { /* transforms to matrix */ diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 4156b5b4367..69e368f0d08 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -1325,7 +1325,7 @@ void BKE_movieclip_unlink(Main *bmain, MovieClip *clip) bConstraint *con; for (con = ob->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); if (cti->type == CONSTRAINT_TYPE_FOLLOWTRACK) { bFollowTrackConstraint *data = (bFollowTrackConstraint *) con->data; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 9a54e091524..99b163ce45b 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -349,7 +349,7 @@ void BKE_object_free(Object *ob) free_controllers(&ob->controllers); free_actuators(&ob->actuators); - free_constraints(&ob->constraints); + BKE_free_constraints(&ob->constraints); free_partdeflect(ob->pd); @@ -434,7 +434,7 @@ void BKE_object_unlink(Object *ob) bPoseChannel *pchan; for (pchan = obt->pose->chanbase.first; pchan; pchan = pchan->next) { for (con = pchan->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -465,7 +465,7 @@ void BKE_object_unlink(Object *ob) sca_remove_ob_poin(obt, ob); for (con = obt->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -1129,7 +1129,7 @@ static void copy_object_pose(Object *obn, Object *ob) } for (con = chan->constraints.first; con; con = con->next) { - bConstraintTypeInfo *cti = constraint_get_typeinfo(con); + bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -1229,7 +1229,7 @@ static Object *object_copy_do(Object *ob, int copy_caches) BKE_pose_rebuild(obn, obn->data); } defgroup_copy_list(&obn->defbase, &ob->defbase); - copy_constraints(&obn->constraints, &ob->constraints, TRUE); + BKE_copy_constraints(&obn->constraints, &ob->constraints, TRUE); obn->mode = 0; obn->sculpt = NULL; @@ -2113,9 +2113,9 @@ void BKE_object_where_is_calc_time(Scene *scene, Object *ob, float ctime) if (ob->constraints.first && !(ob->transflag & OB_NO_CONSTRAINTS)) { bConstraintOb *cob; - cob = constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT); - solve_constraints(&ob->constraints, cob, ctime); - constraints_clear_evalob(cob); + cob = BKE_constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT); + BKE_solve_constraints(&ob->constraints, cob, ctime); + BKE_constraints_clear_evalob(cob); } /* set negative scale flag in object */ @@ -2184,9 +2184,9 @@ void BKE_object_where_is_calc_simul(Scene *scene, Object *ob) if (ob->constraints.first) { bConstraintOb *cob; - cob = constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT); - solve_constraints(&ob->constraints, cob, (float)scene->r.cfra); - constraints_clear_evalob(cob); + cob = BKE_constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT); + BKE_solve_constraints(&ob->constraints, cob, (float)scene->r.cfra); + BKE_constraints_clear_evalob(cob); } } @@ -3134,11 +3134,11 @@ void BKE_object_relink(Object *ob) if (ob->id.lib) return; - relink_constraints(&ob->constraints); + BKE_relink_constraints(&ob->constraints); if (ob->pose) { bPoseChannel *chan; for (chan = ob->pose->chanbase.first; chan; chan = chan->next) { - relink_constraints(&chan->constraints); + BKE_relink_constraints(&chan->constraints); } } modifiers_foreachIDLink(ob, copy_object__forwardModifierLinks, NULL); |