{"id":286,"date":"2019-02-17T23:37:58","date_gmt":"2019-02-18T07:37:58","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=286"},"modified":"2019-02-18T00:00:24","modified_gmt":"2019-02-18T08:00:24","slug":"archived-post-by-antidistinctlyminty-2","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2019\/02\/17\/archived-post-by-antidistinctlyminty-2\/","title":{"rendered":"Archived post by Antidistinctlyminty"},"content":{"rendered":"<p class=\"\">@mestela You can get hou in a regular Python shell<\/p>\n<p class=\"\">On windows you have to set the `HFS` environment variable<\/p>\n<p class=\"\">I have a script that I run via an `import`<\/p>\n<p class=\"\">&#8220;`python &#8221;&#8217;Set up the environment so that &#8220;import hou&#8221; works.&#8221;&#8217; import sys, os<br \/>\n# Importing hou will load in Houdini&#8217;s libraries and initialize Houdini. # In turn, Houdini will load any HDK extensions written in C++.  These # extensions need to link against Houdini&#8217;s libraries, so we need to # make sure that the symbols from Houdini&#8217;s libraries are visible to # other libraries that Houdini loads.  So, we adjust Python&#8217;s dlopen # flags before importing hou.<br \/>\n# This needs to be set previous to calling the script hfs = os.environ[&#8216;hfs&#8217;]<br \/>\nif hasattr(sys, &#8220;setdlopenflags&#8221;):     old_dlopen_flags = sys.getdlopenflags()     import DLFCN     sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL)<br \/>\ntry:     import hou except ImportError:     # Add $HFS\/houdini\/python2.7libs to sys.path so Python can find the     # hou module.     os.environ[&#8216;path&#8217;] = &#8216;{};{}\\bin&#8217;.format(os.environ[&#8216;path&#8217;], hfs)     sys.path.append(os.path.join(hfs, &#8216;houdini&#8217;, &#8216;python2.7libs&#8217;))     import hou finally:     if hasattr(sys, &#8220;setdlopenflags&#8221;):         sys.setdlopenflags(old_dlopen_flags)&#8220;`<\/p>\n","protected":false},"excerpt":{"rendered":"<p>@mestela You can get hou in a regular Python shell On windows you have to set the `HFS` environment variable I have a script that I run via an `import` &#8220;`python &#8221;&#8217;Set up the environment so that &#8220;import hou&#8221; works.&#8221;&#8217; import sys, os # Importing hou will load in Houdini&#8217;s libraries and initialize Houdini. # &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2019\/02\/17\/archived-post-by-antidistinctlyminty-2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by Antidistinctlyminty<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-286","post","type-post","status-publish","format-standard","hentry","category-hou-programming"],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"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=286"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}