diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-06-04 01:11:10 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-06-04 01:11:10 +0400 |
commit | 329b05dcd789bd8421661898697ed060c83b3286 (patch) | |
tree | 3d664826fefbe62078c878baab174e066eb48afa /source/blender/editors/animation | |
parent | eabf741a8d76aa9400a071c37227504378fc6315 (diff) | |
parent | f9856c1c2da8139651eb59ff3bf174065d0f628c (diff) |
Merged changes in the trunk up to revision 47381.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
Diffstat (limited to 'source/blender/editors/animation')
7 files changed, 42 insertions, 25 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index f0f6d7ad91e..a735f159e1b 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -851,7 +851,7 @@ static int acf_group_setting_flag(bAnimContext *ac, int setting, short *neg) return AGRP_MUTED; case ACHANNEL_SETTING_PROTECT: /* protected */ - // *neg= 1; - if we change this to edtiability + // *neg = 1; - if we change this to edtiability return AGRP_PROTECTED; case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */ @@ -939,7 +939,7 @@ static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, short return FCURVE_MUTED; case ACHANNEL_SETTING_PROTECT: /* protected */ - // *neg= 1; - if we change this to edtiability + // *neg = 1; - if we change this to edtiability return FCURVE_PROTECTED; case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */ @@ -2561,7 +2561,7 @@ static int acf_gpl_setting_flag(bAnimContext *UNUSED(ac), int setting, short *ne return GP_LAYER_HIDE; case ACHANNEL_SETTING_PROTECT: /* protected */ - // *neg= 1; - if we change this to edtiability + // *neg = 1; - if we change this to edtiability return GP_LAYER_LOCKED; default: /* unsupported */ @@ -2778,7 +2778,7 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting else if (smode == ACHANNEL_SETFLAG_ADD) (sval) |= (sflag); \ else (sval) &= ~(sflag); \ } \ - } + } (void)0 /* Change value of some setting for a channel * - setting: eAnimChannel_Settings @@ -3139,7 +3139,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi /* find or create new F-Curve */ // XXX is the group name for this ok? bAction *act = verify_adt_action((ID *)key, 1); - FCurve *fcu = verify_fcurve(act, NULL, rna_path, 0, 1); + FCurve *fcu = verify_fcurve(act, NULL, &ptr, rna_path, 0, 1); /* set the special 'replace' flag if on a keyframe */ if (fcurve_frame_has_keyframe(fcu, cfra, 0)) @@ -3175,7 +3175,7 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, bAnimChann /* get the base icon for the setting */ switch (setting) { case ACHANNEL_SETTING_VISIBLE: /* visibility eyes */ - //icon= ((enabled)? ICON_VISIBLE_IPO_ON : ICON_VISIBLE_IPO_OFF); + //icon = ((enabled) ? ICON_VISIBLE_IPO_ON : ICON_VISIBLE_IPO_OFF); icon = ICON_VISIBLE_IPO_OFF; if (ale->type == ANIMTYPE_FCURVE) diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 2bfbde86ed3..bbf89dfa74d 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -500,7 +500,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn break; /* store this level as the 'old' level now */ - // prevLevel= level; // XXX: prevLevel is unused + // prevLevel = level; // XXX: prevLevel is unused } } } @@ -2021,7 +2021,7 @@ static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), wmEve v2d = &ar->v2d; /* figure out which channel user clicked in - * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height + * Note: although channels technically start at (y = ACHANNEL_FIRST), we need to adjust by half a channel's height * so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use * ACHANNEL_HEIGHT_HALF. */ @@ -2335,7 +2335,7 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent * selectmode = SELECT_REPLACE; /* figure out which channel user clicked in - * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height + * Note: although channels technically start at (y = ACHANNEL_FIRST), we need to adjust by half a channel's height * so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use * ACHANNEL_HEIGHT_HALF. */ diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 416df6bccba..4a5966948ae 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -521,7 +521,7 @@ void ANIM_OT_driver_button_add(wmOperatorType *ot) /* callbacks */ ot->exec = add_driver_button_exec; - //op->poll= ??? // TODO: need to have some animatable property to do this + //op->poll = ??? // TODO: need to have some animatable property to do this /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -573,7 +573,7 @@ void ANIM_OT_driver_button_remove(wmOperatorType *ot) /* callbacks */ ot->exec = remove_driver_button_exec; - //op->poll= ??? // TODO: need to have some driver to be able to do this... + //op->poll = ??? // TODO: need to have some driver to be able to do this... /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -620,7 +620,7 @@ void ANIM_OT_copy_driver_button(wmOperatorType *ot) /* callbacks */ ot->exec = copy_driver_button_exec; - //op->poll= ??? // TODO: need to have some driver to be able to do this... + //op->poll = ??? // TODO: need to have some driver to be able to do this... /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -664,7 +664,7 @@ void ANIM_OT_paste_driver_button(wmOperatorType *ot) /* callbacks */ ot->exec = paste_driver_button_exec; - //op->poll= ??? // TODO: need to have some driver to be able to do this... + //op->poll = ??? // TODO: need to have some driver to be able to do this... /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 24cae5d8652..ea875567705 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -79,7 +79,7 @@ #define DRAW_BACKDROP(height) \ { \ uiDefBut(block, ROUNDBOX, B_REDR, "", -3, yco - height, width + 3, height - 1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); \ - } + } (void)0 /* callback to verify modifier data */ static void validate_fmodifier_cb(bContext *UNUSED(C), void *fcm_v, void *UNUSED(arg)) diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index b92d0fb345a..88627a6dabd 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -429,7 +429,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac) if (check(2)) \ ok |= KEYFRAME_OK_H2; \ } \ - } + } (void)0 /* ------------------------ */ @@ -766,7 +766,7 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type) bezt->h1 = HD_FREE; \ if (ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \ bezt->h2 = HD_FREE; \ - } + } (void)0 /* Sets the selected bezier handles to type 'auto' */ static short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt) diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 05c87e98f9b..ac37b6c4141 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -671,7 +671,7 @@ static void paste_animedit_keys_fcurve(FCurve *fcu, tAnimCopybufItem *aci, float BezTriple *bezt; int i; - /* First de-select existing FCuvre */ + /* First de-select existing FCurve's keyframes */ for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { bezt->f2 &= ~SELECT; } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 2a68d32557a..b8601419d51 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -150,9 +150,10 @@ bAction *verify_adt_action(ID *id, short add) /* Get (or add relevant data to be able to do so) F-Curve from the Active Action, * for the given Animation Data block. This assumes that all the destinations are valid. */ -FCurve *verify_fcurve(bAction *act, const char group[], const char rna_path[], const int array_index, short add) +FCurve *verify_fcurve(bAction *act, const char group[], PointerRNA *ptr, + const char rna_path[], const int array_index, short add) { - bActionGroup *grp; + bActionGroup *agrp; FCurve *fcu; /* sanity checks */ @@ -183,14 +184,30 @@ FCurve *verify_fcurve(bAction *act, const char group[], const char rna_path[], c /* if a group name has been provided, try to add or find a group, then add F-Curve to it */ if (group) { /* try to find group */ - grp = BKE_action_group_find_name(act, group); + agrp = BKE_action_group_find_name(act, group); /* no matching groups, so add one */ - if (grp == NULL) - grp = action_groups_add_new(act, group); + if (agrp == NULL) { + agrp = action_groups_add_new(act, group); + + /* sync bone group colors if applicable */ + if (ptr && (ptr->type == &RNA_PoseBone)) { + Object *ob = (Object *)ptr->id.data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; + bPose *pose = ob->pose; + bActionGroup *grp; + + /* find bone group (if present), and use the color from that */ + grp = (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1)); + if (grp) { + agrp->customCol = grp->customCol; + action_group_colors_sync(agrp); + } + } + } /* add F-Curve to group */ - action_groups_add_channel(act, grp, fcu); + action_groups_add_channel(act, agrp, fcu); } else { /* just add F-Curve to end of Action's list */ @@ -939,7 +956,7 @@ short insert_keyframe(ReportList *reports, ID *id, bAction *act, const char grou * - if we're replacing keyframes only, DO NOT create new F-Curves if they do not exist yet * but still try to get the F-Curve if it exists... */ - fcu = verify_fcurve(act, group, rna_path, array_index, (flag & INSERTKEY_REPLACE) == 0); + fcu = verify_fcurve(act, group, &ptr, rna_path, array_index, (flag & INSERTKEY_REPLACE) == 0); /* we may not have a F-Curve when we're replacing only... */ if (fcu) { @@ -1027,7 +1044,7 @@ short delete_keyframe(ReportList *reports, ID *id, bAction *act, const char grou /* will only loop once unless the array index was -1 */ for (; array_index < array_index_max; array_index++) { - FCurve *fcu = verify_fcurve(act, group, rna_path, array_index, 0); + FCurve *fcu = verify_fcurve(act, group, &ptr, rna_path, array_index, 0); short found = -1; int i; |