アストラルプリズム

PC、スマホ、ゲームなどの備忘録と日記

Blender python mesh について

メモメモ・・・

obj = bpy.context.object
msh = bpy.data.meshes[obj.data.name]

#面に含まれる頂点のidをまとめて出力
msh.polygons[0].vertices[0:]

#ループでidを使いたい時
 p = msh.polygons[0]
for i , id in enumerate(p.vertices):
...     print(id)
...     
0
4
6
2

#選択(オブジェクトモードでコマンド使用後編集モードへ移動する)
#(どの頂点か調べやすくていい)
msh.vertices[0].select=True