bugfix [#20736] crash if lasso select while invisble object is selected
authorCampbell Barton <ideasman42@gmail.com>
Tue, 19 Jan 2010 16:38:48 +0000 (16:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 19 Jan 2010 16:38:48 +0000 (16:38 +0000)
- also dont display empty menu's

source/blender/editors/interface/interface_regions.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_view3d/view3d_select.c

index 9082348..cef2501 100644 (file)
@@ -2240,7 +2240,8 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
        }
 
        str= BLI_dynstr_get_cstring(ds);
-       ui_popup_menu_create(C, NULL, NULL, NULL, NULL, str);
+       if(str[0] != '\0')
+               ui_popup_menu_create(C, NULL, NULL, NULL, NULL, str);
        MEM_freeN(str);
 
        BLI_dynstr_free(ds);
index f837409..f1e0f9c 100644 (file)
@@ -1589,7 +1589,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
        if (ak) 
                CFRA= (int)ak->cfra;
        else
-               BKE_report(op->reports, RPT_ERROR, "No more keyframes to jump to in this direction");
+               BKE_report(op->reports, RPT_INFO, "No more keyframes to jump to in this direction");
        
        /* free temp stuff */
        BLI_dlrbTree_free(&keys);
index 5d9919e..f7f053b 100644 (file)
@@ -345,9 +345,8 @@ int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, in
 /* warning; lasso select with backbuffer-check draws in backbuf with persp(PERSP_WIN) 
    and returns with persp(PERSP_VIEW). After lasso select backbuf is not OK
 */
-static void do_lasso_select_pose(ViewContext *vc, short mcords[][2], short moves, short select)
+static void do_lasso_select_pose(ViewContext *vc, Object *ob, short mcords[][2], short moves, short select)
 {
-       Object *ob= vc->obact;
        bPoseChannel *pchan;
        float vec[3];
        short sco1[2], sco2[2];
@@ -382,7 +381,7 @@ static void do_lasso_select_objects(ViewContext *vc, short mcords[][2], short mo
        Base *base;
        
        for(base= vc->scene->base.first; base; base= base->next) {
-               if(base->lay & vc->v3d->lay) {
+               if(BASE_SELECTABLE(vc->v3d, base)) { /* use this to avoid un-needed lasso lookups */
                        project_short(vc->ar, base->object->obmat[3], &base->sx);
                        if(lasso_inside(mcords, moves, base->sx, base->sy)) {
                                
@@ -391,7 +390,7 @@ static void do_lasso_select_objects(ViewContext *vc, short mcords[][2], short mo
                                base->object->flag= base->flag;
                        }
                        if(base->object->mode & OB_MODE_POSE) {
-                               do_lasso_select_pose(vc, mcords, moves, select);
+                               do_lasso_select_pose(vc, base->object, mcords, moves, select);
                        }
                }
        }