Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-08-20 14:08:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-08-20 14:08:59 +0400
commite8c39a5864a400971891932a8580d7e0784c334d (patch)
tree78d1f832fb01dbb787e8bcfe7d9f179133729304 /source/blender/python/api2_2x/doc
parent196a3e410458182105b0356d1f9c9230637b216f (diff)
added face sorting to mesh so you can do mesh.faces.sort(...)
uses list sorting internally so is exactly the same as list sorting.
Diffstat (limited to 'source/blender/python/api2_2x/doc')
-rw-r--r--source/blender/python/api2_2x/doc/Mesh.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/doc/Mesh.py b/source/blender/python/api2_2x/doc/Mesh.py
index 05e2657edc4..e572d6a91ae 100644
--- a/source/blender/python/api2_2x/doc/Mesh.py
+++ b/source/blender/python/api2_2x/doc/Mesh.py
@@ -690,6 +690,22 @@ class MFaceSeq:
- a integer, specifying an index into the mesh's face list
"""
+ def sort():
+ """
+ Sorts the faces using exactly the same syntax as pythons own list sorting function.
+
+ Example::
+ import Blender
+ from Blender import Mesh
+ me = Mesh.Get('mymesh')
+
+ me.faces.sort(key=lambda f: f.area)
+
+ me.faces.sort(key=lambda f: f.cent)
+
+ @note: Internally faces only refer to their index, so after sorting, faces you alredy have will not have their index changed to match the new sorted order.
+ """
+
def selected():
"""
Get selected faces.