Category: copy/paste UVs
[blender-addons-contrib.git] / mesh_face_info_select.py
index cd9d48de45e0dbcdbe59fe534aac260461f0e2d5..63966a315b6301670cad2193e74f1e29b6ca24e4 100644 (file)
@@ -20,12 +20,13 @@ bl_info = {
     "name": "Face info / select by type",
     "author": "CoDEmanX",
     "version": (0, 0, 3),
-    "blender": (2, 6, 2),
-    "location": "Object data > Face info / select",
-    "description": "Displays triangle, quad and ngon count of the active object. Allows to select faces by these type.",
+    "blender": (2, 62, 0),
+    "location": "Properties > Object data > Face info / select",
+    "description": "Displays triangle, quad and ngon count of the active object. Allows to select faces by these types.",
     "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
+        "Scripts/Mesh/Face_Info_Select",
+    "tracker_url": "https://developer.blender.org/T31926",
     "support": 'TESTING',
     "category": "Mesh"
 }
@@ -36,8 +37,8 @@ bl_info = {
 import bpy
 from bpy.props import EnumProperty
 
-class DATA_OP_facetype_select(bpy.types.Operator):
-    '''Selects all faces of a certain type'''
+class DATA_OT_facetype_select(bpy.types.Operator):
+    """Select all faces of a certain type"""
     bl_idname = "data.facetype_select"
     bl_label = "Select by face type"
     bl_options = {'REGISTER', 'UNDO'}
@@ -58,22 +59,22 @@ class DATA_OP_facetype_select(bpy.types.Operator):
         context.tool_settings.mesh_select_mode=(False, False, True)
 
         if self.face_type == "3":
-            bpy.ops.mesh.select_by_number_vertices(number=3, type='EQUAL')
+            bpy.ops.mesh.select_face_by_sides(number=3, type='EQUAL')
         elif self.face_type == "4":
-            bpy.ops.mesh.select_by_number_vertices(number=4, type='EQUAL')
+            bpy.ops.mesh.select_face_by_sides(number=4, type='EQUAL')
         else:
-            bpy.ops.mesh.select_by_number_vertices(number=4, type='GREATER')
+            bpy.ops.mesh.select_face_by_sides(number=4, type='GREATER')
 
         return {'FINISHED'}
-        
+
 
 class DATA_PT_info_panel(bpy.types.Panel):
     """Creates a face info / select panel in the Object properties window"""
     bl_label = "Face info / select"
-    bl_idname = "DATA_PT_face_info"
     bl_space_type = "PROPERTIES"
     bl_region_type = "WINDOW"
     bl_context = "data"
+    bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(self, context):
@@ -83,7 +84,7 @@ class DATA_PT_info_panel(bpy.types.Panel):
         layout = self.layout
 
         ob = context.active_object
-        
+
         info_str = ""
         tris = quads = ngons = 0
 
@@ -97,7 +98,7 @@ class DATA_PT_info_panel(bpy.types.Panel):
                 ngons += 1
 
         info_str = "  Ngons: %i  Quads: %i  Tris: %i" % (ngons, quads, tris)
-        
+
         col = layout.column()
         col.label(info_str, icon='MESH_DATA')
 
@@ -112,12 +113,12 @@ class DATA_PT_info_panel(bpy.types.Panel):
 
 def register():
     bpy.utils.register_class(DATA_PT_info_panel)
-    bpy.utils.register_class(DATA_OP_facetype_select)
+    bpy.utils.register_class(DATA_OT_facetype_select)
 
 
 def unregister():
     bpy.utils.unregister_class(DATA_PT_info_panel)
-    bpy.utils.unregister_class(DATA_OP_facetype_select)
+    bpy.utils.unregister_class(DATA_OT_facetype_select)
 
 
 if __name__ == "__main__":