From 3be66f6d8ddf9e4661fb35530887f98536158241 Mon Sep 17 00:00:00 2001 From: Alexander Ewering Date: Tue, 4 Apr 2006 09:14:07 +0000 Subject: New option for convert-menu font->curve: "Curve (Single filling group)". Since the text-object remake, it was not possible anymore to 'cut out' text from, say, a box made by a polycurve, by converting text to curve and then joining - only the first character would be cut out. This is because of the filling groups (nu/dl->charidx) I introduced for getting the vast speedup and the possibility of overlapping characters. The new convert menu option now assigns filling group 0 to all of the nurbs generated. Maybe filling groups should be exposed in the UI in general for curves - there are various occasions where they are useful. (Hint to the UI mafia! ;) --- source/blender/src/editobject.c | 71 ++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index a7626da621d..85979160986 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2245,6 +2245,7 @@ void convertmenu(void) Base *base, *basen, *basact, *basedel=NULL; Object *obact, *ob, *ob1; Curve *cu; + Nurb *nu; MetaBall *mb; Mesh *me; DispList *dl; @@ -2260,7 +2261,7 @@ void convertmenu(void) basact= BASACT; /* will be restored */ if(obact->type==OB_FONT) { - nr= pupmenu("Convert Font to%t|Curve"); + nr= pupmenu("Convert Font to%t|Curve%x1|Curve (Single filling group)%x2"); if(nr>0) ok= 1; } else if(obact->type==OB_MBALL) { @@ -2340,41 +2341,45 @@ void convertmenu(void) } } else if(ob->type==OB_FONT) { - if(nr==1) { - - ob->flag |= OB_DONE; - - ob->type= OB_CURVE; - cu= ob->data; - - if(cu->vfont) { - cu->vfont->id.us--; - cu->vfont= 0; - } - if(cu->vfontb) { - cu->vfontb->id.us--; - cu->vfontb= 0; - } - if(cu->vfonti) { - cu->vfonti->id.us--; - cu->vfonti= 0; - } - if(cu->vfontbi) { - cu->vfontbi->id.us--; - cu->vfontbi= 0; - } - /* other users */ - if(cu->id.us>1) { - ob1= G.main->object.first; - while(ob1) { - if(ob1->data==cu) { - ob1->type= OB_CURVE; - ob1->recalc |= OB_RECALC; - } - ob1= ob1->id.next; + ob->flag |= OB_DONE; + + ob->type= OB_CURVE; + cu= ob->data; + + if(cu->vfont) { + cu->vfont->id.us--; + cu->vfont= 0; + } + if(cu->vfontb) { + cu->vfontb->id.us--; + cu->vfontb= 0; + } + if(cu->vfonti) { + cu->vfonti->id.us--; + cu->vfonti= 0; + } + if(cu->vfontbi) { + cu->vfontbi->id.us--; + cu->vfontbi= 0; + } + /* other users */ + if(cu->id.us>1) { + ob1= G.main->object.first; + while(ob1) { + if(ob1->data==cu) { + ob1->type= OB_CURVE; + ob1->recalc |= OB_RECALC; } + ob1= ob1->id.next; } } + if (nr==2) { + nu= cu->nurb.first; + while(nu) { + nu->charidx= 0; + nu= nu->next; + } + } } else if ELEM(ob->type, OB_CURVE, OB_SURF) { if(nr==1) { -- cgit v1.2.3