Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-10-15 06:23:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-10-15 06:23:28 +0400
commitebc2cc15c0dc6a00f47b951401eaf2c78547ffe6 (patch)
treeebaada24228288712cab4ad98e4c4a491d7ea6b0 /source
parentd4cf5e360558fb8e1cfdc181ec6c8f981c4c5a3d (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')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c16
2 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index c48ce8a2343..ff17c2eedc1 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1374,13 +1374,15 @@ static void deselect_all_tracks(MovieTracking *tracking)
}
/* mval is region coords */
-static bool mouse_select(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool obcenter, short enumerate)
+static bool mouse_select(bContext *C, const int mval[2],
+ bool extend, bool deselect, bool toggle, bool obcenter, bool enumerate, bool object)
{
ViewContext vc;
ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);
Base *base, *startbase = NULL, *basact = NULL, *oldbasact = NULL;
+ bool is_obedit;
float dist = 100.0f;
int retval = false;
short hits;
@@ -1389,6 +1391,12 @@ static bool mouse_select(bContext *C, const int mval[2], bool extend, bool desel
/* setup view context for argument to callbacks */
view3d_set_viewcontext(C, &vc);
+
+ is_obedit = (vc.obedit != NULL);
+ if (object) {
+ /* signal for view3d_opengl_select to skip editmode objects */
+ vc.obedit = NULL;
+ }
/* always start list from basact in wire mode */
startbase = FIRSTBASE;
@@ -1564,7 +1572,7 @@ static bool mouse_select(bContext *C, const int mval[2], bool extend, bool desel
ED_base_object_select(basact, BA_SELECT);
}
- if (oldbasact != basact) {
+ if ((oldbasact != basact) && (is_obedit == false)) {
ED_base_object_activate(C, basact); /* adds notifier */
}
}
@@ -2256,7 +2264,7 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
else if (paint_vertsel_test(obact))
retval = mouse_weight_paint_vertex_select(C, location, extend, deselect, toggle, obact);
else
- retval = mouse_select(C, location, extend, deselect, toggle, center, enumerate);
+ retval = mouse_select(C, location, extend, deselect, toggle, center, enumerate, object);
/* passthrough allows tweaks
* FINISHED to signal one operator worked
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);