[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22480] branches/blender2.5/blender/source /blender: 2.5, continuing work with localizing paint modes.

Nicholas Bishop nicholasbishop at gmail.com
Sat Aug 15 21:48:52 CEST 2009


Revision: 22480
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22480
Author:   nicholasbishop
Date:     2009-08-15 21:48:50 +0200 (Sat, 15 Aug 2009)

Log Message:
-----------
2.5, continuing work with localizing paint modes.

* Replaced FACESEL_PAINT_TEST macro with paint_facesel_test. This removes one more thing from BKE_global, and it'll make it easier to localize.
* Fixed sculpt paint cursor sometimes not showing.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenkernel/BKE_global.h
    branches/blender2.5/blender/source/blender/blenkernel/intern/DerivedMesh.c
    branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c
    branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c
    branches/blender2.5/blender/source/blender/editors/object/object_edit.c
    branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c
    branches/blender2.5/blender/source/blender/editors/space_image/image_buttons.c
    branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c
    branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c
    branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c
    branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_edit.c
    branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
    branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_select.c

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/blenkernel/BKE_paint.h
    branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_global.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_global.h	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_global.h	2009-08-15 19:48:50 UTC (rev 22480)
@@ -127,11 +127,6 @@
 /* #define G_AUTOMATKEYS	(1 << 30)   also removed */
 #define G_HIDDENHANDLES (1 << 31) /* used for curves only */
 
-/* macro for testing face select mode
- * Texture paint could be removed since selected faces are not used
- * however hiding faces is useful */
-#define FACESEL_PAINT_TEST ((G.f&G_FACESELECT) && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))) 
-
 /* G.fileflags */
 
 #define G_AUTOPACK               (1 << 0)

Added: branches/blender2.5/blender/source/blender/blenkernel/BKE_paint.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_paint.h	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_paint.h	2009-08-15 19:48:50 UTC (rev 22480)
@@ -0,0 +1,38 @@
+/*
+ * ***** BEGIN GPL 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.
+ *
+ * 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) 2009 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */ 
+
+#ifndef BKE_PAINT_H
+#define BKE_PAINT_H
+
+struct Object;
+
+/* testing face select mode
+ * Texture paint could be removed since selected faces are not used
+ * however hiding faces is useful */
+int paint_facesel_test(struct Object *ob);
+
+#endif

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/DerivedMesh.c	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/DerivedMesh.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -72,6 +72,7 @@
 #include "BKE_modifier.h"
 #include "BKE_mesh.h"
 #include "BKE_object.h"
+#include "BKE_paint.h"
 #include "BKE_subsurf.h"
 #include "BKE_texture.h"
 #include "BKE_utildefines.h"
@@ -2076,7 +2077,7 @@
 static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
 {
 	Object *obact = scene->basact?scene->basact->object:NULL;
-	int editing = (FACESEL_PAINT_TEST)|(G.f & G_PARTICLEEDIT);
+	int editing = paint_facesel_test(ob)|(G.f & G_PARTICLEEDIT);
 	int needMapping = editing && (ob==obact);
 	float min[3], max[3];
 	

Added: branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -0,0 +1,37 @@
+/*
+ * ***** BEGIN GPL 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.
+ *
+ * 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) 2009 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */ 
+
+#include "DNA_object_types.h"
+
+#include "BKE_global.h"
+#include "BKE_paint.h"
+
+int paint_facesel_test(Object *ob)
+{
+	return (G.f&G_FACESELECT) && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT));
+
+}

Modified: branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -67,6 +67,7 @@
 #include "BKE_mesh.h"
 #include "BKE_modifier.h"
 #include "BKE_object.h"
+#include "BKE_paint.h"
 #include "BKE_pointcache.h"
 #include "BKE_softbody.h"
 #include "BKE_texture.h"
@@ -891,7 +892,7 @@
 		evlist[a]= eve;
 		
 		// face select sets selection in next loop
-		if( (FACESEL_PAINT_TEST)==0 )
+		if(!paint_facesel_test(ob))
 			eve->f |= (mvert->flag & 1);
 		
 		if (mvert->flag & ME_HIDE) eve->h= 1;		
@@ -966,7 +967,7 @@
 					if(mface->flag & ME_FACE_SEL) {
 						efa->f |= SELECT;
 						
-						if(FACESEL_PAINT_TEST) {
+						if(paint_facesel_test(ob)) {
 							EM_select_face(efa, 1); /* flush down */
 						}
 					}

Modified: branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -65,6 +65,7 @@
 #include "BKE_global.h"
 #include "BKE_mesh.h"
 #include "BKE_material.h"
+#include "BKE_paint.h"
 #include "BKE_texture.h"
 #include "BKE_utildefines.h"
 #include "BKE_report.h"
@@ -242,7 +243,7 @@
 	
 	/* method in use for face selecting too */
 	if(vc->obedit==NULL) {
-		if(FACESEL_PAINT_TEST);
+		if(paint_facesel_test(vc->obact));
 		else return 0;
 	}
 	else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;
@@ -297,7 +298,7 @@
 	
 	/* method in use for face selecting too */
 	if(vc->obedit==NULL) {
-		if(FACESEL_PAINT_TEST);
+		if(paint_facesel_test(vc->obact));
 		else return 0;
 	}
 	else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;

Modified: branches/blender2.5/blender/source/blender/editors/object/object_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/object/object_edit.c	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/editors/object/object_edit.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -98,6 +98,7 @@
 #include "BKE_mesh.h"
 #include "BKE_nla.h"
 #include "BKE_object.h"
+#include "BKE_paint.h"
 #include "BKE_particle.h"
 #include "BKE_property.h"
 #include "BKE_report.h"
@@ -4118,7 +4119,7 @@
 		if(ob->flag & OB_POSEMODE) {
 // XXX			pose_special_editmenu();
 		}
-		else if(FACESEL_PAINT_TEST) {
+		else if(paint_facesel_test(ob)) {
 			Mesh *me= get_mesh(ob);
 			MTFace *tface;
 			MFace *mface;

Modified: branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -1663,8 +1663,6 @@
 		/* Leave sculptmode */
 		ob->mode &= ~OB_MODE_SCULPT;
 
-		toggle_paint_cursor(C);
-
 		free_sculptsession(&ob->sculpt);
 	}
 	else {

Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_buttons.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_image/image_buttons.c	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/editors/space_image/image_buttons.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -58,6 +58,7 @@
 #include "BKE_mesh.h"
 #include "BKE_node.h"
 #include "BKE_packedFile.h"
+#include "BKE_paint.h"
 #include "BKE_screen.h"
 #include "BKE_utildefines.h"
 
@@ -1318,7 +1319,7 @@
 		 }
 		 
 		 /* exception, let's do because we only use this panel 3 times in blender... but not real good code! */
-		 if( (FACESEL_PAINT_TEST) && sima && &sima->iuser==iuser)
+		 if( (paint_facesel_test(CTX_data_active_object(C))) && sima && &sima->iuser==iuser)
 			 return;
 		 /* left side default per-image options, right half the additional options */
 		 

Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c	2009-08-15 19:40:09 UTC (rev 22479)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c	2009-08-15 19:48:50 UTC (rev 22480)
@@ -60,6 +60,7 @@
 #include "BKE_material.h"
 #include "BKE_mesh.h"
 #include "BKE_object.h"
+#include "BKE_paint.h"
 #include "BKE_property.h"
 #include "BKE_utildefines.h"
 
@@ -482,7 +483,7 @@
 	if(ob == scene->obedit)
 		return;
 	else if(ob==OBACT)
-		if(FACESEL_PAINT_TEST)
+		if(paint_facesel_test(ob))
 			return;
 
 	ddm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);

Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c	2009-08-15 19:40:09 UTC (rev 22479)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list