diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-08-18 09:26:40 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-08-18 09:26:40 +0400 |
commit | aa8eda372ca04a1ba1b4a72c3936f146e65b79c0 (patch) | |
tree | 6c9b47d35ab2d5c64868c7dedab1c80f4fd887d0 /source/blender/editors | |
parent | cc1a89faee7a88b1320cb28c0350c76302fe0f05 (diff) |
Selecting nodes (and making one active) sets active F-Curve too now
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 3e0380929f8..c4160a61868 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -246,7 +246,7 @@ static void animchan_sync_fcurve(bAnimContext *ac, bAnimListElem *ale, FCurve ** seq = BKE_sequwnce_get_by_name(ed->seqbasep, seq_name, FALSE); if (seq_name) MEM_freeN(seq_name); - /* can only add this F-Curve if it is selected */ + /* update selection status */ if (seq) { if (seq->flag & SELECT) fcu->flag |= FCURVE_SELECTED; @@ -268,12 +268,31 @@ static void animchan_sync_fcurve(bAnimContext *ac, bAnimListElem *ale, FCurve ** node = nodeFindNodebyName(ntree, node_name); if (node_name) MEM_freeN(node_name); - /* can only add this F-Curve if it is selected */ + /* update selection/active status */ if (node) { + /* update selection status */ if (node->flag & NODE_SELECT) fcu->flag |= FCURVE_SELECTED; else fcu->flag &= ~FCURVE_SELECTED; + + /* update active status */ + /* XXX: this may interfere with setting bones as active if both exist at once; + * then again, if that's the case, production setups aren't likely to be animating + * nodes while working with bones? + */ + if (node->flag & NODE_ACTIVE) { + if (*active_fcurve == NULL) { + fcu->flag |= FCURVE_ACTIVE; + *active_fcurve = fcu; + } + else { + fcu->flag &= ~FCURVE_ACTIVE; + } + } + else { + fcu->flag &= ~FCURVE_ACTIVE; + } } } } |