Another Orange sneak-in feature: SoftBody support for Curves & Surfaces.
Well, it already worked a bit, but without weight options or edge stiffness. You now can set the weights using the "Properties" Panel in the 3D Window (allows multiple selections too) or with Wkey in Edit Mode. Bezier curves have this too. NOTE: Lattice SoftBody Goal created yesterday won't work anymore! I've had to recode weight support for Nurbs Points, using a new weight variable... this because the existing W variable was in use for Nurbs already. Also Lattices have this new Weight variable, so the code is nice uniform. Sorry for the artists who already created complex Lattices... :) NOTE2: Surface Objects don't support edge stiffness yet NOTE3: I've removed ancient screen coordinates from the Bezier struct, which makes - even with added weight and padding - the struct smaller! Demo file: http://download.blender.org/demo/test/2.40/softbody_curve_lattice.blend
This commit is contained in:
@@ -2138,7 +2138,7 @@ void special_editmenu(void)
|
||||
}
|
||||
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
|
||||
|
||||
nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2");
|
||||
nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight %x3");
|
||||
|
||||
switch(nr) {
|
||||
case 1:
|
||||
@@ -2147,6 +2147,33 @@ void special_editmenu(void)
|
||||
case 2:
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
||||
@@ -2166,7 +2193,7 @@ void special_editmenu(void)
|
||||
|
||||
while(a--) {
|
||||
if(bp->f1 & SELECT)
|
||||
bp->vec[3]= weight;
|
||||
bp->weight= weight;
|
||||
bp++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user