diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-01-14 08:19:04 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-01-14 08:19:04 +0300 |
commit | af4bc28c44f08629ba2bd6afb406edfe19011b63 (patch) | |
tree | e5ac1e943a68a78fbfaa0dde82980ac577a1ca42 /source/blender/editors/space_graph | |
parent | 423fbcfa5c3674fcbd828f0b51de863cb74d6b9d (diff) |
Bugfix [#25617] HOME Key in fcurve editor doesn't center properly
* When euler-rotation F-Curves had a single keyframe only, the view
would be artifically extended to fill up to 57 (this comes from the
radians to degrees calculations) due to a combination of the bounds-
finding function enforcing a minimum separation of 1 unit between
min/max. This has now been moved to the operator-level where it gets
applied AFTER these conversions have taken effect
* F-Curves with samples only (i.e. baked F-Curves) would be ignored by
these operators. Was caused by using a poll calback that only
considered whether there were keyframes. Hopefully this is sufficient;
otherwise a hybrid poll method will be needed.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index fe9296b7227..dc86a56e9f0 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -121,6 +121,10 @@ void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, flo if ((ymax) && (tymax > *ymax)) *ymax= tymax; } + /* ensure that the extents are not too extreme that view implodes...*/ + if ((xmin && xmax) && (fabs(*xmax - *xmin) < 0.1)) *xmax += 0.1; + if ((ymin && ymax) && (fabs(*ymax - *ymin) < 0.1)) *ymax += 0.1; + /* free memory */ BLI_freelistN(&anim_data); } @@ -177,7 +181,7 @@ void GRAPH_OT_previewrange_set (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_previewrange_exec; - ot->poll= graphop_visible_keyframes_poll; + ot->poll= ED_operator_ipo_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -225,7 +229,7 @@ void GRAPH_OT_view_all (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_viewall_exec; - ot->poll= graphop_visible_keyframes_poll; + ot->poll= ED_operator_ipo_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1962,7 +1966,7 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); if (RNA_boolean_get(op->ptr, "only_active")) - filter |= ANIMFILTER_ACTIVE; + filter |= ANIMFILTER_ACTIVE; // FIXME: enforce in this case only a single channel to get handled? else filter |= (ANIMFILTER_SEL|ANIMFILTER_CURVEVISIBLE); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); @@ -1976,7 +1980,7 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) fcm= add_fmodifier(&fcu->modifiers, type); if (fcm) set_active_fmodifier(&fcu->modifiers, fcm); - else { // TODO: stop when this happens? + else { BKE_report(op->reports, RPT_ERROR, "Modifier couldn't be added. See console for details."); break; } |