diff options
author | Matt Ebb <matt@mke3.net> | 2007-08-21 05:57:15 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2007-08-21 05:57:15 +0400 |
commit | 63a801c21d054381d4eccd186dfea0d96533cfb3 (patch) | |
tree | b30df51e4d46bfa3b9f20a885bfc499d38d8541b /source/blender/src | |
parent | 798001556aed3dfec4b76c9525543560c7fbbbe0 (diff) |
* Curve tilt interpolation types
Just a quickie feature I needed here at work- the previous linear
interpolation of tilt in curves can give nasty pinching problems
when trying to do flowing curves like a ribbon. This commit lets
you choose the interpolation type, between Linear, Cardinal, and
BSpline. The code was already set up for it pretty easily, mainly
needed to make the choice visible to the user.
Example:
http://mke3.net/blender/devel/etc/tilt_interp_types.png
Works on selected curve 'lines', menu in 'curve tools' panel in
edit mode.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/buttons_editing.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 3c995c4d19a..6efc9ffba55 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2794,6 +2794,10 @@ void do_curvebuts(unsigned short event) allqueue(REDRAWVIEW3D, 0); } break; + case B_TILTINTERP: + DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); + allqueue(REDRAWVIEW3D, 0); + break; case B_SUBSURFTYPE: /* fallthrough */ case B_MAKEDISP: @@ -2904,6 +2908,14 @@ static void editing_panel_curve_tools(Object *ob, Curve *cu) nu= lastnu; if(nu==NULL) nu= editNurb.first; if(nu) { + if (ob->type==OB_CURVE) { + uiDefBut(block, LABEL, 0, "Tilt", + 467,87,72, 18, 0, 0, 0, 0, 0, ""); + /* KEY_LINEAR, KEY_CARDINAL, KEY_BSPLINE */ + uiDefButS(block, MENU, B_TILTINTERP, "Tilt Interpolation %t|Linear %x0|Cardinal %x1|BSpline %x2", + 467,67,72, 18, &(nu->tilt_interp), 0, 0, 0, 0, "Tilt interpolation"); + } + uiBlockBeginAlign(block); sp= &(nu->orderu); uiDefButS(block, NUM, B_SETORDER, "Order U:", 565,90,102, 19, sp, 2.0, 6.0, 0, 0, "Nurbs only; the amount of control points involved"); |