[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23899] branches/nurbs25: * Occlude background geometry

Emmanuel Stone emmanuel.stone at gmail.com
Sat Oct 17 00:22:38 CEST 2009


Revision: 23899
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23899
Author:   eman
Date:     2009-10-17 00:21:53 +0200 (Sat, 17 Oct 2009)

Log Message:
-----------
* Occlude background geometry 
 - ported over from 2.49 branch
* renamed tekenvertsN() to draw_nurbsverts()
* Fix to CMakeLists.txt file

Modified Paths:
--------------
    branches/nurbs25/intern/nurbana/CMakeLists.txt
    branches/nurbs25/source/blender/editors/space_view3d/drawobject.c
    branches/nurbs25/source/blender/editors/space_view3d/view3d_header.c

Modified: branches/nurbs25/intern/nurbana/CMakeLists.txt
===================================================================
--- branches/nurbs25/intern/nurbana/CMakeLists.txt	2009-10-16 21:42:25 UTC (rev 23898)
+++ branches/nurbs25/intern/nurbana/CMakeLists.txt	2009-10-16 22:21:53 UTC (rev 23899)
@@ -33,40 +33,4 @@
 
 #INCLUDE_DIRECTORIES(../../intern/guardedalloc ./opennurbs ./opennurbs/zlib intern/trim)
 BLENDERLIB(bf_nurbana "${SRC}" "${INC}")
-#, libtype=['intern','game','game2','player'], priority = [15, 55, 100, 135] )
-# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version. The Blender
-# Foundation also sells licenses for use in proprietary software under
-# the Blender License.  See http://www.blender.org/BL/ for information
-# about this.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Emmanuel Stone.
-#
-# ***** END GPL/BL DUAL LICENSE BLOCK *****
-
-SET(INC include)
-
-FILE(GLOB SRC intern/*.cpp intern/opennurbs/*.cpp intern/opennurbs/*.c intern/opennurbs/zlib/*.c intern/trim/*.cpp)
-
-
-INCLUDE_DIRECTORIES(../../intern/guardedalloc ./opennurbs ./opennurbs/zlib intern/trim)
-BLENDERLIB(bf_nurbana "${SRC}" "${INC}")
-#, libtype=['intern','game','game2','player'], priority = [15, 55, 100, 135] )
+#, libtype=['intern','game','game2','player'], priority = [15, 55, 100, 135] )
\ No newline at end of file

Modified: branches/nurbs25/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/nurbs25/source/blender/editors/space_view3d/drawobject.c	2009-10-16 21:42:25 UTC (rev 23898)
+++ branches/nurbs25/source/blender/editors/space_view3d/drawobject.c	2009-10-16 22:21:53 UTC (rev 23899)
@@ -4422,7 +4422,7 @@
 	glEnd();
 }
 
-static void tekenvertsN(Nurb *nu, short sel, short hide_handles)
+static void draw_nurbsverts(View3D *v3d, Nurb *nu, short sel, short hide_handles)
 {
 	BezTriple *bezt;
 	BPoint *bp;
@@ -4431,6 +4431,9 @@
 
 	if(nu->hide) return;
 
+	if(v3d->zbuf && !(v3d->flag & V3D_ZBUF_SELECT)==0)
+		glEnable(GL_DEPTH_TEST);
+
 	if(sel) UI_ThemeColor(TH_VERTEX_SELECT);
 	else UI_ThemeColor(TH_VERTEX);
 
@@ -4471,12 +4474,15 @@
 	glPointSize(1.0);
 }
 
-static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
+static void draw_editnurb(View3D *v3d, Object *ob, Nurb *nurb, int sel)
 {
 	Nurb *nu;
 	BPoint *bp, *bp1;
 	int a, b, ofs;
-	
+
+	if(v3d->zbuf && !(v3d->flag & V3D_ZBUF_SELECT)==0)
+		glEnable(GL_DEPTH_TEST);
+
 	nu= nurb;
 	while(nu) {
 		if(nu->hide==0) {
@@ -4593,13 +4599,13 @@
 			tekenhandlesN(nu, 0, hide_handles);
 		}
 	}
-	draw_editnurb(ob, nurb, 0);
-	draw_editnurb(ob, nurb, 1);
+	draw_editnurb(v3d, ob, nurb, 0);
+	draw_editnurb(v3d, ob, nurb, 1);
 	/* selected handles */
 	for(nu=nurb; nu; nu=nu->next) {
 		if(nu->type == CU_BEZIER && (cu->drawflag & CU_HIDE_HANDLES)==0)
 			tekenhandlesN(nu, 1, hide_handles);
-		tekenvertsN(nu, 0, hide_handles);
+		draw_nurbsverts(v3d, nu, 0, hide_handles);//tekenvertsN(nu, 0, hide_handles);
 	}
 	
 	if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
@@ -4642,7 +4648,7 @@
 	if(v3d->zbuf) glDisable(GL_DEPTH_TEST);
 	
 	for(nu=nurb; nu; nu=nu->next) {
-		tekenvertsN(nu, 1, hide_handles);
+		draw_nurbsverts(v3d, nu, 1, hide_handles);
 	}
 	
 	if(v3d->zbuf) glEnable(GL_DEPTH_TEST); 

Modified: branches/nurbs25/source/blender/editors/space_view3d/view3d_header.c
===================================================================
--- branches/nurbs25/source/blender/editors/space_view3d/view3d_header.c	2009-10-16 21:42:25 UTC (rev 23898)
+++ branches/nurbs25/source/blender/editors/space_view3d/view3d_header.c	2009-10-16 22:21:53 UTC (rev 23899)
@@ -2200,7 +2200,14 @@
 			uiBlockEndAlign(block);
 			header_xco_step(ar, &xco, &yco, &maxco, XIC);
 		}
-
+		else if(obedit && (obedit->type == OB_SURF)) {
+			if(v3d->drawtype > OB_WIRE) {
+				uiDefIconButBitS(block, TOG, V3D_ZBUF_SELECT, B_REDR, ICON_ORTHO, xco,yco,XIC,YIC, &v3d->flag, 1.0, 0.0, 0, 0, "Occlude background geometry");
+			}
+			xco+= XIC;
+			uiBlockEndAlign(block);
+			header_xco_step(ar, &xco, &yco, &maxco, XIC);
+		}
 		uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE, xco,yco,XIC,YIC, NULL, 0, 1.0, 0, 0, "Render this window (Ctrl Click for anim)");
 		
 		if (ob && (ob->mode & OB_MODE_POSE)) {





More information about the Bf-blender-cvs mailing list