~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to release/scripts/templates_py/bmesh_simple.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This example assumes we have a mesh object selected
 
2
 
 
3
import bpy
 
4
import bmesh
 
5
 
 
6
# Get the active mesh
 
7
me = bpy.context.object.data
 
8
 
 
9
 
 
10
# Get a BMesh representation
 
11
bm = bmesh.new()   # create an empty BMesh
 
12
bm.from_mesh(me)   # fill it in from a Mesh
 
13
 
 
14
 
 
15
# Modify the BMesh, can do anything here...
 
16
for v in bm.verts:
 
17
    v.co.x += 1.0
 
18
 
 
19
 
 
20
# Finish up, write the bmesh back to the mesh
 
21
bm.to_mesh(me)
 
22
bm.free()  # free and prevent further access