Point Cloud Visualizer

1.999.10

Oooh that’s again a great batch of features !
Multi station e57 file import is awesome, it will save me a lot of time ! It worked with pymeshlab but I couldn’t make it work with pye57, it only imports the first cloud. No error in the console. Is there some specific requirement ?

Here’s a test file fwiw

test_2.e57 (5.0 MB)

In CC

using pye57 (also it seems it doesn’t import vertex colors)

image

using pymeshlab

Cheers

it will work now for multi scan files. it was, ehm, my fault, overlook. on the other hand, there is not much documentation for pye57… anyway…

what i noticed is that pymeshlab uses scalar (intensity in this case) instead of colors (if missing), so in pcv, if you enable scalar viewing, you’ll get something similar, only pymeshlab remapping of values seems to be different than mine, but this can adjusted using range, or using color scheme to be better visible

edit: and then with pcv > filter > colorize you can bake scalar into colors if you wish

1 Like

Oh yeah my bad I was so thrilled I didn’t even make sure I was using the latest version, sorry for that ! Thanks for the explanation, that’s clearer now, top notch ! :slight_smile:

1.999.11

  • new Convert option: Mesh To Points, creates vertex mesh with attributes from points, adds geometry nodes that converts vertices to points and assigns colors to points and adds material, with this you get cycles point cloud rendering without need for blender alpha build (works in blender 3.1+)
  • Start Frame setting for ply sequences
  • Split Selected operator for Remove Color and Remove Value filters and selection Tools
  • updated optional packages to latest versions (except open3d which is not yet available for python 3.10 included in blender 3.1+), to update package, click its install button from preferences
  • fixed scalar soft light blend mode formula
  • fixed some primitive drawing types deprecation in blender 3.2
  • fixed viewport name label depth in some situations
  • fixed point selection drawing in some situations
  • fixed center viewport camera view on points operator in some situations and renamed to Frame Points
  • fixed sequence playback not restarting after end of sequence is reached while Cycle Forever is turned off
1 Like

Hi, is it possible to generate point cloud from points made through geonodes? and save them as ply with colors?

interesting question, took me a while, but it is :wink:

lets have some points generated from scratch:

then with this setup:

note Points To Vertices node and defined output attributes and with small script, data can be collected, even with some scalar values

import bpy
import numpy as np
import space_view3d_point_cloud_visualizer as pcv

o = bpy.context.active_object
depsgraph = bpy.context.evaluated_depsgraph_get()
e = o.evaluated_get(depsgraph)
me = e.data
l = len(me.vertices)

vs = np.zeros(l * 3, dtype=np.float32, )
me.vertices.foreach_get('co', vs)
vs.shape = (-1, 3)
ns = np.zeros(l * 3, dtype=np.float32, )
me.attributes['n'].data.foreach_get('vector', ns)
ns.shape = (-1, 3)
cs = np.zeros(l * 4, dtype=np.float32, )
me.attributes['c'].data.foreach_get('color', cs)
cs.shape = (-1, 4)

ds = np.zeros(l, dtype=float, )
me.attributes['d'].data.foreach_get('value', ds)
ii = np.zeros(l, dtype=int, )
me.attributes['i'].data.foreach_get('value', ii)
sc = np.empty(l, dtype=[('distance', float), ('index', int), ], )
sc['distance'] = ds
sc['index'] = ii

v = pcv.mechanist.PCVOverseer(o)
pd = pcv.data.PCVPointData.from_arrays('_.ply', {'vs': vs, 'ns': ns, 'cs': cs, 'scalars': sc, }, )
v.data(pd, True, )

i guess this would make useful tool. i see what i can do. it won’t be easy i guess, too many variable conditions… it will have to require from user to do all setup in nodes and modifier…
anyway, thanks for suggestion/idea!

1 Like

ok, it will be in next release. ui is nothing spectacular, but it can’t be because attributes does not exist until they are evaluated…

1 Like

Awesome !

FWIW for a personal project I created an enum property that fetches the attribute name on the geometry nodes modifier, might be of help somehow instead of typing the names ?

The items method :

def get_output_attributes(self, context):
    o = context.active_object
    mod = o.modifiers[self.mod_name]
    node_tree = mod.node_group
    if node_tree is None:
        return ("",) * 3
    output_node = next((n for n in node_tree.nodes if isinstance(n, bpy.types.NodeGroupOutput)), None)
    if output_node is None:
        return ("",) * 3
    inputs = output_node.inputs
    for input in inputs[1:-1]:
        yield (input.identifier + "_attribute_name", input.name, input.identifier)

Here’s how I use it :

capture

thanks, but i think typing names is the safest. if the attribute is in evaluated data, all is good, if not, report and stop. for example what if you happen to have two geonodes modifiers, each outputting different attributes? in evaluated data you get both attributes. looping over all modifiers and collecting all outputs and deciding which overwrites which, if at all… don’t like it much.

edit: and if you are particularly nasty, you can delete attribute in nodes

Wow, thanks. I was able to recreate those points rendered however it didnt export. Anyway, the tool is very helpful for my current project, thanks. That is very pity blender cant save particles/points into ABC or ply from the box.

Also, I wanted to ask if it is possible to add functionality to allow the export of multiple point clouds generated from the different objects in the scene into one ply file?

eh, don’t understand, sorry, is it something with pcv? or something else? don’t run the code i used for demonstration, it is for that case only.

select all object that have pcv with loaded and displayed points, on one pcv go PCV > Filter > Join, with default settings it will join all points to a new empty with new pcv on it and shuffles all points together. then it will unload all used, so for generated points you might want to disable that option. then from new pcv with all points you can export ply (PCV > Export)

1 Like

Hi, I`m trying to generate point cloud from particle system on the object but getting error

BMElemSeq[key]: invalid key, key must be an int

what does it mean?

Also error appears only when vertex colors are the source for coloring

can you please run blender from command line and post here full error? this it does not help much :frowning:
https://docs.blender.org/manual/en/dev/advanced/command_line/launch/index.html

Sorry, I`ve just deleted my vertex colors and created them again, and the error is gone. I will keep it in mind next time.

Hi! Every time i render inside PCV blender gets stuck and it won´t recover. Is there any solution to this issue? thanks

hi, i know about it. it seems to happen only on windows and with 2.0. it’s been reported to me that pcv 1.10 works fine. i suspect it is related to bgl module deprecation. pcv 2.0 does not use bgl, but new gpu module, and it seems to be blender internal bug, but isolating issue is difficult because there is not console message or indication that something went wrong. on mac i have no problems with rendering… so, working i’m on it…

1.999.12

  • generate points from geometry nodes vertices and attributes
  • filter > Remove Value and edit > Select Value (both for scalars) can now select single value instead of range only (input value is converted to scalar data type before selecting, e.g. if scalar is unsigned int then ui input float value is converted positive integer, so input 1.789 will select 1 in integer scalar)
  • filter > Project new parameter Strength, at 1.0 points land on surface, at 0.5 they will move half way and so on
  • filter > Simplify new method option Slice, it does the same as Display > Percentage, but it applies to points directly
  • fixed unresponsive blender ui after render is finished on windows ( @Aepi9 )
  • removed export > visible only, because of confusion, use filter > simplify > slice to get the same result
1 Like