diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-08-18 09:43:06 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-08-18 09:43:06 +0400 |
commit | 016b0d1e3f9557113690ad1b12ed43d725770d28 (patch) | |
tree | d63d59e17e8d0ac5122f26a94e3d057b537bbf9d /source/blender/editors/animation/anim_deps.c | |
parent | aa8eda372ca04a1ba1b4a72c3936f146e65b79c0 (diff) |
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.
Diffstat (limited to 'source/blender/editors/animation/anim_deps.c')
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index c4160a61868..619c62724ed 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -144,12 +144,13 @@ static void animchan_sync_group(bAnimContext *ac, bAnimListElem *ale, bActionGro * 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 @@ static void animchan_sync_group(bAnimContext *ac, bAnimListElem *ale, bActionGro /* 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); + } } } } |