[Bf-blender-cvs] [3216e4b] master: API Cleanup: Use BKE_constraint prefix for constraint api

Campbell Barton noreply at git.blender.org
Fri Apr 11 03:49:22 CEST 2014


Commit: 3216e4b202195ed88455d1b43b348a2cf8f40d77
Author: Campbell Barton
Date:   Fri Apr 11 11:47:07 2014 +1000
https://developer.blender.org/rB3216e4b202195ed88455d1b43b348a2cf8f40d77

API Cleanup: Use BKE_constraint prefix for constraint api

===================================================================

M	source/blender/blenkernel/BKE_constraint.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/constraint.c
M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/collada/AnimationExporter.cpp
M	source/blender/collada/DocumentImporter.cpp
M	source/blender/collada/SceneExporter.cpp
M	source/blender/editors/armature/armature_add.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/armature/armature_naming.c
M	source/blender/editors/armature/armature_relations.c
M	source/blender/editors/armature/editarmature_retarget.c
M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_select.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/object/object_constraint.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/ikplugin/intern/iksolver_plugin.c
M	source/blender/ikplugin/intern/itasc_plugin.cpp
M	source/blender/makesrna/intern/rna_constraint.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_pose.c
M	source/gameengine/Converter/BL_ArmatureObject.cpp

===================================================================

diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 2aee502..87da74d 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -108,50 +108,44 @@ typedef struct bConstraintTypeInfo {
 } bConstraintTypeInfo;
 
 /* Function Prototypes for bConstraintTypeInfo's */
-bConstraintTypeInfo *BKE_constraint_get_typeinfo(struct bConstraint *con);
-bConstraintTypeInfo *BKE_get_constraint_typeinfo(int type);
+bConstraintTypeInfo *BKE_constraint_typeinfo_get(struct bConstraint *con);
+bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type);
 
-/* ---------------------------------------------------------------------------- */
-/* Useful macros for testing various common flag combinations */
-
-/* Constraint Target Macros */
-#define VALID_CONS_TARGET(ct) ((ct) && (ct->tar))
 
 /* ---------------------------------------------------------------------------- */
 
 /* Constraint function prototypes */
-void BKE_unique_constraint_name(struct bConstraint *con, struct ListBase *list);
+void BKE_constraint_unique_name(struct bConstraint *con, struct ListBase *list);
 
-void BKE_free_constraints(struct ListBase *list);
-void BKE_copy_constraints(struct ListBase *dst, const struct ListBase *src, bool 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);
+void BKE_constraints_free(struct ListBase *list);
+void BKE_constraints_copy(struct ListBase *dst, const struct ListBase *src, bool do_extern);
+void BKE_constraints_relink(struct ListBase *list);
+void BKE_constraints_id_loop(struct ListBase *list, ConstraintIDFunc func, void *userdata);
+void BKE_constraint_free_data(struct bConstraint *con);
 
 /* Constraint API function prototypes */
-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_constraints_active_get(struct ListBase *list);
+void                BKE_constraints_active_set(ListBase *list, struct bConstraint *con);
+struct bConstraint *BKE_constraints_find_name(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);
+struct bConstraint *BKE_constraint_add_for_object(struct Object *ob, const char *name, short type);
+struct bConstraint *BKE_constraint_add_for_pose(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type);
 
-bool BKE_remove_constraint(ListBase *list, struct bConstraint *con);
-void BKE_remove_constraints_type(ListBase *list, short type, bool last_only);
+bool                BKE_constraint_remove(ListBase *list, struct bConstraint *con);
 
 /* Constraints + Proxies function prototypes */
-void BKE_extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src);
-bool BKE_proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan);
+void BKE_constraints_proxylocal_extract(struct ListBase *dst, struct ListBase *src);
+bool BKE_constraints_proxylocked_owner(struct Object *ob, struct bPoseChannel *pchan);
 
 /* Constraint Evaluation function prototypes */
 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                  BKE_constraints_clear_evalob(struct bConstraintOb *cob);
 
 void BKE_constraint_mat_convertspace(struct Object *ob, struct bPoseChannel *pchan, float mat[4][4], short from, short to);
 
-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);
+void BKE_constraint_target_matrix_get(struct Scene *scene, struct bConstraint *con, int n, short ownertype, void *ownerdata, float mat[4][4], float ctime);
+void BKE_constraint_targets_for_solving_get(struct bConstraint *con, struct bConstraintOb *ob, struct ListBase *targets, float ctime);
+void BKE_constraints_solve(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 d5efa09..e0bbe69 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -604,7 +604,7 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, const bool copy_constraints)
 	
 	for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) {
 		if (copy_constraints) {
-			BKE_copy_constraints(&listb, &pchan->constraints, true);  // BKE_copy_constraints NULLs listb
+			BKE_constraints_copy(&listb, &pchan->constraints, true);  // BKE_constraints_copy NULLs listb
 			pchan->constraints = listb;
 			pchan->mpath = NULL; /* motion paths should not get copied yet... */
 		}
@@ -727,7 +727,7 @@ void BKE_pose_channel_free_ex(bPoseChannel *pchan, bool do_id_user)
 		pchan->mpath = NULL;
 	}
 
-	BKE_free_constraints(&pchan->constraints);
+	BKE_constraints_free(&pchan->constraints);
 	
 	if (pchan->prop) {
 		IDP_FreeProperty(pchan->prop);
@@ -843,7 +843,7 @@ void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_f
 	pchan->iklinweight = pchan_from->iklinweight;
 
 	/* constraints */
-	BKE_copy_constraints(&pchan->constraints, &pchan_from->constraints, true);
+	BKE_constraints_copy(&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 845781f..a8f533b 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1659,16 +1659,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 BKE_copy_constraints: when copying constraints, disable 'do_extern' otherwise
+			 * Note for BKE_constraints_copy: 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);
+			BKE_constraints_proxylocal_extract(&proxylocal_constraints, &pchan->constraints);
+			BKE_constraints_copy(&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 = BKE_constraint_get_typeinfo(con);
+				bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
 				ListBase targets = {NULL, NULL};
 				bConstraintTarget *ct;
 				
@@ -2473,7 +2473,7 @@ void BKE_pose_where_is_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float
 			cob = BKE_constraints_make_evalob(scene, ob, pchan, CONSTRAINT_OBTYPE_BONE);
 
 			/* Solve PoseChannel's Constraints */
-			BKE_solve_constraints(&pchan->constraints, cob, ctime); /* ctime doesnt alter objects */
+			BKE_constraints_solve(&pchan->constraints, cob, ctime); /* ctime doesnt alter objects */
 
 			/* cleanup after Constraint Solving
 			 * - applies matrix back to pchan, and frees temporary struct used
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 694474d..ccc576e 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -89,6 +89,12 @@
 #  include "BPY_extern.h"
 #endif
 
+/* ---------------------------------------------------------------------------- */
+/* Useful macros for testing various common flag combinations */
+
+/* Constraint Target Macros */
+#define VALID_CONS_TARGET(ct) ((ct) && (ct->tar))
+
 /* Workaround for cyclic depenndnecy with curves.
  * In such case curve_cache might not be ready yet,
  */
@@ -103,7 +109,7 @@
 /* -------------- Naming -------------- */
 
 /* Find the first available, non-duplicate name for a given constraint */
-void BKE_unique_constraint_name(bConstraint *con, ListBase *list)
+void BKE_constraint_unique_name(bConstraint *con, ListBase *list)
 {
 	BLI_uniquename(list, con, DATA_("Const"), '.', offsetof(bConstraint, name), sizeof(con->name));
 }
@@ -4235,7 +4241,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 *BKE_get_constraint_typeinfo(int type)
+bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type)
 {
 	/* initialize the type-info list? */
 	if (CTI_INIT) {
@@ -4260,11 +4266,11 @@ bConstraintTypeInfo *BKE_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 *BKE_constraint_get_typeinfo(bConstraint *con)
+bConstraintTypeInfo *BKE_constraint_typeinfo_get(bConstraint *con)
 {
 	/* only return typeinfo for valid constraints */
 	if (con)
-		return BKE_get_constraint_typeinfo(con->type);
+		return BKE_constraint_typeinfo_from_type(con->type);
 	else
 		return NULL;
 }
@@ -4276,7 +4282,7 @@ bConstraintTypeInfo *BKE_constraint_get_typeinfo(bConstraint *con)
  
 /* ---------- Data Management ------- */
 
-/* helper function for BKE_free_constraint_data() - unlinks re

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list