import-ply-as-verts v2.0
Blender 3.0 * / 3.1 Alpha (and later) New PLY Importer
- * Vertex colored mesh only in 3.0 (see Compatibility).
- Complete drop-in replacement for the stock Blender PLY import module.
- Correctly loads vertex-colored point clouds and nonstandard PLY files that the original importer wasn't intended for.
- Retains the functionality of the original codebase.
Free at our Github Repository
Why
-
Attempting to import any of the below PLY files with the stock importer will fail:
-
Triangle/Quad Meshes with nonstandard file terminators (BTracer2 PLY export)
-
Zero edge/face point cloud files, ie:
-
Mandelbulb3D BTracer Point Cloud (v.1.99 and earlier)
-
Mandelbulb3D BTracer2 PLY (1.99.12 and later)
-
J-Wildfire Point Cloud (Some incompatible edge cases may yet exist. They will be patched as needed.
-
Photogrammetry scans (MeshLab, et. al.)
-
-
The result in Blender is the system console window error message “Invalid header, etc…”
Which has proven most frustrating for several years now.
Prior to this, a good workaround was to process the point cloud in MeshLab. I love MeshLab and use it often, but it is daunting at best. The real idea was to have native Blender import.
Recent functions added under the hood of the Realize Instances node suddenly dovetailed with a standalone instancing app I had been working on since 2017. Realizing that six nodes can replace my entire program, I cheerfully abandoned it and put full effort into the importer.
The combined result is a completely new workflow for the point cloud enthusiast.
Result
(Left to Right, Back Row First)
- Vertex-Painted Suzanne (Same file as Mesh and Verts);
- BTracer2 (Same file as Mesh and Verts);
- J-Wildfire Point Cloud;
- Photogrammetry Point Cloud
All the objects in this scene share a single Material of correctly imported vertex colors. The point clouds have a simple Geometry Node tree applied . (Material and Nodetree included in the Example.blend file).
Compatibility
-
Mesh Import is verified for 3.0 (thanks to Carisma Alex for asking!) and works exactly like the process in Mandelbulb3D - BTracer2 Workflow Basic. However, the Point Cloud object requires new functionality added in Blender 3.1 to correctly assign the colors. Direct import results in a charcoal briquette with missing surface normals. A workaround is to create the Point Cloud in 3.1 (with applied Geo Node Modifier), save as a .blend file or export to a modern format like .gltf, and open in 3.0. “Shade Smooth” appears to work incorrectly when doing so.
Install
Since these are Scripts and not an Addon, the __init__.py
and import_ply.py
files from the repo will need to be manually pasted alongside the stock importer files.
-
Open Blender’s location on your computer. On Windows this is generally 'C:\Program Files\Blender Foundation'
-
If multiple version numbers are present, open the folder of the version you want to upgrade (for our example here, ‘Blender 3.1’)
-
Open the ‘3.1’ folder
-
Open the ‘scripts’ folder
-
Open the ‘addons’ folder
-
Open the ‘io_mesh_ply’ folder
-
Rename
'__init__.py'
to something like'__init__-OLD.py'
-
Remame
'import_ply.py'
to something like'import_ply-OLD.py'
-
Paste in the new
__init__.py
andimport_ply.py
from the repository -
Restart Blender
This will need to be done once for each version of Blender you would like to use the script with. If you want to revert to the original script, reverse steps 7 and 8.
The install procedure is also contained in Install-v2.pdf
and How to Install v2.0.
Usage
Once the scripts are replaced, File->Import will now look like this:
Selecting Stanford PLY as Verts will bring up the Filebrowser as usual, with an additional checkbox:
Several things may happen at this point:
-
A triangle/quad mesh file may be loaded as either point cloud (checkbox selected) or mesh (checkbox deselected).
-
A point cloud file may be loaded with the checkbox selected.
-
A point cloud file may be loaded with the checkbox deselected, and the autodetect routine will use the correct loading method.
- Known Issue:- a bug in the autodetect slows performance as it causes the file to be read twice. Currently working on a fix.
Known Issues
-
The autodetect bug mentioned above.
-
The checkbox occasionally remains checked despite being False under the hood. This is under investigation.
Roadmap
-
Performance can likely be improved. I haven’t looked too deeply into the read() module which is a common bottleneck in file i/o.
-
Exporting Blender objects as verts is not yet supported. Not a huge priority but will be addressed.
-
Various refactoring.
Tutorials
-
Mandelbulb3D - BTracer2 Workflow Advanced
-
J-Wildfire
-
Photogrammetry Rescue with MeshLab and VisualSFM
-
…
Blog and References
Under construction