[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3208] contrib/py/scripts/addons: SVN maintenance.
gsr b3d
gsr.b3d at infernal-iceberg.com
Wed Apr 4 04:46:51 CEST 2012
Revision: 3208
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3208
Author: gsrb3d
Date: 2012-04-04 02:46:40 +0000 (Wed, 04 Apr 2012)
Log Message:
-----------
SVN maintenance.
Modified Paths:
--------------
contrib/py/scripts/addons/mesh_face_info_select.py
contrib/py/scripts/addons/space_view3d_paint_bprojection.py
Property Changed:
----------------
contrib/py/scripts/addons/mesh_face_info_select.py
Modified: contrib/py/scripts/addons/mesh_face_info_select.py
===================================================================
--- contrib/py/scripts/addons/mesh_face_info_select.py 2012-04-03 23:31:10 UTC (rev 3207)
+++ contrib/py/scripts/addons/mesh_face_info_select.py 2012-04-04 02:46:40 UTC (rev 3208)
@@ -1,124 +1,124 @@
-# ##### 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-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.",
- "warning": "",
- "wiki_url": "",
- "tracker_url": "",
- "support": 'TESTING',
- "category": "Mesh"
-}
-
-# Written by CoDEmanX for frivus
-
-
-import bpy
-from bpy.props import EnumProperty
-
-class DATA_OP_facetype_select(bpy.types.Operator):
- '''Selects all faces of a certain type'''
- bl_idname = "data.facetype_select"
- bl_label = "Select by face type"
- bl_options = {'REGISTER', 'UNDO'}
-
- face_type = EnumProperty(name="Select faces:",
- items = (("3","Triangles","Faces made up of 3 vertices"),
- ("4","Quads","Faces made up of 4 vertices"),
- ("5","Ngons","Faces made up of 5 and more vertices")),
- default = "5")
- @classmethod
- def poll(cls, context):
- return context.active_object is not None and context.active_object.type == 'MESH'
-
- def execute(self, context):
-
- bpy.ops.object.mode_set(mode='EDIT')
- bpy.ops.mesh.select_all(action='DESELECT')
- 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')
- elif self.face_type == "4":
- bpy.ops.mesh.select_by_number_vertices(number=4, type='EQUAL')
- else:
- bpy.ops.mesh.select_by_number_vertices(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"
-
- @classmethod
- def poll(self, context):
- return context.active_object is not None and context.active_object.type == 'MESH'
-
- def draw(self, context):
- layout = self.layout
-
- ob = context.active_object
-
- info_str = ""
- tris = quads = ngons = 0
-
- for p in ob.data.polygons:
- count = len(p.loops)
- if count == 3:
- tris += 1
- elif count == 4:
- quads += 1
- else:
- ngons += 1
-
- info_str = " Ngons: %i Quads: %i Tris: %i" % (ngons, quads, tris)
-
- col = layout.column()
- col.label(info_str, icon='MESH_DATA')
-
- col = layout.column()
- col.label("Select faces by type:")
-
- row = layout.row()
- row.operator("data.facetype_select", text="Ngons").face_type = "5"
- row.operator("data.facetype_select", text="Quads").face_type = "4"
- row.operator("data.facetype_select", text="Tris").face_type = "3"
-
-
-def register():
- bpy.utils.register_class(DATA_PT_info_panel)
- bpy.utils.register_class(DATA_OP_facetype_select)
-
-
-def unregister():
- bpy.utils.unregister_class(DATA_PT_info_panel)
- bpy.utils.unregister_class(DATA_OP_facetype_select)
-
-
-if __name__ == "__main__":
- register()
+# ##### 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+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.",
+ "warning": "",
+ "wiki_url": "",
+ "tracker_url": "",
+ "support": 'TESTING',
+ "category": "Mesh"
+}
+
+# Written by CoDEmanX for frivus
+
+
+import bpy
+from bpy.props import EnumProperty
+
+class DATA_OP_facetype_select(bpy.types.Operator):
+ '''Selects all faces of a certain type'''
+ bl_idname = "data.facetype_select"
+ bl_label = "Select by face type"
+ bl_options = {'REGISTER', 'UNDO'}
+
+ face_type = EnumProperty(name="Select faces:",
+ items = (("3","Triangles","Faces made up of 3 vertices"),
+ ("4","Quads","Faces made up of 4 vertices"),
+ ("5","Ngons","Faces made up of 5 and more vertices")),
+ default = "5")
+ @classmethod
+ def poll(cls, context):
+ return context.active_object is not None and context.active_object.type == 'MESH'
+
+ def execute(self, context):
+
+ bpy.ops.object.mode_set(mode='EDIT')
+ bpy.ops.mesh.select_all(action='DESELECT')
+ 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')
+ elif self.face_type == "4":
+ bpy.ops.mesh.select_by_number_vertices(number=4, type='EQUAL')
+ else:
+ bpy.ops.mesh.select_by_number_vertices(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"
+
+ @classmethod
+ def poll(self, context):
+ return context.active_object is not None and context.active_object.type == 'MESH'
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.active_object
+
+ info_str = ""
+ tris = quads = ngons = 0
+
+ for p in ob.data.polygons:
+ count = len(p.loops)
+ if count == 3:
+ tris += 1
+ elif count == 4:
+ quads += 1
+ else:
+ ngons += 1
+
+ info_str = " Ngons: %i Quads: %i Tris: %i" % (ngons, quads, tris)
+
+ col = layout.column()
+ col.label(info_str, icon='MESH_DATA')
+
+ col = layout.column()
+ col.label("Select faces by type:")
+
+ row = layout.row()
+ row.operator("data.facetype_select", text="Ngons").face_type = "5"
+ row.operator("data.facetype_select", text="Quads").face_type = "4"
+ row.operator("data.facetype_select", text="Tris").face_type = "3"
+
+
+def register():
+ bpy.utils.register_class(DATA_PT_info_panel)
+ bpy.utils.register_class(DATA_OP_facetype_select)
+
+
+def unregister():
+ bpy.utils.unregister_class(DATA_PT_info_panel)
+ bpy.utils.unregister_class(DATA_OP_facetype_select)
+
+
+if __name__ == "__main__":
+ register()
Property changes on: contrib/py/scripts/addons/mesh_face_info_select.py
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: contrib/py/scripts/addons/space_view3d_paint_bprojection.py
===================================================================
--- contrib/py/scripts/addons/space_view3d_paint_bprojection.py 2012-04-03 23:31:10 UTC (rev 3207)
+++ contrib/py/scripts/addons/space_view3d_paint_bprojection.py 2012-04-04 02:46:40 UTC (rev 3208)
@@ -1023,4 +1023,4 @@
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
- register()
\ No newline at end of file
+ register()
More information about the Bf-extensions-cvs
mailing list