Skip to content

Instantly share code, notes, and snippets.

@lowteq
Last active December 9, 2022 06:50
Show Gist options
  • Save lowteq/61aa53823712c419a0fcad2bd8aba098 to your computer and use it in GitHub Desktop.
Save lowteq/61aa53823712c419a0fcad2bd8aba098 to your computer and use it in GitHub Desktop.
モディファイアを通した後の頂点座標取得
import bpy
import bmesh
obj = bpy.context.active_object
depsgraph = bpy.context.evaluated_depsgraph_get()
evalbm = bmesh.new()
evalbm.from_object( obj, depsgraph )
evalbm.verts.ensure_lookup_table()
bm = bmesh.from_edit_mesh(obj.data)
selected_verts = [v for v in bm.verts if v.select]
print( "----" )
print(len(selected_verts))
for v in selected_verts:
print(v.index)
print(evalbm.verts[v.index].co)
bm.free()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment