{"id":16,"date":"2007-03-10T15:12:29","date_gmt":"2007-03-10T23:12:29","guid":{"rendered":"http:\/\/www.davidcorral.com\/?p=16"},"modified":"2014-03-27T00:16:50","modified_gmt":"2014-03-27T07:16:50","slug":"house-of-card","status":"publish","type":"post","link":"http:\/\/www.davidcorral.com\/?p=16","title":{"rendered":"House of Cards"},"content":{"rendered":"<p>Test done with the Radiohead&#8217;s clip &#8216;House of Cards&#8217;. I wrote a python script to import the Cvs data into Houdini. It imports point position and intensity.<\/p>\n<p>If you are interested to do some experiments with the data, you can find the project here:<\/p>\n<p><a href=\"http:\/\/http:\/\/code.google.com\/creative\/radiohead\/\">http:\/\/code.google.com\/creative\/radiohead\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>First test using a particleFluidSurface\u00c2\u00a0SOP node to create a mesh on the point cloud data:<\/p>\n<p>[vimeo width=&#8221;460&#8243; height=&#8221;342&#8243;]http:\/\/www.vimeo.com\/21334136[\/vimeo]<\/p>\n<p>&nbsp;<\/p>\n<p>Playblast from viewport showing the point colors in action.<\/p>\n<p>[vimeo width=&#8221;460&#8243; height=&#8221;342&#8243;]http:\/\/www.vimeo.com\/21334261[\/vimeo]<\/p>\n<p>&nbsp;<\/p>\n<p>Final test, using some random techniques:<\/p>\n<p>[vimeo width=&#8221;460&#8243; height=&#8221;342&#8243;]http:\/\/www.vimeo.com\/9198820[\/vimeo]<\/p>\n<p>&nbsp;<\/p>\n<p>This is the code I wrote to import the point cloud data into Houdini, nothing fancy, but it can give you a good start point.<br \/>\n[python]<\/p>\n<p>import hou<\/p>\n<p>path = &#8220;D:\\shared\\HoC\\HoC_AnimationData\\\\&#8221;<br \/>\ngeoNode = hou.node(&#8216;\/obj&#8217;).createNode(&#8216;geo&#8217;)<\/p>\n<p>for i in range(1,2102):#2101<br \/>\nf = open(path + str(i) + &#8220;.csv&#8221;)<\/p>\n<p>#get info<br \/>\nposition = []<br \/>\nfor line in f:<br \/>\ninfo=line.split(&#8220;,&#8221;)<br \/>\nt = info[3].replace(&#8220;\\n&#8221;,&#8221;&#8221;)<br \/>\nposition.append((info[0],info[1],info[2],t))<\/p>\n<p>f.close()<\/p>\n<p>#create add node<br \/>\naddNode = geoNode.createNode(&#8220;add&#8221;)<br \/>\naddNode.parm(&#8216;points&#8217;).set(len(position))<\/p>\n<p>#set add node<br \/>\nfor p in range(len(position)):<br \/>\n#active point<br \/>\naddNode.parm(&#8220;usept&#8221; + str(p)).set(1)<\/p>\n<p>#position<br \/>\naddNode.parm(&#8220;pt&#8221; + str(p) + &#8220;x&#8221;).set(position[p][0])<br \/>\naddNode.parm(&#8220;pt&#8221; + str(p) + &#8220;y&#8221;).set(position[p][1])<br \/>\naddNode.parm(&#8220;pt&#8221; + str(p) + &#8220;z&#8221;).set(position[p][2])<\/p>\n<p>#intensity<br \/>\ncolor = float(position[p][3])\/100<br \/>\naddNode.parm(&#8220;weight&#8221; + str(p)).set(color)<\/p>\n<p>#save geometry<br \/>\nhou.node(addNode.path()).geometry().saveToFile(path + str(i) + &#8220;.bgeo&#8221;)<br \/>\n#delete geometry<br \/>\naddNode.destroy()<br \/>\ngeoNode.destroy()<br \/>\n[\/python]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Test done with the Radiohead&#8217;s clip &#8216;House of Cards&#8217;. I wrote a python script to import the Cvs data into Houdini. It imports point position and intensity. If you are interested to do some experiments with the data, you can find the project here: http:\/\/code.google.com\/creative\/radiohead\/ &nbsp; First test using a particleFluidSurface\u00c2\u00a0SOP node to create a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16"}],"version-history":[{"count":0,"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.davidcorral.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}