diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-06 07:02:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-06 07:02:14 +0400 |
commit | c4472bbab678cfc826fc40fe9272db38cbb6a1cd (patch) | |
tree | b9a8427e12a0bc4f7e6ab576c05ad0bcc547c3be /source/blender/editors/space_view3d/drawobject.c | |
parent | f84f2c703378284cb72de3bb07b7a8f4b5de31c9 (diff) |
add mball_foreachScreenElem() and use for lasso & circle selection, also utility metaball functions to (de)select all.
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 40207ce806c..a6f4527cf98 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2221,6 +2221,25 @@ void nurbs_foreachScreenVert( } /* ED_view3d_init_mats_rv3d must be called first */ +void mball_foreachScreenElem( + struct ViewContext *vc, + void (*func)(void *userData, struct MetaElem *ml, int x, int y), + void *userData) +{ + MetaBall *mb = (MetaBall *)vc->obedit->data; + MetaElem *ml; + + for (ml = mb->editelems->first; ml; ml = ml->next) { + int screen_co[2]; + if (ED_view3d_project_int_object(vc->ar, &ml->x, screen_co, + V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_SUCCESS) + { + func(userData, ml, screen_co[0], screen_co[1]); + } + } +} + +/* ED_view3d_init_mats_rv3d must be called first */ void armature_foreachScreenBone( struct ViewContext *vc, void (*func)(void *userData, struct EditBone *ebone, int x0, int y0, int x1, int y1), |