2.5 - Keyframes can now be marked as 'extremes' in addition to 'breakdowns'
authorJoshua Leung <aligorith@gmail.com>
Mon, 21 Sep 2009 12:29:53 +0000 (12:29 +0000)
committerJoshua Leung <aligorith@gmail.com>
Mon, 21 Sep 2009 12:29:53 +0000 (12:29 +0000)
* Extremes are shown as red/pink diamonds
* I've changed the order of extremes and breakdowns in the code to make for nicer sizing/ordering. This might break a couple of files out there, but it shouldn't be too many.

TODO:
Still on my todo is to make these tags more useful (i.e. less likely to be overwritten by keyframing)

source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/space_action/action_header.c
source/blender/makesdna/DNA_curve_types.h
source/blender/makesrna/intern/rna_curve.c

index dcb37f4d2c4ff829418f5c253a9d706d1920f2d5..e8b25f70b063d5da12b871d38e5072153d169229 100644 (file)
@@ -419,6 +419,13 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel
                        }
                                break;
                                
+                       case BEZT_KEYTYPE_EXTREME: /* redish frames for now */
+                       {
+                               if (sel) glColor3f(95.0f, 0.5f, 0.5f);
+                               else glColor3f(0.91f, 0.70f, 0.80f);
+                       }
+                               break;
+                               
                        case BEZT_KEYTYPE_KEYFRAME: /* traditional yellowish frames for now */
                        default:
                        {
index ac04dc7d1a8ece09b75b602a7d01016dc7046f40..9666cb115b113de7edf89edf4b411ffeeba81359 100644 (file)
@@ -685,6 +685,13 @@ static short set_keytype_breakdown(BeztEditData *bed, BezTriple *bezt)
        return 0;
 }
 
+static short set_keytype_extreme(BeztEditData *bed, BezTriple *bezt) 
+{
+       if (bezt->f2 & SELECT) 
+               BEZKEYTYPE(bezt)= BEZT_KEYTYPE_EXTREME;
+       return 0;
+}
+
 /* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */
 BeztEditFunc ANIM_editkeyframes_keytype(short code)
 {
@@ -692,6 +699,9 @@ BeztEditFunc ANIM_editkeyframes_keytype(short code)
                case BEZT_KEYTYPE_BREAKDOWN: /* breakdown */
                        return set_keytype_breakdown;
                        
+               case BEZT_KEYTYPE_EXTREME: /* extreme keyframe */
+                       return set_keytype_extreme;
+                       
                case BEZT_KEYTYPE_KEYFRAME: /* proper keyframe */       
                default:
                        return set_keytype_keyframe;
index dd02302af9c45c70d7ba1f290c2e1106a54b5b59..f602345baea71e60d7b5d525046992d920cc1372 100644 (file)
@@ -189,6 +189,7 @@ static void act_edit_keytypesmenu(bContext *C, uiLayout *layout, void *arg_unuse
        uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_keyframe_type", "type", BEZT_KEYTYPE_KEYFRAME);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_keyframe_type", "type", BEZT_KEYTYPE_BREAKDOWN);
+       uiItemEnumO(layout, NULL, 0, "ACT_OT_keyframe_type", "type", BEZT_KEYTYPE_EXTREME);
 }
 
 static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused)
index 109a9528de2bb2d3eedbeb0ba0bcda271adc9789..6cfeb646cf2835ec67137558dd301727d680caad 100644 (file)
@@ -310,6 +310,7 @@ typedef enum eBezTriple_Interpolation {
 /* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */
 typedef enum eBezTriple_KeyframeType {
        BEZT_KEYTYPE_KEYFRAME = 0,      /* default - 'proper' Keyframe */
+       BEZT_KEYTYPE_EXTREME,           /* 'extreme' keyframe */
        BEZT_KEYTYPE_BREAKDOWN,         /* 'breakdown' keyframe */
 } eBezTriple_KeyframeType;
 
index 4a5af56d64ae33c180c5788011857dcac811b8f5..3b6bd2255f2fa359fe709bd305c3a58f614a4b4c 100644 (file)
@@ -54,6 +54,7 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = {
 EnumPropertyItem beztriple_keyframe_type_items[] = {
                {BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""},
                {BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""},
+               {BEZT_KEYTYPE_EXTREME, "EXTREME", 0, "Extreme", ""},
                {0, NULL, 0, NULL, NULL}};
 
 #ifdef RNA_RUNTIME