Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-03-22 12:54:13 +0300
committerJoshua Leung <aligorith@gmail.com>2009-03-22 12:54:13 +0300
commit7c86a10aba535dd68c79244487760e5b87c2eed8 (patch)
tree3bef26aadd0cea04aa8ec3b83f373b38a763a0d1 /source/blender/editors
parentb995f4329a65278a229a32674ed2083ee04310a3 (diff)
F-Curve Modifiers - Envelope: Bugfixes
* Envelope modifier now works correctly. Previously, the mapping was being done in the wrong order. * Extra controls for modifiers now only draw when the F-Curve is the active one, so the view will be less cluttered in other cases.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index dad4a771cd9..46d3f102b89 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -95,7 +95,7 @@ extern void gl_round_box(int mode, float minx, float miny, float maxx, float max
/* Envelope -------------- */
-// TODO: draw a shaded poly showing the region of influence too?
+// TODO: draw a shaded poly showing the region of influence too!!!
static void draw_fcurve_modifier_controls_envelope (FCurve *fcu, FModifier *fcm, View2D *v2d)
{
FMod_Envelope *env= (FMod_Envelope *)fcm->data;
@@ -104,7 +104,6 @@ static void draw_fcurve_modifier_controls_envelope (FCurve *fcu, FModifier *fcm,
int i;
/* draw two black lines showing the standard reference levels */
- // TODO: how to make these more distinctive?
glColor3f(0.0f, 0.0f, 0.0f);
setlinestyle(5);
@@ -117,7 +116,6 @@ static void draw_fcurve_modifier_controls_envelope (FCurve *fcu, FModifier *fcm,
glEnd(); // GL_LINES
setlinestyle(0);
-
/* set size of vertices (non-adjustable for now) */
glPointSize(2.0f);
@@ -821,11 +819,14 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri
/* 2) draw handles and vertices as appropriate based on active */
if ( ((fcm) && (fcm->type != FMODIFIER_TYPE_CYCLES)) || (fcu->modifiers.first && !fcm) ) {
- /* draw controls for the 'active' modifier (if applicable)
+ /* draw controls for the 'active' modifier
+ * - there may not be an 'active' modifier on this curve to draw
+ * - this curve may not be active, so modifier controls shouldn't get drawn either
+ *
* NOTE: cycles modifier is currently an exception where the original points can still be edited, so
* this branch is skipped... (TODO: set up the generic system for this so that we don't need special hacks like this)
*/
- if (fcm) {
+ if ((fcu->flag & FCURVE_ACTIVE) && (fcm)) {
switch (fcm->type) {
case FMODIFIER_TYPE_ENVELOPE: /* envelope */
draw_fcurve_modifier_controls_envelope(fcu, fcm, &ar->v2d);