{"id":785,"date":"2024-02-17T07:55:41","date_gmt":"2024-02-17T15:55:41","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=785"},"modified":"2024-02-17T08:03:12","modified_gmt":"2024-02-17T16:03:12","slug":"archived-post-by-waffleboytom-7","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2024\/02\/17\/archived-post-by-waffleboytom-7\/","title":{"rendered":"Archived post by waffleboytom"},"content":{"rendered":"<div class=\"postie-post\">\n<p class=\"\">this works but I feel like it&#8217;s a hack<\/p>\n<p class=\"\">&#8220;`py node = hou.pwd() stage = node.editableStage()<br \/>\nprim = stage.GetPrimAtPath(&#8216;\/geo\/points_0&#8217;)<br \/>\nptsattrib = prim.GetAttribute(&#8216;points&#8217;)<br \/>\nptsarray = prim.GetAttribute(&#8216;points&#8217;).Get()<br \/>\nptsattrib.Set(ptsarray[::10]) &#8220;` weirdly enough the python version doesn&#8217;t seem to affect the HoudiniDataId while the vex version sets it to -1 which makes me go hmmmmm<\/p>\n<p class=\"\">&#8220;`py node = hou.pwd() stage = node.editableStage()<br \/>\nprim = stage.GetPrimAtPath(&#8216;\/geo\/points_0&#8217;)<br \/>\nattribs = prim.GetAttributes()<br \/>\nfor attrib in attribs:<br \/>\n    interp = attrib.GetMetadata(&#8220;interpolation&#8221;)<br \/>\n    if interp == &#8220;vertex&#8221;:<br \/>\n        valarray = attrib.Get()         attrib.Set(valarray[::10]) &#8220;` this makes more sense as if you have more primvars on your points you would wanna slice those arrays as well<\/p>\n<p class=\"\">the 10 here drives the percentage of points you want, setting it to 10 gives me 10 percent of my original pointcount<\/p>\n<p class=\"\">to get 5% you would do 20 because 100\/20<\/p>\n<p class=\"\">&#8220;`py node = hou.pwd() stage = node.editableStage()<br \/>\nfor prim in stage.Traverse():<br \/>\n    if not prim.GetTypeName() == &#8216;Points&#8217;:<br \/>\n        continue<br \/>\n    attribs = prim.GetAttributes()<br \/>\n    for attrib in attribs:<br \/>\n        interp = attrib.GetMetadata(&#8220;interpolation&#8221;)<br \/>\n        if interp == &#8220;vertex&#8221;:<br \/>\n            valarray = attrib.Get()             attrib.Set(valarray[::10]) &#8220;` here&#8217;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&#8217;m doing a stage traversal here<\/p>\n<p class=\"\">this won&#8217;t work for an animated pointcloud though<\/p>\n<p class=\"\">hold on<\/p>\n<p class=\"\">right, here&#8217;s a file with a static point cloud, animated(time dependent), animated(time samples)<\/p>\n<p>Attachments in this post: <br \/><a href=\"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\/image.png<\/a><br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20245502\/17\/24\/waffles_cull_points_solaris.hip\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20245502\/17\/24\/waffles_cull_points_solaris.hip<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>this works but I feel like it&#8217;s a hack &#8220;`py node = hou.pwd() stage = node.editableStage() prim = stage.GetPrimAtPath(&#8216;\/geo\/points_0&#8217;) ptsattrib = prim.GetAttribute(&#8216;points&#8217;) ptsarray = prim.GetAttribute(&#8216;points&#8217;).Get() ptsattrib.Set(ptsarray[::10]) &#8220;` weirdly enough the python version doesn&#8217;t seem to affect the HoudiniDataId while the vex version sets it to -1 which makes me go hmmmmm &#8220;`py node = hou.pwd() &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2024\/02\/17\/archived-post-by-waffleboytom-7\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by waffleboytom<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/785"}],"collection":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/comments?post=785"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/785\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=785"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}