diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-11-08 03:06:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-11-08 03:06:48 +0300 |
commit | 574744bf42aec3f81a3bac6af88e915715bc1975 (patch) | |
tree | fa1a8f2da8502cd7a7882def39071a6952dd78f6 /source/blender/src/editobject.c | |
parent | 32758217590e98e810f6d522d4db24c50284bf08 (diff) |
New Curve function in the curve specials menu - "Smooth Radius" this smooth's the radius of selected curve points to unselected or endpoints. useful when changing the taper of a long curve
with many points (think treetrunk), it would be nice to take into account distance on the path when doing the curve interpolation.
Also moved added undo call's that were missing for 2 of the other curve specials.
Diffstat (limited to 'source/blender/src/editobject.c')
-rw-r--r-- | source/blender/src/editobject.c | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 997593b30b1..3e316d578ab 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2476,7 +2476,7 @@ void special_editmenu(void) } else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight %x3|Set Radius %x4"); + nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight %x3|Set Radius %x4|Smooth Radius %x5"); switch(nr) { case 1: @@ -2486,67 +2486,15 @@ void special_editmenu(void) switchdirectionNurb2(); break; case 3: - { - static float weight= 1.0f; - extern ListBase editNurb; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - if(fbutton(&weight, 0.0f, 1.0f, 10, 10, "Set Weight")) { - for(nu= editNurb.first; nu; nu= nu->next) { - if(nu->bezt) { - for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) { - if(bezt->f2 & SELECT) - bezt->weight= weight; - } - } - else if(nu->bp) { - for(bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) { - if(bp->f1 & SELECT) - bp->weight= weight; - } - } - } - } - } + setweightNurb(); break; case 4: - { - static float radius= 1.0f; - extern ListBase editNurb; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - if(fbutton(&radius, 0.0001f, 10.0f, 10, 10, "Set Radius")) { - for(nu= editNurb.first; nu; nu= nu->next) { - if(nu->bezt) { - for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) { - if(bezt->f2 & SELECT) - bezt->radius= radius; - } - } - else if(nu->bp) { - for(bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) { - if(bp->f1 & SELECT) - bp->radius= radius; - } - } - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ - - } + setradiusNurb(); + break; + case 5: + smoothradiusNurb(); break; } - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); } else if(G.obedit->type==OB_ARMATURE) { |