[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25537] trunk/blender: crash fix for sculpt when loading some files

Campbell Barton ideasman42 at gmail.com
Wed Dec 23 16:51:39 CET 2009


Revision: 25537
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25537
Author:   campbellbarton
Date:     2009-12-23 16:51:39 +0100 (Wed, 23 Dec 2009)

Log Message:
-----------
crash fix for sculpt when loading some files

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_view3d_toolbar.py
    trunk/blender/source/blender/editors/space_view3d/drawobject.c

Modified: trunk/blender/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d_toolbar.py	2009-12-23 15:06:47 UTC (rev 25536)
+++ trunk/blender/release/scripts/ui/space_view3d_toolbar.py	2009-12-23 15:51:39 UTC (rev 25537)
@@ -690,7 +690,7 @@
     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

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2009-12-23 15:06:47 UTC (rev 25536)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2009-12-23 15:51:39 UTC (rev 25537)
@@ -2796,6 +2796,8 @@
 		}
 	}
 	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 @@
 		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);





More information about the Bf-blender-cvs mailing list