I have a ply file .I need to read the vertices, edges etc. It would be nice to read the ply file in blender and I can program further.
2 Answers
In case anyone else lands here from google looking for the answer, in blender 4.0 they removed the old ply loader implementation, now it is called through wm:
bpy.ops.wm.ply_import(filepath="/path/to.ply")
On the up side, as it is now implemented in C++, it is much faster (also same applies for obj files).
Yes and this applies to most/all other formats.
You can:
- Call the operator from Python:
bpy.ops.import_mesh.ply(filepath="/path/to.ply")
Import the addon module and run the function which is used for importing:
See the source code, its not to hard to see how you would call the load function. eg:from io_mesh_ply import import_ply import_ply.load_ply("/path/to.ply")
-
$\begingroup$ I have an active object in ply format in blender. I need to read ply data of selected surface in mesh. Can you help me with example code. For example I I need the x,y,z coordinates of the selected portion in the ply mesh. .how can I code to get those details. $\endgroup$– kpdkpsCommented May 3, 2016 at 4:49
-
-
$\begingroup$ @kpdkps, please as a question which goes into some detail about whats needed $\endgroup$ Commented May 3, 2016 at 6:38
-
$\begingroup$ 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. @ideasman42 $\endgroup$– kpdkpsCommented May 3, 2016 at 6:44
-
$\begingroup$ @kpdkps, yes, but better ask a separate question. $\endgroup$ Commented May 3, 2016 at 6:45