diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-15 06:23:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-15 06:23:28 +0400 |
commit | ebc2cc15c0dc6a00f47b951401eaf2c78547ffe6 (patch) | |
tree | ebaada24228288712cab4ad98e4c4a491d7ea6b0 /source/blender/editors/space_view3d/view3d_view.c | |
parent | d4cf5e360558fb8e1cfdc181ec6c8f981c4c5a3d (diff) |
fix [#37067] Bone Crash
Holding Ctrl+RMB is supposed to select objects, while in editmode,
however it would end up calling editmode selection as well as pose selection while an armature was in editmode (which caused the crash).
Add the ability for view3d_opengl_select() to skip editmode selection.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 74d72061995..b74527159c2 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -876,10 +876,12 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d) } } -/* IGLuint-> GLuint */ -/* Warning: be sure to account for a negative return value - * This is an error, "Too many objects in select buffer" - * and no action should be taken (can crash blender) if this happens +/** + * \warning be sure to account for a negative return value + * This is an error, "Too many objects in select buffer" + * and no action should be taken (can crash blender) if this happens + * + * \note (vc->obedit == NULL) can be set to explicitly skip edit-object selection. */ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int bufsize, rcti *input) { @@ -890,6 +892,7 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b short code, hits; char dt; short dtx; + const bool use_obedit_skip = (scene->obedit != NULL) && (vc->obedit == NULL); G.f |= G_PICKSEL; @@ -937,8 +940,11 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b for (base = scene->base.first; base; base = base->next) { if (base->lay & v3d->lay) { - if (base->object->restrictflag & OB_RESTRICT_SELECT) + if ((base->object->restrictflag & OB_RESTRICT_SELECT) || + (use_obedit_skip && (scene->obedit->data == base->object->data))) + { base->selcol = 0; + } else { base->selcol = code; glLoadName(code); |