[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11961] branches/bmesh/source/blender: -> (de)select all
Geoffrey Bantle
hairbat at yahoo.com
Fri Sep 7 14:29:42 CEST 2007
Revision: 11961
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11961
Author: briggs
Date: 2007-09-07 14:29:41 +0200 (Fri, 07 Sep 2007)
Log Message:
-----------
-> (de)select all
AKey now selects/deselects all in editmode for meshes.
Fixed record keeping of countall() for keeping track of
selected elements.
Modified Paths:
--------------
branches/bmesh/source/blender/include/editbmesh.h
branches/bmesh/source/blender/src/edit.c
branches/bmesh/source/blender/src/editbmesh_interface.c
branches/bmesh/source/blender/src/space.c
Added Paths:
-----------
branches/bmesh/source/blender/src/editbmesh_select.c
Modified: branches/bmesh/source/blender/include/editbmesh.h
===================================================================
--- branches/bmesh/source/blender/include/editbmesh.h 2007-09-07 08:09:41 UTC (rev 11960)
+++ branches/bmesh/source/blender/include/editbmesh.h 2007-09-07 12:29:41 UTC (rev 11961)
@@ -29,4 +29,8 @@
void EM_cut_edges(int numcuts);
void EM_dissolve_edges(void);
void EM_delete_context(void);
-void EM_extrude_mesh(void);
\ No newline at end of file
+void EM_extrude_mesh(void);
+
+
+/*editbmesh_select.c*/
+void EM_deselectall_mesh(void);
\ No newline at end of file
Modified: branches/bmesh/source/blender/src/edit.c
===================================================================
--- branches/bmesh/source/blender/src/edit.c 2007-09-07 08:09:41 UTC (rev 11960)
+++ branches/bmesh/source/blender/src/edit.c 2007-09-07 12:29:41 UTC (rev 11961)
@@ -652,10 +652,26 @@
if(G.obedit->type==OB_MESH) {
BME_Mesh *em = G.editMesh;
-
+ BME_Vert *v;
+ BME_Edge *e;
+ BME_Poly *f;
+
+ for(v=BME_first(G.editMesh,BME_VERT);v;v=BME_next(G.editMesh,BME_VERT,v)){
+ if(BME_SELECTED(v)) G.totvertsel++;
+ }
+ for(e=BME_first(G.editMesh,BME_EDGE);e;e=BME_next(G.editMesh,BME_EDGE,e)){
+ if(BME_SELECTED(e)) G.totedgesel++;
+ }
+ for(f=BME_first(G.editMesh,BME_POLY);f;f=BME_next(G.editMesh,BME_POLY,f)){
+ if(BME_SELECTED(f)) G.totfacesel++;
+ }
+
G.totvert = em->totvert;
G.totedge = em->totedge;
G.totface = em->totpoly;
+
+
+
}
else if (G.obedit->type==OB_ARMATURE){
for (ebo=G.edbo.first;ebo;ebo=ebo->next){
Modified: branches/bmesh/source/blender/src/editbmesh_interface.c
===================================================================
--- branches/bmesh/source/blender/src/editbmesh_interface.c 2007-09-07 08:09:41 UTC (rev 11960)
+++ branches/bmesh/source/blender/src/editbmesh_interface.c 2007-09-07 12:29:41 UTC (rev 11961)
@@ -1,5 +1,7 @@
#include "MEM_guardedalloc.h"
+#include "BSE_edit.h"
+
#include "BKE_bmesh.h"
#include "BKE_mesh.h"
#include "BKE_global.h"
@@ -390,6 +392,7 @@
allqueue(REDRAWVIEW3D, 1);
}
}
+ countall();
makeDerivedMesh(G.obedit,CD_MASK_EDITMESH);
rightmouse_transform();
}
Added: branches/bmesh/source/blender/src/editbmesh_select.c
===================================================================
--- branches/bmesh/source/blender/src/editbmesh_select.c (rev 0)
+++ branches/bmesh/source/blender/src/editbmesh_select.c 2007-09-07 12:29:41 UTC (rev 11961)
@@ -0,0 +1,105 @@
+/**
+ * editbmesh_select.c July 2007
+ *
+ * Blender Editmode Tools Interface
+ *
+ * $Id: BME_eulers.c,v 1.00 2007/01/17 17:42:01 Briggs Exp $
+ *
+ * ***** 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) 2004 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Geoffrey Bantle.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ **/
+
+#include "MEM_guardedalloc.h"
+
+#include "BSE_edit.h"
+
+#include "BKE_bmesh.h"
+#include "BKE_mesh.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_customdata.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_depsgraph.h"
+#include "BKE_utildefines.h"
+#include "BKE_object.h"
+
+#include "DNA_meshdata_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
+#include "DNA_customdata_types.h"
+#include "DNA_view3d_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_space_types.h"
+
+#include "BLI_PointerArray.h"
+#include "BLI_memarena.h"
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "BIF_space.h"
+#include "BIF_screen.h"
+#include "BIF_resources.h"
+#include "BIF_language.h"
+#include "BIF_transform.h"
+
+#include "BDR_editobject.h"
+#include "BDR_drawobject.h"
+
+#include "BSE_drawview.h"
+
+#include "mydevice.h"
+
+void EM_deselectall_mesh(void){
+ BME_Vert *v;
+ BME_Edge *e;
+ BME_Poly *f;
+
+ int select;
+
+ if(G.obedit->lay & G.vd->lay){
+ if(G.scene->selectmode & SCE_SELECT_VERTEX){
+ if(G.totvertsel) select = 0;
+ else select = 1;
+ for(v=BME_first(G.editMesh,BME_VERT);v;v=BME_next(G.editMesh,BME_VERT,v))BME_select_vert(G.editMesh,v,select);
+ }
+ if(G.scene->selectmode & SCE_SELECT_EDGE){
+ if(G.totedgesel) select = 0;
+ else select = 1;
+ for(e=BME_first(G.editMesh,BME_EDGE);e;e=BME_next(G.editMesh,BME_EDGE,e))BME_select_edge(G.editMesh,e,select);
+ }
+ if(G.scene->selectmode & SCE_SELECT_FACE){
+ if(G.totfacesel) select = 0;
+ else select = 1;
+ for(f=BME_first(G.editMesh,BME_POLY);f;f=BME_next(G.editMesh,BME_POLY,f))BME_select_poly(G.editMesh,f,select);
+ }
+ }
+
+ countall();
+ DAG_object_flush_update(G.scene,G.obedit,OB_RECALC_DATA);
+ allqueue(REDRAWVIEW3D,0);
+}
\ No newline at end of file
Modified: branches/bmesh/source/blender/src/space.c
===================================================================
--- branches/bmesh/source/blender/src/space.c 2007-09-07 08:09:41 UTC (rev 11960)
+++ branches/bmesh/source/blender/src/space.c 2007-09-07 12:29:41 UTC (rev 11961)
@@ -1660,7 +1660,7 @@
else {
if(G.obedit) {
if(G.obedit->type==OB_MESH)
- deselectall_mesh();
+ EM_deselectall_mesh();
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
deselectall_nurb();
else if(G.obedit->type==OB_MBALL)
More information about the Bf-blender-cvs
mailing list