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>2012-12-30 05:39:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-30 05:39:55 +0400
commit33955940e4931e2184434393e0f8c15c36a5c3c6 (patch)
tree7b3c10343162a256e85ff4346f57122032715e82 /release/scripts/templates_py/bmesh_simple_editmode.py
parente12354c4c5850864f925d22f53ec31578384bc63 (diff)
add templates menu for OSL, use preprocessor directive color for decorators in python.
Diffstat (limited to 'release/scripts/templates_py/bmesh_simple_editmode.py')
-rw-r--r--release/scripts/templates_py/bmesh_simple_editmode.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/release/scripts/templates_py/bmesh_simple_editmode.py b/release/scripts/templates_py/bmesh_simple_editmode.py
new file mode 100644
index 00000000000..d79ba02c2cb
--- /dev/null
+++ b/release/scripts/templates_py/bmesh_simple_editmode.py
@@ -0,0 +1,23 @@
+# This example assumes we have a mesh object in edit-mode
+
+import bpy
+import bmesh
+
+# Get the active mesh
+obj = bpy.context.edit_object
+me = obj.data
+
+
+# Get a BMesh representation
+bm = bmesh.from_edit_mesh(me)
+
+bm.faces.active = None
+
+# Modify the BMesh, can do anything here...
+for v in bm.verts:
+ v.co.x += 1.0
+
+
+# Show the updates in the viewport
+# and recalculate n-gon tessellation.
+bmesh.update_edit_mesh(me, True)