{"id":534,"date":"2021-04-14T16:04:33","date_gmt":"2021-04-14T23:04:33","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=534"},"modified":"2021-04-14T16:30:47","modified_gmt":"2021-04-14T23:30:47","slug":"archived-post-by-toadstorm-22","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2021\/04\/14\/archived-post-by-toadstorm-22\/","title":{"rendered":"Archived post by TOADSTORM"},"content":{"rendered":"<p class=\"\">&#8220;`python import fnmatch import hou<br \/>\ndef glob_attrs(geo, pattern):     all_attrs = list()     out_attrs = list()     all_attrs.extend(geo.pointAttribs())     all_attrs.extend(geo.primAttribs())     all_attrs.extend(geo.vertexAttribs())     all_attrs.extend(geo.globalAttribs())     matches = [f for f in pattern.split() if not f.startswith(&#8220;^&#8221;)]     excludes = [f.strip(&#8220;^&#8221;) for f in pattern.split() if f.startswith(&#8220;^&#8221;)]     for attr in all_attrs:         for pattern in matches:             if fnmatch.fnmatch(attr.name(), pattern):                 out_attrs.append(attr)         for pattern in excludes:             if fnmatch.fnmatch(attr.name(), pattern):                 if attr in out_attrs:                     out_attrs.remove(attr)     out_attrs = list(set(out_attrs))     return out_attrs &#8220;`<\/p>\n<p class=\"\">feed it a Geometry object and a pattern and it&#8217;ll return hou.Attribs<\/p>\n<p class=\"\">no guarantees it isn&#8217;t shit but it might help you<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;`python import fnmatch import hou def glob_attrs(geo, pattern): all_attrs = list() out_attrs = list() all_attrs.extend(geo.pointAttribs()) all_attrs.extend(geo.primAttribs()) all_attrs.extend(geo.vertexAttribs()) all_attrs.extend(geo.globalAttribs()) matches = [f for f in pattern.split() if not f.startswith(&#8220;^&#8221;)] excludes = [f.strip(&#8220;^&#8221;) for f in pattern.split() if f.startswith(&#8220;^&#8221;)] for attr in all_attrs: for pattern in matches: if fnmatch.fnmatch(attr.name(), pattern): out_attrs.append(attr) for pattern in excludes: if fnmatch.fnmatch(attr.name(), &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2021\/04\/14\/archived-post-by-toadstorm-22\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by TOADSTORM<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/534"}],"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=534"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}