crash fix for sculpt when loading some files
authorCampbell Barton <ideasman42@gmail.com>
Wed, 23 Dec 2009 15:51:39 +0000 (15:51 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 23 Dec 2009 15:51:39 +0000 (15:51 +0000)
release/scripts/ui/space_view3d_toolbar.py
source/blender/editors/space_view3d/drawobject.c

index ca8978eecf8cbc5319d8e0b2772780240f860935..15902215d84deee17ac1f85f051fe2f41a1f0053 100644 (file)
@@ -690,7 +690,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
     bl_label = "Options"
 
     def poll(self, context):
-        return context.sculpt_object
+        return (context.sculpt_object and context.tool_settings.sculpt)
 
     def draw(self, context):
         layout = self.layout
index edb91f2b0c923e1395a86d76e8cb29b071d7cac3..8060514accd8ad1f23febd2ea01ff5ddc4a1c132 100644 (file)
@@ -2796,6 +2796,8 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
                }
        }
        else if(dt==OB_SOLID) {
+               Paint *p;
+
                if((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire && !ob->sculpt)
                        draw_mesh_object_outline(v3d, ob, dm);
 
@@ -2804,8 +2806,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
                glEnable(GL_LIGHTING);
                glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
 
-               if(ob->sculpt) {
-                       Paint *p = paint_get_active(scene);
+               if(ob->sculpt && (p=paint_get_active(scene))) {
                        float planes[4][4];
                        float (*fpl)[4] = NULL;
                        int fast= (p->flags & PAINT_FAST_NAVIGATE) && (rv3d->rflag & RV3D_NAVIGATING);