diff options
author | Johnny Matthews <johnny.matthews@gmail.com> | 2005-03-03 22:45:37 +0300 |
---|---|---|
committer | Johnny Matthews <johnny.matthews@gmail.com> | 2005-03-03 22:45:37 +0300 |
commit | c48fcd1f00561101ddb813b0b114bdd2637011dd (patch) | |
tree | c90774aca20853c4d3ed3425f3df147ea26d6855 /source | |
parent | 58b3022b524c6a1c5f2be76baed7bad691941e82 (diff) |
New menu option: When converting a subsurf or metaball to mesh, the option to delete the original is added, along with code to make it work :)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/editobject.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 8a2f3442a6c..1e41e5f9683 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2081,7 +2081,7 @@ void special_editmenu(void) void convertmenu(void) { - Base *base, *basen, *basact; + Base *base, *basen, *basact, *basedel=NULL; Object *ob, *ob1; Curve *cu; MetaBall *mb; @@ -2102,7 +2102,7 @@ void convertmenu(void) if(nr>0) ok= 1; } else if(ob->type==OB_MBALL) { - nr= pupmenu("Convert Metaball to%t|Mesh (keep original)"); + nr= pupmenu("Convert Metaball to%t|Mesh (keep original)%x1|Mesh (Delete Original)%x2"); if(nr>0) ok= 1; } else if(ob->type==OB_CURVE) { @@ -2114,7 +2114,7 @@ void convertmenu(void) if(nr>0) ok= 1; } else if(ob->type==OB_MESH && mesh_uses_displist((Mesh*) ob->data)) { - nr= pupmenu("Convert SubSurf to%t|Mesh (Keep Original)"); + nr= pupmenu("Convert SubSurf to%t|Mesh (Keep Original)%x1|Mesh (Delete Original)%x2"); if(nr>0) ok= 1; } if(ok==0) return; @@ -2143,6 +2143,8 @@ void convertmenu(void) if (mesh_uses_displist(oldme)) { DispListMesh *dlm; + basedel = base; + ob->flag |= OB_DONE; ob1= copy_object(ob); @@ -2176,6 +2178,7 @@ void convertmenu(void) enter_editmode(); exit_editmode(1); // freedata, but no undo BASACT= basact; + } } else if(ob->type==OB_FONT) { @@ -2220,10 +2223,11 @@ void convertmenu(void) } else if(ob->type==OB_MBALL) { - if(nr==1) { + if(nr==1 || nr == 2) { ob= find_basis_mball(ob); if(ob->disp.first && !(ob->flag&OB_DONE)) { + basedel = base; ob->flag |= OB_DONE; @@ -2256,8 +2260,11 @@ void convertmenu(void) } } base= base->next; + if(basedel != NULL && nr == 2) + free_and_unlink_base(basedel); + basedel = NULL; } - + countall(); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWOOPS, 0); allqueue(REDRAWBUTSEDIT, 0); |