<?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, drifting.</description>
	<lastBuildDate>Sat, 28 Aug 2010 21:34:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<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/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=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]]></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/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=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[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[Yes &#8211; I have something working! Read on for the story and where I&#8217;m at: 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]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-997" title="spacenavigator" src="http://www.geneome.com/cms/wp-content/uploads/2010/05/spacenavigator-300x169.png" alt="" width="300" height="169" />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.<span id="more-841"></span></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 classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" 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 type="application/x-shockwave-flash" width="560" height="350" 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" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<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>
	</channel>
</rss>
