<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>geneome &#187; Python</title>
	<atom:link href="http://www.geneome.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geneome.com</link>
	<description>Just a guy, into 3D.</description>
	<lastBuildDate>Thu, 04 Mar 2010 23:59:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom:link rel='hub' href='http://www.geneome.com/?pushpress=hub'/>
		<item>
		<title>Houdini Python COM Conclusion</title>
		<link>http://www.geneome.com/2009/04/28/houdini-python-com-conclusion/</link>
		<comments>http://www.geneome.com/2009/04/28/houdini-python-com-conclusion/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 02:01:51 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[Houdini]]></category>
		<category><![CDATA[3DConnexion]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.geneome.com/?p=901</guid>
		<description><![CDATA[After getting something working, and continuing off and on with trying to get it to work, I have come to develop some concepts about using a Python COM method to poll 3DConnexion data.

The operators at the geometry level (the Python operator and Script SOP) are unable to poll the data. This seems to be due [...]]]></description>
			<content:encoded><![CDATA[<p>After getting <em><a href="http://www.geneome.com/2009/04/11/houdini-and-3dconnexion-devices/" target="_self">something</a></em><a href="http://www.geneome.com/2009/04/11/houdini-and-3dconnexion-devices/" target="_self"> working</a>, and continuing off and on with trying to get it to work, I have come to develop some concepts about using a Python COM method to poll 3DConnexion data.</p>
<ol>
<li>The operators at the geometry level (the Python operator and Script SOP) are unable to poll the data. This seems to be due to cooking issues as well as the geometry operators using the hou module only to create/manipulate data.</li>
<li>The operator at the object level (the Python operator) does poll the data, however it seems that this polling becomes the dominant process in Houdini and you can do nothing else or stop the polling.</li>
</ol>
<p>So the conlcusion that can be drawn is that the Python COM method for polling data is not a viable one. The idea of having Houdini write the values of the device to certain parameters and see the results in real-time just doesn&#8217;t seem to work. It is certainly possible I am overlooking something however I&#8217;ve spent a lot of time on this and with <a href="http://forums.odforce.net/index.php?showtopic=8888" target="_blank">a working and better alternative</a> out there now there isn&#8217;t a pressing need to continue. This project has helped me learn a lot about Python in Houdini as well as the common object model so the effort wasn&#8217;t entirely without gain. Now it&#8217;s time to move on and continue to learn more about Houdini!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geneome.com/2009/04/28/houdini-python-com-conclusion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Houdini And 3DConnexion Devices</title>
		<link>http://www.geneome.com/2009/04/11/houdini-and-3dconnexion-devices/</link>
		<comments>http://www.geneome.com/2009/04/11/houdini-and-3dconnexion-devices/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 04:31:26 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Houdini]]></category>
		<category><![CDATA[Video Demos]]></category>
		<category><![CDATA[3DConnexion]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.geneome.com/?p=841</guid>
		<description><![CDATA[UPDATE: I thought I was doing something special and unique but it seems someone has beat me to it. Still, even with all the effort I&#8217;ve put into this (and it still not being totally usable yet), I&#8217;m finding the experience very fulfilling. When even failing is enjoyable, one must take note and realize that [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: I thought I was doing something special and unique but it seems someone has <a href="http://forums.odforce.net/index.php?showtopic=8888" target="_blank">beat me to it</a>. Still, even with all the effort I&#8217;ve put into this (and it still not being totally usable yet), I&#8217;m finding the experience very fulfilling. When even failing is enjoyable, one must take note and realize that you must really love what you&#8217;re doing.</strong><span id="more-841"></span></p>
<p>Yes &#8211; I have something working! Read on for the story and where I&#8217;m at:</p>
<p>I&#8217;ve noticed a problem with a lot of animated shorts and student work: The camera work is atrocious. It seems like all the time is spent on perfecting the modeling, animation, and shading, then in the last 10 minutes of production someone puts in a camera and animates it going to the left. Seeing this as a major issue I thought that there must be a better way to have the camera animated easily and a whole lot better. I then recalled I had a <a href="http://www.3dconnexion.com/3dmouse/spacenavigator.php" target="_blank">3DConnexion SpaceNavigator</a> that I never use because no applications I use support it. The whole line of 3DConnexion devices might be just what animators need to have better control of their camera.</p>
<p>The SpaceNavigator seems ideally suited to be able to control not just a camera but any object in 3 dimensions, provided that the application can see and understand the device. Unfortunately, Houdini is not one of them. So I researched it a bit and found some hope in an <a href="http://www.3dconnexion.com/forum/viewtopic.php?p=5727#5727" target="_blank">obscure post</a> on the 3DConnexion forum. Someone had been able to use Python to poll data from a device using a Python module called <a href="http://sourceforge.net/projects/comtypes/" target="_blank">comtypes</a>, a COM client framework (the Windows SDK for the device is a COM dll).  I tried it in Python 2.5.4 and it worked!  At the time it seemed like a simple thing to add the script in Houdini and replace the trans and rotate prints to &#8220;hou.node(&#8216;/obj/cam1&#8242;).parm(&#8216;my param&#8217;).set(my devices param)&#8221; and get the camera to receive data from the device.  Long story short &#8211; it didn&#8217;t work.  Firstly, Houdini doesn&#8217;t have _ctypes.pyd which is required by the ctypes module (so I added it to Houdini x.x.x\python\lib\ which worked).  Secondly, though it seemed that the device driver was being seen, an error kept posting.</p>
<p>So more research was needed. I thought maybe using the old comtypes (v 0.2.1) with the script from the 3DConnection post was the issue, so I upgraded to comtypes 0.6.0. But if you read the post, only 0.2.1 works with the script. More research&#8230; then after getting <a href="http://www.geneome.com/houdini/scripts/3DConnexionComListener.py">the script</a> to work with 0.6.0, I still got the same error.</p>
<p>So off to <a href="http://forums.odforce.net/index.php?showtopic=8882" target="_blank">odforce</a> I went (to cry for help) which got me thinking more but all of those avenues were dead ends.  Then &#8211; you guessed it &#8211; more research.  Which lead me to figure out what was wrong. My comtypes module in Houdini wasn&#8217;t compiled! I had no .pyc or .pyo files <em>anywhere</em>! And that was it, after I compiled everything using the Python compileall module in Houdini itself it all worked out. Now I can get Houdini&#8217;s command window to print the data from the device just fine. The next step is to see if it&#8217;s feasible to get this data into Houdini beyond printing to a window, but that is for another day (and another post) mainly because some quick tests cause Houdini to freeze up when I try to use the data to send to a parameter.</p>
<p>Here&#8217;s a quick look:</p>
<p><object width="560" height="350"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4112559&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4112559&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="560" height="350"></embed></object>
<p><a href="http://vimeo.com/4112559">Houdini Using A 3DConnexion Device Via Python</a> from <a href="http://vimeo.com/user458080">Geneome</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><span style="text-decoration: line-through;">There are some 32/64-bit issues.</span> The _ctypes.pyd that comes with Python only seems to be compiled for 32-bit machines.  <span style="text-decoration: line-through;">So unless I compile my own 64-bit _cytpes.pyd, this only works with a 32-bit Houdini.</span> You can use a <a href="http://sourceforge.net/project/showfiles.php?group_id=71702" target="_blank">64 bit _ctypes</a>, which works with Houdini 10 64 bit but you need to use a different ctypes module version (1.0.2). As we are using a COM dll to poll data, this is a Windows only method. I need to look at the 3DConnexion SDK for Linux to see if Linux is in the cards through this or some other method.</p>
<p>(See the follow-up <a href="http://www.geneome.com/2009/04/28/houdini-python-com-conclusion/" target="_self">here</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geneome.com/2009/04/11/houdini-and-3dconnexion-devices/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Python 3.0: Chaos Ensues</title>
		<link>http://www.geneome.com/2008/12/04/python-30-chaos-ensues/</link>
		<comments>http://www.geneome.com/2008/12/04/python-30-chaos-ensues/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 19:42:20 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.geneome.net/?p=760</guid>
		<description><![CDATA[I can&#8217;t imagine what effect this update will have on the host of applications using Python as a scripting language. I&#8217;m sure the fact that it is &#8220;intentionally backwards incompatible&#8221; makes a lot of people nervous since if any application (Houdini, Maya, Blender, XSI, TopMod, etc.) move to the new python, lots of peoples scripts [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t imagine what effect <a href="http://www.python.org/download/releases/3.0/" target="_blank">this update</a> will have on the host of applications using Python as a scripting language. I&#8217;m sure the fact that it is &#8220;intentionally backwards incompatible&#8221; makes a lot of people nervous since if any application (Houdini, Maya, Blender, XSI, TopMod, etc.) move to the new python, lots of peoples scripts may be rendered useless. So there are only a few options that I see:</p>
<ol>
<li>An application can use Python 2.6 for a long time to come, not doing themselves any favors by staying with an ever older (and eventually unsupported) version.</li>
<li>An application can support both until 2.6 fades away.</li>
<li>Each application or a third party can branch off to make a supported Python 2.6-compatible version and everyone will start using that instead.</li>
<li>People will realize that they rather stay with 2.6 and 3.0 will die off.</li>
<li>An application can jump onto the Python 3.0 bandwagon, kill lots of scripts, but everyone will be better in the long run since we&#8217;ll have a better Python to use (plus, scripts can be fixed).</li>
</ol>
<p>I&#8217;m for number 5.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geneome.com/2008/12/04/python-30-chaos-ensues/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
