diff options
author | Jiri Hnidek <jiri.hnidek@tul.cz> | 2006-06-27 16:36:09 +0400 |
---|---|---|
committer | Jiri Hnidek <jiri.hnidek@tul.cz> | 2006-06-27 16:36:09 +0400 |
commit | 56bcc1c3bbd2a30b487c2dd228002eeb5d5259a9 (patch) | |
tree | 725a69bcfae0b68868b11f9af983a901c0c48edb /source/blender/src/editmball.c | |
parent | 4d45723dd1a7893f6db4b0977ee78f562a156f86 (diff) |
bug fix:
- added one more countall() function
- undo works for (de)select all
- added empty line at the end of editmball.c
- added some comments
Diffstat (limited to 'source/blender/src/editmball.c')
-rw-r--r-- | source/blender/src/editmball.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/source/blender/src/editmball.c b/source/blender/src/editmball.c index acf3fbff99d..f0f765dbe33 100644 --- a/source/blender/src/editmball.c +++ b/source/blender/src/editmball.c @@ -74,6 +74,8 @@ extern short editbutflag; ListBase editelems= {0, 0}; MetaElem *lastelem; +/* this function is called, when MetaBall Object is + * switched from object mode to edit mode */ void make_editMball() { MetaBall *mb; @@ -98,13 +100,16 @@ void make_editMball() countall(); } +/* this function is called, when MetaBall Object switched from + * edit mode to object mode. List od MetaElements is copied + * from editelems to to object->data structure (mb->elems) */ void load_editMball() { /* load mball in object */ MetaBall *mb; MetaElem *ml, *newml; - if(G.obedit==0) return; + if(G.obedit==NULL) return; mb= G.obedit->data; BLI_freelistN(&(mb->elems)); @@ -119,6 +124,7 @@ void load_editMball() } } +/* add new MetaElement primitive */ void add_primitiveMball(int dummy_argument) { MetaElem *ml; @@ -132,7 +138,7 @@ void add_primitiveMball(int dummy_argument) check_editmode(OB_MBALL); /* if no obedit: new object and enter editmode */ - if(G.obedit==0) { + if(G.obedit==NULL) { add_object_draw(OB_MBALL); base_init_from_view3d(BASACT, G.vd); G.obedit= BASACT->object; @@ -210,11 +216,13 @@ void add_primitiveMball(int dummy_argument) lastelem= ml; DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); // added ball can influence others - + + countall(); allqueue(REDRAWALL, 0); BIF_undo_push("Add MetaElem"); } +/* deselect all MetaElements */ void deselectall_mball() { MetaElem *ml; @@ -234,11 +242,14 @@ void deselectall_mball() else ml->flag |= SELECT; ml= ml->next; } + allqueue(REDRAWVIEW3D, 0); countall(); -// BIF_undo_push("Deselect MetaElem"); + BIF_undo_push("Deselect MetaElem"); } +/* select MetaElement with mouse click (user can select radius circle or + * stiffness circle) */ void mouse_mball() { static MetaElem *startelem=0; @@ -254,7 +265,7 @@ void mouse_mball() if(ml==startelem) break; ml= ml->next; } - if(ml==0) startelem= editelems.first; + if(ml==NULL) startelem= editelems.first; if(hits>0) { ml= startelem; @@ -276,7 +287,7 @@ void mouse_mball() if(act) break; ml= ml->next; - if(ml==0) ml= editelems.first; + if(ml==NULL) ml= editelems.first; if(ml==startelem) break; } if(act) { @@ -296,10 +307,13 @@ void mouse_mball() allqueue(REDRAWBUTSEDIT, 0); } } + + allqueue(REDRAWBUTSOBJECT, 0); countall(); rightmouse_transform(); } +/* duplicate selected MetaElements */ void adduplicate_mball() { MetaElem *ml, *newml; @@ -474,3 +488,4 @@ void reveal_mball(void) countall(); BIF_undo_push("Unhide MetaElems"); } + |