diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-12-20 08:09:55 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-12-20 08:09:55 +0300 |
commit | 170c464920bdbbd4e7db3ff2b84c8550740eb2cc (patch) | |
tree | f3868419f72d2dc824a1ceda154e0f3ba96747c7 /source | |
parent | be323efa3525031bc7b2f255543f4d57e2b5f9cc (diff) |
Animation Editor Code Cleanups:
Removing some unused functions that have become redundant in recent times.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 58 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ipo_utils.c | 31 | ||||
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 7 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 2 |
4 files changed, 4 insertions, 94 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 3afe2bfad57..60242d3e837 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -315,64 +315,6 @@ void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, s /* apply to F-Curve */ ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, map_cb, NULL); -} - -/* *************************************************** */ -/* ANIMATION EDITOR UI-WIDGETS */ - -/* ui button event */ -#define B_REDR 1 - -/* standard header buttons for Animation Editors */ -short ANIM_headerUI_standard_buttons (const bContext *C, bDopeSheet *ads, uiBlock *block, short xco, short yco) -{ - Main *mainptr= CTX_data_main(C); - ScrArea *sa= CTX_wm_area(C); - short nlaActive= ((sa) && (sa->spacetype==SPACE_NLA)); - - /* check if the DopeSheet data exists, just in case... */ - if (ads) { - /* more 'generic' filtering options */ - if (nlaActive) uiBlockBeginAlign(block); - uiDefIconButBitI(block, TOG, ADS_FILTER_ONLYSEL, B_REDR, ICON_RESTRICT_SELECT_OFF, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Only display selected Objects"); - if (nlaActive) uiDefIconButBitI(block, TOGN, ADS_FILTER_NLA_NOACT, B_REDR, ICON_ACTION, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Include AnimData blocks with no NLA Data"); - if (nlaActive) uiBlockEndAlign(block); - xco += 5; - - /* datatype based - only available datatypes are shown */ - uiBlockBeginAlign(block); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSCE, B_REDR, ICON_SCENE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Scene Animation"); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOWOR, B_REDR, ICON_WORLD_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display World Animation"); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NONTREE, B_REDR, ICON_NODETREE, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Node Tree Animation"); - if (mainptr && mainptr->key.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSHAPEKEYS, B_REDR, ICON_SHAPEKEY_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display ShapeKeys"); - if (mainptr && mainptr->mat.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMAT, B_REDR, ICON_MATERIAL_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Material Data"); - if (mainptr && mainptr->lamp.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Lamp Data"); - if (mainptr && mainptr->camera.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Camera Data"); - if (mainptr && mainptr->curve.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Curve Data"); - if (mainptr && mainptr->mball.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMBA, B_REDR, ICON_META_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display MetaBall Data"); - if (mainptr && mainptr->armature.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOARM, B_REDR, ICON_ARMATURE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Armature Data"); - if (mainptr && mainptr->particle.first) - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(ads->filterflag), 0, 0, 0, 0, "Display Particle Data"); - uiBlockEndAlign(block); - xco += 30; - } - else { - // XXX this case shouldn't happen at all... for now, just pad out same amount of space - printf("ERROR: dopesheet data not available when drawing Animation Editor header \n"); - xco += 11*XIC + 30; - } - - // TODO: include auto-snapping menu here too... - - /* return the width of the buttons */ - return xco; } /* *************************************************** */ diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 200c4eb3590..9e698d18105 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -181,39 +181,12 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) /* ------------------------------- Color Codes for F-Curve Channels ---------------------------- */ -#if 0 -/* used for FCURVE_COLOR_AUTO_RAINBOW */ -// XXX this still doesn't work too great when there are more than 32 curves (which happens most of the time) -void ipo_rainbow (int cur, int tot, float *out) -{ - float dfac, fac, sat; - - dfac= (float)(1.0/( (float)tot+1.0)); - - /* this calculation makes 2 or 4 different cycles of rainbow colors */ - // 2 different cycles - for hue - if(cur< tot/2) fac= (float)(cur*2.0f*dfac); - else fac= (float)((cur-tot/2)*2.0f*dfac +dfac); - - // third cycle with altered hue - if(tot > 32) fac= fac*1.95f; - // clamping for excessive ranges - if(fac>1.0f) fac-= 1.0f; - - // saturation adjustments for more visible range - if(fac>0.5f && fac<0.8f) sat= 0.5f; - else sat= 0.6f; - - hsv_to_rgb(fac, sat, 1.0f, out, out+1, out+2); -} -#endif - /* step between the major distinguishable color bands of the primary colors */ #define HSV_BANDWIDTH 0.3f -/* testbed for FCURVE_COLOR_AUTO_RAINBOW determination methods */ +/* used to determine the colour of F-Curves with FCURVE_COLOR_AUTO_RAINBOW set */ //void fcurve_rainbow (unsigned int cur, unsigned int tot, float *out) -void ipo_rainbow (int cur, int tot, float *out) +void getcolor_fcurve_rainbow (int cur, int tot, float *out) { float hue, val, sat, fac; int grouping; diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 9989589cf23..7f8df38741d 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -424,11 +424,6 @@ void ANIM_draw_cfra(const struct bContext *C, struct View2D *v2d, short flag); /* main call to draw preview range curtains */ void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d); -/* ------------- Preview Range Drawing -------------- */ - -/* standard header buttons for Animation Editors */ -short ANIM_headerUI_standard_buttons(const struct bContext *C, struct bDopeSheet *ads, struct uiBlock *block, short xco, short yco); - /* ************************************************* */ /* F-MODIFIER TOOLS */ @@ -445,7 +440,7 @@ void ANIM_uiTemplate_fmodifier_draw(const struct bContext *C, struct uiLayout *l int getname_anim_fcurve(char *name, struct ID *id, struct FCurve *fcu); /* Automatically determine a color for the nth F-Curve */ -void ipo_rainbow(int cur, int tot, float *out); +void getcolor_fcurve_rainbow(int cur, int tot, float *out); /* ------------- NLA-Mapping ----------------------- */ /* anim_draw.c */ diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 29a9186bc25..c3f241ef300 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -548,7 +548,7 @@ static void graph_refresh(const bContext *C, ScrArea *sa) /* determine color 'automatically' using 'magic function' which uses the given args * of current item index + total items to determine some RGB color */ - ipo_rainbow(i, items, fcu->color); + getcolor_fcurve_rainbow(i, items, fcu->color); } break; } |