2.5 - Animation Tweaks (KeyingSets/NLA)
* Insert Keyframes menu now only displays the 'active keyingset' entry when there are some KeyingSets. * Moved the validation code for auto-blending/extend modes to NLA editor code, and included calls for this in many of the editing tools for NLA strips. * Removed obsolete 'ID_IPO' entries from RNA-ID wrapping (these were commented out anyway).
This commit is contained in:
@@ -1081,9 +1081,15 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
|
||||
pup= uiPupMenuBegin(C, "Insert Keyframe", 0);
|
||||
layout= uiPupMenuLayout(pup);
|
||||
|
||||
/* active Keying Set */
|
||||
uiItemIntO(layout, "Active Keying Set", 0, "ANIM_OT_insert_keyframe_menu", "type", i++);
|
||||
uiItemS(layout);
|
||||
/* active Keying Set
|
||||
* - only include entry if it exists
|
||||
*/
|
||||
if (scene->active_keyingset) {
|
||||
uiItemIntO(layout, "Active Keying Set", 0, "ANIM_OT_insert_keyframe_menu", "type", i++);
|
||||
uiItemS(layout);
|
||||
}
|
||||
else
|
||||
i++;
|
||||
|
||||
/* user-defined Keying Sets
|
||||
* - these are listed in the order in which they were defined for the active scene
|
||||
@@ -1112,7 +1118,7 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
|
||||
void ANIM_OT_insert_keyframe_menu (wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Insert Keyframe";
|
||||
ot->name= "Insert Keyframe Menu";
|
||||
ot->idname= "ANIM_OT_insert_keyframe_menu";
|
||||
|
||||
/* callbacks */
|
||||
|
||||
@@ -343,6 +343,12 @@ void ANIM_nla_mapping_draw(struct gla2DDrawInfo *di, struct AnimData *adt, short
|
||||
/* Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve */
|
||||
void ANIM_nla_mapping_apply_fcurve(struct AnimData *adt, struct FCurve *fcu, short restore, short only_keys);
|
||||
|
||||
/* ..... */
|
||||
|
||||
/* Perform auto-blending/extend refreshes after some operations */
|
||||
// NOTE: defined in space_nla/nla_edit.c, not in animation/
|
||||
void ED_nla_postop_refresh(bAnimContext *ac);
|
||||
|
||||
/* ------------- Utility macros ----------------------- */
|
||||
|
||||
/* checks if the given BezTriple is selected */
|
||||
|
||||
@@ -77,6 +77,28 @@
|
||||
#include "nla_intern.h" // own include
|
||||
#include "nla_private.h" // FIXME... maybe this shouldn't be included?
|
||||
|
||||
/* *********************************************** */
|
||||
/* Utilities exported to other places... */
|
||||
|
||||
/* Perform validation for blending/extend settings */
|
||||
void ED_nla_postop_refresh (bAnimContext *ac)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
bAnimListElem *ale;
|
||||
short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA | ANIMFILTER_FOREDIT);
|
||||
|
||||
/* get blocks to work on */
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
/* performing auto-blending, extend-mode validation, etc. */
|
||||
BKE_nla_validate_state(ale->data);
|
||||
}
|
||||
|
||||
/* free temp memory */
|
||||
BLI_freelistN(&anim_data);
|
||||
}
|
||||
|
||||
/* *********************************************** */
|
||||
/* 'Special' Editing */
|
||||
|
||||
@@ -315,6 +337,9 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
|
||||
/* free temp data */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -427,6 +452,9 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
|
||||
|
||||
/* was anything added? */
|
||||
if (done) {
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -633,6 +661,9 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op)
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
if (done) {
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -718,6 +749,9 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op)
|
||||
/* free temp data */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -860,6 +894,9 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op)
|
||||
/* free temp data */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -993,6 +1030,9 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *op)
|
||||
/* free temp data */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -1064,6 +1104,9 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *op)
|
||||
/* free temp data */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -1222,6 +1265,9 @@ static int nlaedit_clear_scale_exec (bContext *C, wmOperator *op)
|
||||
/* free temp data */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
@@ -1360,6 +1406,9 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op)
|
||||
/* free temp data */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* refresh auto strip properties */
|
||||
ED_nla_postop_refresh(&ac);
|
||||
|
||||
/* set notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
|
||||
|
||||
|
||||
@@ -4779,7 +4779,6 @@ void special_aftertrans_update(TransInfo *t)
|
||||
/* get channels to work on */
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||
|
||||
/* these should all be ipo-blocks */
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
AnimData *adt= ANIM_nla_mapping_get(&ac, ale);
|
||||
FCurve *fcu= (FCurve *)ale->key_data;
|
||||
@@ -4826,43 +4825,26 @@ void special_aftertrans_update(TransInfo *t)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
bAnimListElem *ale;
|
||||
short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NLATRACKS);
|
||||
|
||||
/* firstly, make the strips normal again */
|
||||
{
|
||||
short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NLATRACKS);
|
||||
/* get channels to work on */
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
NlaTrack *nlt= (NlaTrack *)ale->data;
|
||||
|
||||
/* get channels to work on */
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||
/* make sure strips are in order again */
|
||||
BKE_nlatrack_sort_strips(nlt);
|
||||
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
NlaTrack *nlt= (NlaTrack *)ale->data;
|
||||
|
||||
/* make sure strips are in order again */
|
||||
BKE_nlatrack_sort_strips(nlt);
|
||||
|
||||
/* remove the temp metas */
|
||||
BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
|
||||
}
|
||||
|
||||
/* free temp memory */
|
||||
BLI_freelistN(&anim_data);
|
||||
/* remove the temp metas */
|
||||
BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
|
||||
}
|
||||
|
||||
/* free temp memory */
|
||||
BLI_freelistN(&anim_data);
|
||||
|
||||
/* perform after-transfrom validation */
|
||||
{
|
||||
short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA | ANIMFILTER_FOREDIT);
|
||||
|
||||
/* get blocks to work on */
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
/* performing auto-blending, extend-mode validation, etc. */
|
||||
BKE_nla_validate_state(ale->data);
|
||||
}
|
||||
|
||||
/* free temp memory */
|
||||
BLI_freelistN(&anim_data);
|
||||
}
|
||||
ED_nla_postop_refresh(&ac);
|
||||
}
|
||||
}
|
||||
else if (t->obedit) {
|
||||
|
||||
@@ -67,7 +67,6 @@ short RNA_type_to_ID_code(StructRNA *type)
|
||||
if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
|
||||
if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
|
||||
if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
|
||||
//if(RNA_struct_is_a(type, &RNA_Ipo)) return case ID_IP;
|
||||
if(RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
|
||||
if(RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA;
|
||||
if(RNA_struct_is_a(type, &RNA_Library)) return ID_LI;
|
||||
@@ -100,7 +99,6 @@ StructRNA *ID_code_to_RNA_type(short idcode)
|
||||
case ID_CU: return &RNA_Curve;
|
||||
case ID_GR: return &RNA_Group;
|
||||
case ID_IM: return &RNA_Image;
|
||||
//case ID_IP: return &RNA_Ipo;
|
||||
case ID_KE: return &RNA_Key;
|
||||
case ID_LA: return &RNA_Lamp;
|
||||
case ID_LI: return &RNA_Library;
|
||||
|
||||
Reference in New Issue
Block a user