* 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).
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
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 */
/* 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 */
#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 */
/* 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);
/* 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);
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);
/* 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);
/* 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);
/* 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);
/* 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);
/* 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);
/* 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);
/* 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;
{
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);
+ /* 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;
- 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);
- }
+ /* make sure strips are in order again */
+ BKE_nlatrack_sort_strips(nlt);
- /* 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) {
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;
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;