Last active
December 9, 2022 06:50
-
-
Save lowteq/61aa53823712c419a0fcad2bd8aba098 to your computer and use it in GitHub Desktop.
モディファイアを通した後の頂点座標取得
This file contains 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 | |
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