[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60941] trunk/blender/source/blender/ blenkernel: code cleanup: merge doxygen comments into C source.

Campbell Barton ideasman42 at gmail.com
Sat Oct 26 05:56:33 CEST 2013


Revision: 60941
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60941
Author:   campbellbarton
Date:     2013-10-26 03:56:32 +0000 (Sat, 26 Oct 2013)
Log Message:
-----------
code cleanup: merge doxygen comments into C source.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_action.h
    trunk/blender/source/blender/blenkernel/intern/action.c

Modified: trunk/blender/source/blender/blenkernel/BKE_action.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_action.h	2013-10-26 02:14:07 UTC (rev 60940)
+++ trunk/blender/source/blender/blenkernel/BKE_action.h	2013-10-26 03:56:32 UTC (rev 60941)
@@ -132,60 +132,19 @@
 void action_groups_clear_tempflags(struct bAction *act);
 
 /* Pose API ----------------- */	
-	
-/**
- * Deallocates a pose channel.
- * Does not free the pose channel itself.
- */
-void BKE_pose_channel_free(struct bPoseChannel *pchan);
 
-/**
- * Removes and deallocates all channels from a pose.
- * Does not free the pose itself.
- */
-void BKE_pose_channels_free(struct bPose *pose);
+void                 BKE_pose_channel_free(struct bPoseChannel *pchan);
 
-/**
- * Removes the hash for quick lookup of channels, must
- * be done when adding/removing channels.
- */
-void BKE_pose_channels_hash_make(struct bPose *pose);
-void BKE_pose_channels_hash_free(struct bPose *pose);
+void                 BKE_pose_channels_free(struct bPose *pose);
 
-/** 
- * Removes and deallocates all data from a pose, and also frees the pose.
- */
-void BKE_pose_free(struct bPose *pose);
+void                 BKE_pose_channels_hash_make(struct bPose *pose);
+void                 BKE_pose_channels_hash_free(struct bPose *pose);
 
-/**
- * Allocate a new pose on the heap, and copy the src pose and it's channels
- * into the new pose. *dst is set to the newly allocated structure, and assumed to be NULL.
- */ 
-void BKE_pose_copy_data(struct bPose **dst, struct bPose *src, int copyconstraints);
-
-/**
- * Copy the internal members of each pose channel including constraints
- * and ID-Props, used when duplicating bones in editmode.
- */
-void BKE_pose_channel_copy_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
-
-/**
- * Return a pointer to the pose channel of the given name
- * from this pose.
- */
+void                 BKE_pose_free(struct bPose *pose);
+void                 BKE_pose_copy_data(struct bPose **dst, struct bPose *src, const bool copy_constraints);
+void                 BKE_pose_channel_copy_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
 struct bPoseChannel *BKE_pose_channel_find_name(const struct bPose *pose, const char *name);
-
-/**
- * Return a pointer to the active pose channel from this Object.
- * (Note: Object, not bPose is used here, as we need layer info from Armature)
- */
 struct bPoseChannel *BKE_pose_channel_active(struct Object *ob);
-
-/** 
- * Looks to see if the channel with the given name
- * already exists in this pose - if not a new one is
- * allocated and initialized.
- */
 struct bPoseChannel *BKE_pose_channel_verify(struct bPose *pose, const char *name);
 
 #ifndef NDEBUG

Modified: trunk/blender/source/blender/blenkernel/intern/action.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/action.c	2013-10-26 02:14:07 UTC (rev 60940)
+++ trunk/blender/source/blender/blenkernel/intern/action.c	2013-10-26 03:56:32 UTC (rev 60941)
@@ -440,6 +440,10 @@
 
 /* *************** Pose channels *************** */
 
+/**
+ * Return a pointer to the pose channel of the given name
+ * from this pose.
+ */
 bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name)
 {
 	if (ELEM(NULL, pose, name) || (name[0] == '\0'))
@@ -451,8 +455,14 @@
 	return BLI_findstring(&((bPose *)pose)->chanbase, name, offsetof(bPoseChannel, name));
 }
 
-/* Use with care, not on Armature poses but for temporal ones */
-/* (currently used for action constraints and in rebuild_pose) */
+/**
+ * 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).
+ */
 bPoseChannel *BKE_pose_channel_verify(bPose *pose, const char *name)
 {
 	bPoseChannel *chan;
@@ -505,7 +515,12 @@
 }
 
 #endif
-/* Find the active posechannel for an object (we can't just use pose, as layer info is in armature) */
+
+/**
+ * Find the active posechannel for an object (we can't just use pose, as layer info is in armature)
+ *
+ * \note: Object, not bPose is used here, as we need layer info from Armature)
+ */
 bPoseChannel *BKE_pose_channel_active(Object *ob)
 {
 	bArmature *arm = (ob) ? ob->data : NULL;
@@ -536,8 +551,14 @@
 	}
 	return NULL;
 }
-/* dst should be freed already, makes entire duplicate */
-void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon)
+
+/**
+ * Allocate a new pose on the heap, and copy the src pose and it's 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(bPose **dst, bPose *src, const bool copy_constraints)
 {
 	bPose *outPose;
 	bPoseChannel *pchan;
@@ -558,8 +579,7 @@
 	outPose->avs = src->avs;
 	
 	for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) {
-		/* TODO: rename this argument... */
-		if (copycon) {
+		if (copy_constraints) {
 			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... */
@@ -571,8 +591,9 @@
 	}
 
 	/* for now, duplicate Bone Groups too when doing this */
-	if (copycon)
+	if (copy_constraints) {
 		BLI_duplicatelist(&outPose->agroups, &src->agroups);
+	}
 	
 	*dst = outPose;
 }
@@ -641,7 +662,10 @@
 	return pose_channel_in_IK_chain(ob, pchan, 0);
 }
 
-
+/**
+ * Removes the hash for quick lookup of channels, must
+ * be done when adding/removing channels.
+ */
 void BKE_pose_channels_hash_make(bPose *pose) 
 {
 	if (!pose->chanhash) {
@@ -661,6 +685,10 @@
 	}
 }
 
+/**
+ * Deallocates a pose channel.
+ * Does not free the pose channel itself.
+ */
 void BKE_pose_channel_free(bPoseChannel *pchan)
 {
 	if (pchan->custom) {
@@ -681,6 +709,10 @@
 	}
 }
 
+/**
+ * Removes and deallocates all channels from a pose.
+ * Does not free the pose itself.
+ */
 void BKE_pose_channels_free(bPose *pose) 
 {
 	bPoseChannel *pchan;
@@ -695,6 +727,9 @@
 	BKE_pose_channels_hash_free(pose);
 }
 
+/**
+ * Removes and deallocates all data from a pose, and also frees the pose.
+ */
 void BKE_pose_free(bPose *pose)
 {
 	if (pose) {
@@ -739,9 +774,13 @@
 	}
 }
 
-/* makes copies of internal data, unlike copy_pose_channel_data which only
- * copies the pose state.
- * hint: use when copying bones in editmode (on returned value from BKE_pose_channel_verify) */
+/**
+ * Copy the internal members of each pose channel including constraints
+ * and ID-Props, used when duplicating bones in editmode.
+ * (unlike copy_pose_channel_data which only).
+ *
+ * \note use when copying bones in editmode (on returned value from #BKE_pose_channel_verify)
+ */
 void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
 {
 	/* copy transform locks */




More information about the Bf-blender-cvs mailing list