Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix an important select bug.

Now it doesn't act funky, regardless of your selection mode.
  • Loading branch information...
commit 67ea0e64bbfed56e06761adf007e1c84f41264da 1 parent 7434820
authored May 03, 2012

Showing 1 changed file with 24 additions and 6 deletions. Show diff stats Hide diff stats

  1. 30  meshlint.py
30  meshlint.py
@@ -18,7 +18,7 @@
18 18
 bl_info = {
19 19
     "name": "MeshLint: Like Spell-checking for your Meshes",
20 20
     "author": "rking",
21  
-    "version": (0, 9),
  21
+    "version": (1, 0),
22 22
     "blender": (2, 6, 3),
23 23
     "location": "Object Data properties > MeshLint",
24 24
     "description": "Check objects for: Tris / Ngons / Nonmanifoldness / etc",
@@ -190,12 +190,30 @@ def enable_anything_select_mode(self):
190 190
             self.b.select_mode = {'VERT', 'EDGE', 'FACE'}
191 191
 
192 192
         def select_indices(self, elemtype, indices):
193  
-            # XXX Actually, it's not so simple. You have to make sure major
194  
-            # elements have their minor elements selected, too. Will comply.
195  
-            # TODO find out if flushing is necessary.
196  
-            bmseq = getattr(self.b, elemtype)
197 193
             for i in indices:
198  
-                bmseq[i].select = True
  194
+                if 'verts' == elemtype:
  195
+                    self.select_vert(i)
  196
+                elif 'edges' == elemtype:
  197
+                    self.select_edge(i)
  198
+                elif 'faces' == elemtype:
  199
+                    self.select_face(i)
  200
+                else:
  201
+                    print("MeshLint says: Huh?? → elemtype of %s." % elemtype)
  202
+        
  203
+        def select_vert(self, index):
  204
+            self.b.verts[index].select = True
  205
+
  206
+        def select_edge(self, index):
  207
+            edge = self.b.edges[index]
  208
+            edge.select = True
  209
+            for each in edge.verts:
  210
+                self.select_vert(each.index)
  211
+
  212
+        def select_face(self, index):
  213
+            face = self.b.faces[index]
  214
+            face.select = True
  215
+            for each in face.edges:
  216
+                self.select_edge(each.index)
199 217
 
200 218
         def topology_counts(self):
201 219
             data = self.obj.data

0 notes on commit 67ea0e6

Please sign in to comment.
Something went wrong with that request. Please try again.