[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49980] trunk/blender/source/blender/ editors/animation/anim_deps.c: Bone color groups now get synced too when syncing bone <-> animdata stuff

Joshua Leung aligorith at gmail.com
Sat Aug 18 07:43:14 CEST 2012


Revision: 49980
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49980
Author:   aligorith
Date:     2012-08-18 05:43:06 +0000 (Sat, 18 Aug 2012)
Log Message:
-----------
Bone color groups now get synced too when syncing bone <-> animdata stuff

For now, the notifiers on bone group color setting won't trigger the necessary
color syncing, so it will be necessary to select another bone/object before the
view responds properly.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_deps.c

Modified: trunk/blender/source/blender/editors/animation/anim_deps.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_deps.c	2012-08-18 05:26:40 UTC (rev 49979)
+++ trunk/blender/source/blender/editors/animation/anim_deps.c	2012-08-18 05:43:06 UTC (rev 49980)
@@ -144,12 +144,13 @@
 		 * NOTE: this feature will only really work if groups by default contain the F-Curves for a single bone
 		 */
 		// TODO: if bone gets renamed, it would be best to be able to rename the group
-		// TODO: sync bone/group colors
 		if (ob->pose) {
 			bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, agrp->name);
 			bArmature *arm = ob->data;
 			
 			if (pchan) {
+				bActionGroup *bgrp;
+				
 				/* if one matches, sync the selection status */
 				if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED))
 					agrp->flag |= AGRP_SELECTED;
@@ -172,6 +173,13 @@
 					/* this can't possibly be active now */
 					agrp->flag &= ~AGRP_ACTIVE;
 				}
+				
+				/* sync group colors */
+				bgrp = (bActionGroup *)BLI_findlink(&ob->pose->agroups, (pchan->agrp_index - 1));
+				if (bgrp) {
+					agrp->customCol = bgrp->customCol;
+					action_group_colors_sync(agrp, bgrp);
+				}
 			}
 		}
 	}




More information about the Bf-blender-cvs mailing list