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.
This commit is contained in:
2007-11-08 00:06:48 +00:00
parent 3275821759
commit 574744bf42
3 changed files with 222 additions and 58 deletions

View File

@@ -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) {