[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21839] branches/blender2.5/blender/source /blender: 2.5 - Animation Tweaks (KeyingSets/NLA)
Joshua Leung
aligorith at gmail.com
Fri Jul 24 08:51:33 CEST 2009
Revision: 21839
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21839
Author: aligorith
Date: 2009-07-24 08:51:33 +0200 (Fri, 24 Jul 2009)
Log Message:
-----------
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).
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/animation/keyframing.c
branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h
branches/blender2.5/blender/source/blender/editors/space_nla/nla_edit.c
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
Modified: branches/blender2.5/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/keyframing.c 2009-07-24 06:08:03 UTC (rev 21838)
+++ branches/blender2.5/blender/source/blender/editors/animation/keyframing.c 2009-07-24 06:51:33 UTC (rev 21839)
@@ -1081,9 +1081,15 @@
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 @@
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 */
Modified: branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h 2009-07-24 06:08:03 UTC (rev 21838)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h 2009-07-24 06:51:33 UTC (rev 21839)
@@ -343,6 +343,12 @@
/* 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 */
Modified: branches/blender2.5/blender/source/blender/editors/space_nla/nla_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_nla/nla_edit.c 2009-07-24 06:08:03 UTC (rev 21838)
+++ branches/blender2.5/blender/source/blender/editors/space_nla/nla_edit.c 2009-07-24 06:51:33 UTC (rev 21839)
@@ -78,6 +78,28 @@
#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 */
/* ******************** Tweak-Mode Operators ***************************** */
@@ -315,6 +337,9 @@
/* 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 @@
/* 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 @@
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 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* 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);
Modified: branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c 2009-07-24 06:08:03 UTC (rev 21838)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c 2009-07-24 06:51:33 UTC (rev 21839)
@@ -4779,7 +4779,6 @@
/* 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 @@
{
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) {
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c 2009-07-24 06:08:03 UTC (rev 21838)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c 2009-07-24 06:51:33 UTC (rev 21839)
@@ -67,7 +67,6 @@
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 @@
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;
More information about the Bf-blender-cvs
mailing list