diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-06-04 16:29:37 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-06-04 16:29:37 +0400 |
commit | 0259d5de41de65d59cfcf1a0023032f085e50148 (patch) | |
tree | fdad6297008776edbc5a1e0d30ee3bde0659042d /source | |
parent | 4b4bf1146997636e581465a73074b8f68b56f8a9 (diff) |
Attempted fix for borderselect crash that Jeremy (@Mango) is getting on a
particular file in Pose Mode
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 602f790c8df..646defe8569 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1870,7 +1870,6 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i for (base = vc->scene->base.first; base && hits; base = base->next) { if (BASE_SELECTABLE(vc->v3d, base)) { while (base->selcol == (*col & 0xFFFF)) { /* we got an object */ - if (*col & 0xFFFF0000) { /* we got a bone */ bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY)); if (bone) { @@ -1897,7 +1896,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i else ED_base_object_select(base, BA_DESELECT); } - + col += 4; /* next color */ hits--; if (hits == 0) break; @@ -1906,13 +1905,16 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i if (bone_selected) { Object *ob = base->object; - bArmature *arm = ob->data; - - WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob); - if (arm->flag & ARM_HAS_VIZ_DEPS) { - /* mask modifier ('armature' mode), etc. */ - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + if (ob && (ob->type == OB_ARMATURE)) { + bArmature *arm = ob->data; + + WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob); + + if (arm && (arm->flag & ARM_HAS_VIZ_DEPS)) { + /* mask modifier ('armature' mode), etc. */ + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + } } } } |