[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28326] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: fix for crash drawing weights in lattice editmode.

Campbell Barton ideasman42 at gmail.com
Wed Apr 21 16:46:33 CEST 2010


Revision: 28326
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28326
Author:   campbellbarton
Date:     2010-04-21 16:46:32 +0200 (Wed, 21 Apr 2010)

Log Message:
-----------
fix for crash drawing weights in lattice editmode.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawobject.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2010-04-21 13:13:52 UTC (rev 28325)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2010-04-21 14:46:32 UTC (rev 28326)
@@ -1405,14 +1405,16 @@
 	Lattice *lt= ob->data;
 	DispList *dl;
 	int u, v, w;
-	int use_wcol= 0;
+	int use_wcol= 0, is_edit= (lt->editlatt != NULL);
 
 	/* now we default make displist, this will modifiers work for non animated case */
 	if(ob->disp.first==NULL)
 		lattice_calc_modifiers(scene, ob);
 	dl= find_displist(&ob->disp, DL_VERTS);
 	
-	if(lt->editlatt) {
+	if(is_edit) {
+		lt= lt->editlatt;
+
 		cpack(0x004000);
 		
 		if(ob->defbase.first && lt->dvert) {
@@ -1421,8 +1423,6 @@
 		}
 	}
 	
-	if(lt->editlatt) lt= lt->editlatt;
-	
 	glBegin(GL_LINES);
 	for(w=0; w<lt->pntsw; w++) {
 		int wxt = (w==0 || w==lt->pntsw-1);
@@ -1452,7 +1452,7 @@
 	if(use_wcol)
 		glShadeModel(GL_FLAT);
 
-	if( ((Lattice *)ob->data)->editlatt ) {
+	if(is_edit) {
 		if(v3d->zbuf) glDisable(GL_DEPTH_TEST);
 		
 		lattice_draw_verts(lt, dl, 0);





More information about the Bf-blender-cvs mailing list