I have ply format mesh in edit mode in blender. When I select some vertices , I need the x y z coordinates to be printed as output. Is it possible?
Asked
Active
Viewed 925 times
1
1 Answers
2
As ideasman42 wrote in his comment, this will work for any mesh in edit mode, regardless of whether it was imported from PLY or any other format, or generated within Blender:
import bpy, bmesh
bm = bmesh.from_edit_mesh( bpy.context.object.data )
mw = bpy.context.object.matrix_world
selected_verts_coordinates = [ mw * v.co for v in bm.verts if v.select ]
print( selected_verts_coordinates )
This will only work for selected vertices when the mesh is in edit mode.
TLousky
- 16,043
- 1
- 40
- 72
Its also not clear if this is a single function you want to run, or if you want the select action to always print vertex locations.
– ideasman42 May 03 '16 at 06:53