diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-23 04:57:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-23 04:57:19 +0400 |
commit | 11228cb4031c8e0a324d2ffa4463e2fb272f517c (patch) | |
tree | 96b641f7b939eb3c2ba355b5e47053418b0360a3 /source/blender/blenkernel/intern | |
parent | 8a320974f1b3e6004db3b3ad64f97742f878cbee (diff) |
rna: move metaball.active_element to metaball.elements.active
added rna funcs...
elem = metaball.elements.new()
metaball.elements.remove(elem)
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mball.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index e35d8bce886..e6f38e04d76 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -176,6 +176,55 @@ void make_local_mball(MetaBall *mb) } } } + +/* most simple meta-element adding function + * dont do context menipulation here (rna uses) */ +MetaElem *add_metaball_element(MetaBall *mb, const int type) +{ + MetaElem *ml= MEM_callocN(sizeof(MetaElem), "metaelem"); + + unit_qt(ml->quat); + + ml->rad= 2.0; + ml->s= 2.0; + ml->flag= MB_SCALE_RAD; + + switch(type) { + case MB_BALL: + ml->type = MB_BALL; + ml->expx= ml->expy= ml->expz= 1.0; + + break; + case MB_TUBE: + ml->type = MB_TUBE; + ml->expx= ml->expy= ml->expz= 1.0; + + break; + case MB_PLANE: + ml->type = MB_PLANE; + ml->expx= ml->expy= ml->expz= 1.0; + + break; + case MB_ELIPSOID: + ml->type = MB_ELIPSOID; + ml->expx= 1.2f; + ml->expy= 0.8f; + ml->expz= 1.0; + + break; + case MB_CUBE: + ml->type = MB_CUBE; + ml->expx= ml->expy= ml->expz= 1.0; + + break; + default: + break; + } + + BLI_addtail(&mb->elems, ml); + + return ml; +} /** Compute bounding box of all MetaElems/MetaBalls. * * Bounding box is computed from polygonized surface. Object *ob is |