Created
August 22, 2016 13:39
-
-
Save jirihnidek/755492700ed6aa84ff62500a60abcffe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import bmesh | |
obj = bpy.context.active_object | |
mesh = obj.data | |
bmsh = bmesh.new() | |
bmsh.from_mesh(mesh) | |
# Do something with mesh: e.g. add layer | |
layer = bmsh.verts.layers.int.new('Example') | |
for id,vert in enumerate(bmsh.verts): | |
vert[layer] = id | |
print(id, vert, vert[layer]) | |
bmsh.to_mesh(mesh) | |
mesh.mesh.update_tag() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment