Point Cloud Visualizer

Yes, it’s there. It’s a 4MB file.

it should be around 0.5mb… if you replace with space_view3d_point_cloud_visualizer.py from zip downloaded from repo, will it work?

1 Like

Yes! That works. Thank you :heart:

So I guess the mistake I made was i downloaded the .py file from the list at the top of the page instead of the repo archive.

PS. Also, i just noticed that someone else had the same issue earlier in the thread. I should have gone through it before posting.

no problem, i guess what happened is you downloaded web page instead of raw script

1 Like

Hello, first of all, thank you very much for the addon. Is there a roadmap for the project? I’m looking forward features such as opening an octree (generated by potree or other) to load point clouds greater than a billion points.

Or the multithreading of the conversion from point cloud to mesh (triangle or cube or other) because this is currently the most time consuming part of my creation process.

Or to have the light and shadows interact with the point cloud (just like the addon unreal engine 4 LiDAR Point Cloud).

no not really, apart from refactoring (now) and putting (soon) it on blendermarket for sale to support further development. if that goes well, then i can focus on something else apart from my needs :slight_smile:

yea, that’s how python works and i used every trick i know to make it the fastest
but this one actually might be doable with multiprocessing module with on the other hand much higher ram usage

i’ll have a look, but no promises. this might be well outside of my shader knowledge

2 Likes

by the way, if you click the car button (not quite intuitive, car as speed… :slight_smile: ) next to convert button, when you click convert it will launch much faster numpy implementation. how faster? well, it is faster in general because most of calculation is in numpy without blender stuff and it depends on chosen mesh type, the more vertices in instance the faster it is in comparison. and result is triangles only. i added this in one of latest updates, didn’t much announced it…

also i looked a bit into multiprocessing, it seems that the code you want to run in parallel must be pickle-able (pickle, python module) and because blender Matrix and Vector classes can’t be pickled (they actually are implemented in C), so much for that. will look into it more, because i would like it faster too, but…

My point cloud is not showing up in Blender. At first it said no vertex normals. I fixed that in cloudcompare and now I dont get that notification of no vertex normals. When I hit draw, it does not populate. I put it on empty axis as well. Thoughts?

hi, would you share the not drawing ply so i can have a look? you can delete most of the points and export it the same way from cc. or at least open ply in text editor and send the first few lines at least until end_header line.
also do you have any errors? can you start blender from terminal (or cmd) and send me the output? if there is any while you try to load that ply?

and one more thing came to my mind. in case everything seems to be normal, no error, it looks like points are loaded and with correct count in info, maybe points are either moved too far away or scaled that are not visible. blender’s viewport is clipped by default from 0.1 to 1000 units/meters. what is outside this range is not visible…

Hi,
Thanks so much for developing this plugin.
I’m not getting any color on my point cloud (confirmed that it has color by opening in Meshlab). I’ve got “colors” checked under the Convert menu (actually it’s kind of greyed out and I can’t even uncheck it, not sure if that’s important).
In the material nodes I’ve got Attribute sending Color to Base Color in the Principled BSDF, which is going to Material Output.
Is there something else I need to take care of in a menu or something I should check in the file?
Thanks again.

hi, if you don’t get colors in viewport, then colors are not loaded for some reason. can you send me the ply file to have a look?

Here’s a link: https://drive.google.com/open?id=1iOc0v_d3XHkm5P6qmR2NwsIS3nyenRux

I can’t upload files here yet because my account is too new.

Thanks for taking a look!

hello, reinstall from repo. just fixed it… your ply defines colors in not very standard way (as property uchar diffuse_red property uchar diffuse_green property uchar diffuse_blue), but according to the best ply docs out there: http://paulbourke.net/dataformats/ply/ it is possible, and if meshlab reads it, i can do it as well. also your ply defines some property float psz which i have no idea what it is, so i ignore it, PCV won’t do anything with it anyway…
cheers

2 Likes

Thanks so much, it’s working perfectly.

I don’t know too much about ply files, but originally this was generated by VisualSFM. Maybe VisualSFM just outputs things a little strangely or maybe I should look at the export options from it closely.

Edit: I should mention that VisualSFM outputs NVM files, which I export as a PLY from meshlab - maybe that has something to do with the strange color data?

Hi im extremely new to blender, and im wondering why my mesh turns grey after converting from point cloud. How do I go about applying back the colour onto the mesh for rendering?

colors are in vertex colors on mesh. you will see them if you go to vertex paint mode.
vertex colors can be used in material during rendering in cycles like here: https://blender.stackexchange.com/questions/19459/how-can-vertex-paint-be-rendered

Hi Carbon2,

It is a really great job you have done with this addon and thank you so much for that.

I am a newbie to blender and I have a large point cloud data (2 gb) and i want to import it to Unity somehow. So since i need to convert this .ply file to .fbx file, i am using your addon. It is working really great with small pieces of ply files however if the .ply data is large then blender is crashing. So since i understood that i cannot convert this ply file as one piece, i split that file into much more smaller pieces. The problem is now to import that 1000 pieces and convert them. Since i cannot do that job one by one i am trying use a py script in blender to import those, and convert them and after export them. I somehow managed to draw the ply file using “c.draw(vs , None,None)” but i am not sure i am loading the data correctly. So my questions are:

  • How can i load the ply files correctly in the script,
  • How can i convert the the drawn ply files.

Thanks a lot in advance.

Here is the script:

import bpy
import glob
import os
import numpy as np
from space_view3d_point_cloud_visualizer import PCVControl
from space_view3d_point_cloud_visualizer import PCV_PT_convert
from space_view3d_point_cloud_visualizer import PCV_OT_convert
from addon_utils import check, paths, enable

#create empty arrows
axes_exist = ‘pcd_axes’ in bpy.data.objects
if(axes_exist):
bpy.data.objects[“pcd_axes”].select_set(True)
bpy.ops.object.delete()

pcd_axes = bpy.data.objects.new( “pcd_axes”, None )
bpy.context.collection.objects.link( pcd_axes )
pcd_axes.empty_display_type = ‘ARROWS’

#select empty arrows
bpy.data.objects[“pcd_axes”].select_set(True)
bpy.context.view_layer.objects.active = bpy.data.objects[‘pcd_axes’]

#bpy.context.object.point_cloud_visualizer.filepath = “\MD3_0.1_50_[7][15].ply”
#bpy.context.object.point_cloud_visualizer.load_ply_to_cache()

o = bpy.context.active_object
path = “<>\MD3_0.1_50_[7][15].ply”

o.point_cloud_visualizer.filepath = path
o.point_cloud_visualizer.uuid = path
bpy.ops.import_mesh.ply(filepath = path)
c = PCVControl(o)

bpy.context.view_layer.objects.active = bpy.data.objects[‘MD3_0.1_50_[7][15]’]

obj = bpy.context.active_object
v = obj.data.vertices[0]

coords = [(obj.matrix_world @ v.co) for v in obj.data.vertices]
vs = coords

bpy.context.view_layer.objects.active = bpy.data.objects[‘pcd_axes’]

c.draw(vs,None,None)

PCV_OT_convert(o.point_cloud_visualizer) # doesnt work!

it is registered operator, so you go just with this:
bpy.ops.point_cloud_visualizer.convert()
object with loaded cloud have to be selected/active and cloud have to be drawn (if i remember right)
before calling you can set options on object with for example
o.point_cloud_visualizer.mesh_type = 'CUBE'
if you check Python Tooltips in blender preferences > interface you can read property/operator python names if hover over ui element

but i can’t understand what are you trying to achieve
Convert makes mesh, but it is meant to do renderable mesh, useable in cycles.
or if you convert to vertices only, normals and colors are lost because blender can’t have vertex colors without faces and normals are always recalculated. so if you export to fbx you get something else…
would be better to look for direct ply importer for unity?

Thanks for this!

I’ve been looking for a way to render a 360 view of a point cloud for youtube360/facebook. However using F12 to render an image, the point cloud does not seem to show up. When rendering via the point cloud visualiser add-on, I can’t seem to set it to 360 equirectangular (or follow the settings of my camera). I’m not super familiar with blender so this might be obvious, but am I missing something or is this not possible at the moment?