this works but I feel like it’s a hack
“`py node = hou.pwd() stage = node.editableStage()
prim = stage.GetPrimAtPath(‘/geo/points_0’)
ptsattrib = prim.GetAttribute(‘points’)
ptsarray = prim.GetAttribute(‘points’).Get()
ptsattrib.Set(ptsarray[::10]) “` weirdly enough the python version doesn’t seem to affect the HoudiniDataId while the vex version sets it to -1 which makes me go hmmmmm
“`py node = hou.pwd() stage = node.editableStage()
prim = stage.GetPrimAtPath(‘/geo/points_0’)
attribs = prim.GetAttributes()
for attrib in attribs:
interp = attrib.GetMetadata(“interpolation”)
if interp == “vertex”:
valarray = attrib.Get() attrib.Set(valarray[::10]) “` this makes more sense as if you have more primvars on your points you would wanna slice those arrays as well
the 10 here drives the percentage of points you want, setting it to 10 gives me 10 percent of my original pointcount
to get 5% you would do 20 because 100/20
“`py node = hou.pwd() stage = node.editableStage()
for prim in stage.Traverse():
if not prim.GetTypeName() == ‘Points’:
continue
attribs = prim.GetAttributes()
for attrib in attribs:
interp = attrib.GetMetadata(“interpolation”)
if interp == “vertex”:
valarray = attrib.Get() attrib.Set(valarray[::10]) “` here’s a version that will cull all your point clouds to keep only 10%. Might be slow if you have a large stage as I’m doing a stage traversal here
this won’t work for an animated pointcloud though
hold on
right, here’s a file with a static point cloud, animated(time dependent), animated(time samples)
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20245502/17/24/image.png
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20245502/17/24/waffles_cull_points_solaris.hip