<?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>Encelo's Blog &#187; Python</title>
	<atom:link href="http://encelo.netsons.org/blog/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://encelo.netsons.org/blog</link>
	<description>When I grow up I want to be a game developer</description>
	<lastBuildDate>Mon, 02 Nov 2009 23:49:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GL O.B.S.: two years after</title>
		<link>http://encelo.netsons.org/blog/2009/10/05/gl-o-b-s-two-years-after/</link>
		<comments>http://encelo.netsons.org/blog/2009/10/05/gl-o-b-s-two-years-after/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 18:17:35 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[G.L.O.B.S.]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[PyGTK]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=327</guid>
		<description><![CDATA[You&#8217;re reading about GL O.B.S. after *exactly* 730 days (I swear it was not made on purpose  ): today revision 50 has been committed.
No new feature has been added, I&#8217;ve dedicated the efforts of the last days to a case study about updating an application after a very long time, the process mainly involved [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re reading about GL O.B.S. after *exactly* 730 days (I swear it was not made on purpose <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ): today revision 50 has been committed.<br />
No new feature has been added, I&#8217;ve dedicated the efforts of the last days to a case study about updating an application after a very long time, the process mainly involved removing deprecated things and adding support for new ones.</p>
<div id="attachment_355" class="wp-caption aligncenter" style="width: 406px"><img src="http://encelo.netsons.org/blog/wp-content/uploads/2009/10/globs_glade.png" alt="GL O.B.S. GUI is now based on GtkBuider" title="globs_glade" width="396" height="168" class="size-full wp-image-355" /><p class="wp-caption-text">GL O.B.S. GUI is now based on GtkBuider</p></div>
<p>Let&#8217;s read together some lines from the <a href="http://globs.svn.sourceforge.net/viewvc/globs?view=rev&#038;revision=50">revision log</a>:</p>
<ul>
<li><em>GUI migrated from libglade to GtkBuilder</em><br />
This was, with no doubt, the most time consuming task: <tt>gtk-builder-convert</tt> tool was not so reliable and I was compelled to recreate the GUI from scratch with Glade. I have also set the minimum GTK version required to 2.16</li>
<li><em>using JSON format for storing benchmark information dictionaries</em><br />
This feature is a way to get rid of the deprecated <tt>execfile()</tt> built-in function, instead of executing a python script to read a dictionary, the Benchmark class now parses a JSON file with the new integrated <a href="http://docs.python.org/library/json.html">json</a> module.<br />
Comparing an <a href="http://globs.svn.sourceforge.net/viewvc/globs/benchmarks/trunk/Fake/__globs_info.py?revision=1&#038;view=markup&#038;pathrev=48">old</a> and a <a href="http://globs.svn.sourceforge.net/viewvc/globs/benchmarks/trunk/Fake/globs_info.json?view=markup&#038;pathrev=49">new</a> file you can notice how simple it was the conversion, I&#8217;ve only lost the ability to comment a line. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li><em>importing numpy instead of numerix in matplotlib</em><br />
This is another deprecation related issue, <a href="http://matplotlib.sourceforge.net/">matplotlib</a> is now based upon <a href="http://numpy.scipy.org/">numpy</a>.</li>
<li><em>matplotlib canvas get refreshed instead of being destroyed and then recreated</em><br />
I don&#8217;t know why two years ago I was destroying and recreating the object instead of just calling the <tt>draw()</tt> method every time it had to be refreshed. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </li>
<li><em>some more attributes and objects integrated in the GtkBuilder XML file</em><br />
I&#8217;ve integrated more attributes in the XML GUI file, like default size for secondary windows or <a href=http://www.pygtk.org/docs/pygtk/class-gtkpaned.html""><tt>Paned</tt></a> positions.<br />
Moreover, thanks to GtkBuilder, even some objects have been integrated, like <a href="http://www.pygtk.org/docs/pygtk/class-gtkadjustment.html"><tt>Adjustment</tt></a> or <a href="http://www.pygtk.org/docs/pygtk/class-gtktextbuffer.html"><tt>TextBuffer</tt></a>.<br />
Actually also <a href="http://www.pygtk.org/docs/pygtk/class-gtktreemodel.html"><tt>TreeModel</tt></a> objects should be configurable inside Glade and integrated inside the XML, but I didn&#8217;t manage to make them work. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>Other remarkable changes in the field of Python3 future support and deprecated features removal were:</p>
<ul>
<li><em>all the print statements converted to functions</em><br />
Well, we all know the content of <a href="http://www.python.org/dev/peps/pep-3105/">PEP 3105</a>&#8230; <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li><em>using hashlib.md5 instead of md5</em><br />
The <tt><a href="http://docs.python.org/library/md5.html">md5</a></tt> module has been deprecated in favour of the <tt><a href="http://docs.python.org/library/hashlib.html">hashlib</a></tt> one</li>
<li><em>using &#8220;key in dict&#8221; instead of dict.has_key()</em><br />
The <tt>has_key()</tt> method no longer exists in Python 3</li>
<li><em>using subprocess.Popen instead of os.popen()</em><br />
<tt><a href=http://docs.python.org/library/os.html"">os</a>.popen()</tt> have been deprecated in favour of the <tt><a href="http://docs.python.org/library/subprocess.html">subprocess</a></tt> module</li>
<li><em>using urllib2.urlopen() instead of urllib.urlopen()</em><br />
Another deprecation suggested substitution, from <tt><a href="http://docs.python.org/library/urllib.html">urllib.urlopen()</a></tt> to <tt><a href="http://docs.python.org/library/urllib2.html">urllib2.urlopen()</a></tt></li>
<li><em>removed &#8220;copyright&#8221; argument and added &#8220;classifiers&#8221; in setup.py</em><br />
The <tt><a href="http://docs.python.org/distutils/setupscript.html#additional-meta-data">distutils.core.setup()</a></tt> function loses the &#8220;copyright&#8221; argument but gains &#8220;classifiers&#8221;. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li><em>dropped support for pysqlite2 and old webbrowser module</em><br />
Now that the minimum requirement is Python 2.6, there is no need for <a href="http://oss.itsystementwicklung.de/trac/pysqlite">pysqlite2</a> or old <a href="http://www.python.org/doc/2.4/lib/module-webbrowser.html">webbrowser</a> module support</li>
<li>I have also removed the deprecated <tt>Options</tt> class in some SCons scripts.</li>
</ul>
<p>I&#8217;m not sure I will have some time in the future to continue developing, but this was a nice &#8220;reboot&#8221; and I also have some new ideas in my to-do list. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2009/10/05/gl-o-b-s-two-years-after/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting weights to vertex colors</title>
		<link>http://encelo.netsons.org/blog/2009/04/19/converting-weights-to-vertex-colors/</link>
		<comments>http://encelo.netsons.org/blog/2009/04/19/converting-weights-to-vertex-colors/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 12:34:39 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[3d Graphics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Blender]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=206</guid>
		<description><![CDATA[If you have read my LinkedIn profile lately you should already know that, by now, some months have passed since I started my pre-graduation internship activity at Raylight (and since I signed my first NDA   ).
The real-time graphic R&#038;D work that I&#8217;m doing there for my thesis is enjoying and stimulating, but this [...]]]></description>
			<content:encoded><![CDATA[<p>If you have read my <a href="http://www.linkedin.com/in/encelo">LinkedIn profile</a> lately you should already know that, by now, some months have passed since I started my pre-graduation internship activity at <a href="http://www.raylightgames.com/">Raylight</a> (and since I signed my first <a href="http://en.wikipedia.org/wiki/Non-disclosure_agreement">NDA</a> <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).<br />
The real-time graphic R&#038;D work that I&#8217;m doing there for my thesis is enjoying and stimulating, but this is not the topic of the post&#8230;</p>
<p><a href="http://www.raylightgames.com"><img src="http://encelo.netsons.org/blog/wp-content/uploads/2009/04/raylight_logo.jpg" alt="Raylight logo" title="Raylight logo" width="640" height="160" class="alignnone size-full wp-image-210" /></a></p>
<p>Some days ago a 3d artist of the team, <a href="http://www.aardolino.com/">Alessandro</a>, asked me a script that would have helped him using Blender for one more task along the company asset creation pipeline, weight painting.<br />
He  needed a simple script to actually convert vertex weights to per-bone vertex colors layers, in order to bake them to per-bone UV maps and later import them inside 3d Studio Max.</p>
<table align="center">
<tr>
<td>
<div id="attachment_213" class="wp-caption alignnone" style="width: 160px"><a href="http://encelo.netsons.org/blog/wp-content/uploads/2009/04/weight.png"><img src="http://encelo.netsons.org/blog/wp-content/uploads/2009/04/weight-150x150.png" alt="Weight painting" title="Weight painting" width="150" height="150" class="size-thumbnail wp-image-213" /></a><p class="wp-caption-text">Weight painting</p></div>
</td>
<td>
<div id="attachment_214" class="wp-caption alignnone" style="width: 160px"><a href="http://encelo.netsons.org/blog/wp-content/uploads/2009/04/vcol.png"><img src="http://encelo.netsons.org/blog/wp-content/uploads/2009/04/vcol-150x150.png" alt="Vertex painting" title="Vertex painting" width="150" height="150" class="size-thumbnail wp-image-214" /></a><p class="wp-caption-text">Vertex painting</p></div>
</td>
</tr>
</table>
<p>At first I didn&#8217;t even know where to start, how to extract and match per-vertex weight data with per-face vertex color one, but my second try with it went as smoothly as honey.<br />
The core algorithm is, indeed, very simple:</p>
<pre class="brush: python;">
for f in faces:
  for i,v in enumerate(f):
      infs = me.getVertexInfluences(v.index)
      for vgroup, w in infs:
        me.activeColorLayer = vgroup
        col = f.col[i]
        col.r = col.g = col.b = int(255*w)
</pre>
<p>Well, he has not yet taken advantage of it nor I know if he will ever use it, nevertheless the script is working and I have <a href="/_download/weight_to_vcol.py.gz">shared it</a> on my site, as usual. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2009/04/19/converting-weights-to-vertex-colors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Composing renders in a strip</title>
		<link>http://encelo.netsons.org/blog/2009/01/06/composing-renders-in-a-strip/</link>
		<comments>http://encelo.netsons.org/blog/2009/01/06/composing-renders-in-a-strip/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 03:58:43 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[3d Graphics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Blender]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=159</guid>
		<description><![CDATA[First of all happy new year to everyone, then let&#8217;s talk about this post topic&#8230;  
During these days I was relaxing and practicing subdivision modeling, after a long time away from Blender I was back to the dream of creating a convincing human head model, but my programming side win the day. 
While I [...]]]></description>
			<content:encoded><![CDATA[<p>First of all happy new year to everyone, then let&#8217;s talk about this post topic&#8230; <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>During these days I was relaxing and practicing subdivision modeling, after a long time away from Blender I was back to the dream of creating a convincing human head model, but my programming side win the day. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
While I was studying in detail some face key parts topology from <a hrefl="http://www.subdivisionmodeling.com/forums/showthread.php?t=2806">here</a>, I noticed the <a href="http://en.wikipedia.org/wiki/Picture-in-picture">PiP</a>-like composed images attached to the first post&#8230;</p>
<div id="attachment_136" class="wp-caption alignnone" style="width: 310px"><a href="http://encelo.netsons.org/blog/wp-content/uploads/2009/01/strip_3dview.png"><img src="http://encelo.netsons.org/blog/wp-content/uploads/2009/01/strip_3dview-300x235.png" alt="Showing camera keyframes" title="strip_3dview" width="300" height="235" class="size-medium wp-image-136" /></a><p class="wp-caption-text">Showing camera keyframes</p></div>
<p>Last night I was thinking of a way to automates the process and today it becomes reality in the form of a Blender Python script: it is capable of producing an image which is composed of multiple rendered frames, think of a daily comic strip and you understand the name <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>The user can select which frames to render specifying a string similar to the following one: &#8220;<em>1-3, 5, 7, 9-11</em>&#8220;.<br />
Moreover it is possible, of course, to choose the size of a single frame and the composed image table dimensions, i.e. how many rows and columns it should have.<br />
Have a look to how well my topology study renders fit the script purpose. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div id="attachment_137" class="wp-caption alignnone" style="width: 310px"><a href="http://encelo.netsons.org/blog/wp-content/uploads/2009/01/strip_imgeditor.png"><img src="http://encelo.netsons.org/blog/wp-content/uploads/2009/01/strip_imgeditor-300x235.png" alt="The resulting composed image" title="strip_imgeditor" width="300" height="235" class="size-medium wp-image-137" /></a><p class="wp-caption-text">The resulting composed image</p></div>
<p>This second script is a bit more complex than <a href="/blog/2008/10/18/automatic-parallax-map-generation-with-blender/">my first one</a>, making use of the <em>Registry</em> module to load and save options and the <em>Draw.PupBlock()</em> method to display a bigger GUI.</p>
<p>Of course it is released under the GNU GPL License and available online, download it from <a href="http://encelo.netsons.org/_download/strip_render.py.gz">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2009/01/06/composing-renders-in-a-strip/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Automatic parallax map generation with Blender</title>
		<link>http://encelo.netsons.org/blog/2008/10/18/automatic-parallax-map-generation-with-blender/</link>
		<comments>http://encelo.netsons.org/blog/2008/10/18/automatic-parallax-map-generation-with-blender/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 16:24:47 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[3d Graphics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Blender]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=66</guid>
		<description><![CDATA[It has been a long time since I last wrote something here, during these months two new things happened that are worth to be mentioned: first of all I&#8217;m really close to graduation!
Well, actually I need to pass the last exam and spend a period of at least four months of internship, nothing is sure [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a long time since I last wrote something here, during these months two new things happened that are worth to be mentioned: first of all I&#8217;m really close to graduation!<br />
Well, actually I need to pass the last exam and spend a period of at least four months of internship, nothing is sure now but I&#8217;m in close contact with a game developing company&#8230; <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The second thing is closely related to this post instead, a couple of months ago I began to convert, following M3xican&#8217;s advice, my OpenGL demos to object oriented C++.<br />
What I have now is really not much, nevertheless my class library can load a Stanford PLY model, it is ES 2.0 compliant (this means it will be easily converted to &#8220;Pure&#8221; OpenGL 3.x), and it can already display both parallax mapping and depth of field!</p>
<p>I&#8217;m not going to publish any screenshot by now because I think it&#8217;s not the time yet, what I&#8217;m showing you is a easy script, my first one, which I wrote yesterday night using the Blender Python API.<br />
What it does is really simple yet time-saving, you select a high-poly and a low-poly model, run the script from the Object->Scripts menu and watch Blender baking your normal and height map and then saving them.</p>
<p><a href="/blog/wp-content/uploads/2008/10/parallax_maps.png"><img src="/blog/wp-content/uploads/2008/10/parallax_maps-320x200.png" alt="Blender parallax maps" /></a></p>
<p>I have also set up an easy compositing nodes configuration to mix the two images in a single parallax map with height data encoded in the alpha channel.</p>
<p><a href="/blog/wp-content/uploads/2008/10/parallax_maps_nodes.png"><img src="/blog/wp-content/uploads/2008/10/parallax_maps_nodes-320x200.png" alt="Blender parallax maps nodes" /></a></p>
<p>You can download the script from <a href="/_download/parallax_maps.py.gz">here</a>.<br />
Everything is very simple (and funny!) with the astonishing power of Blender! <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2008/10/18/automatic-parallax-map-generation-with-blender/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A slighty smarter setup.py for PySoy r64</title>
		<link>http://encelo.netsons.org/blog/2007/06/01/a-slighty-smarter-setuppy-for-pysoy-r64/</link>
		<comments>http://encelo.netsons.org/blog/2007/06/01/a-slighty-smarter-setuppy-for-pysoy-r64/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 01:11:09 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[GameDev]]></category>
		<category><![CDATA[PySoy]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=43</guid>
		<description><![CDATA[While working on PySoy I was really disappointed by the policy adopted by the setup.py script, anytime I launched it the result was a recompilation of *all* the sources, this was really annoying and slow.

What came after was just that I decided to hack it a bit and make it behave more like a standard [...]]]></description>
			<content:encoded><![CDATA[<p>While working on PySoy I was really disappointed by the policy adopted by the setup.py script, anytime I launched it the result was a recompilation of *all* the sources, this was really annoying and slow.</p>
<p><img src='/blog/wp-content/uploads/2007/05/python.png' alt='Python transparent logo' /></p>
<p>What came after was just that I decided to hack it a bit and make it behave more like a standard build tool, that is to control the modification time of a source file in order to choose whether it is updated or need a fresh compilation.</p>
<p>The new policy for the script is very simple, but useful enough to save plenty of time.<br />
It is aware of the following cases (thank you Arc for tips on how to deal with the last one):</p>
<ul>
<li>a .c file is missing, pyrex should compile the .pyx file</li>
<li>a .pyx file is newer than the corresponding .c file, an update is needed</li>
<li>a .pxd file is newer than any .pyx file, a global recompile is needed</li>
</ul>
<p>The last point is not optimal, of course, but it&#8217;s a lot simpler than specifying all the .pxd dependecies for any .pyx file, and, anyway, quite close to being optimal, because of the thick web of cross dependencies which actually exists in PySoy.</p>
<p>Here is the piece of code which performs the magic:</p>
<pre class="brush: python;">
# Convert Pyrex sources to C if using Trunk
if version == 'Trunk' :
  import os
  from stat import *
  from Pyrex.Compiler import Main

  options = Main.CompilationOptions(defaults=Main.default_options, include_path=include_path)

  newestpxd = 0
  for dir in include_path:
    for pxdsource in os.listdir(dir):
      pxdsource_path = (os.path.join(dir, pxdsource))

      if os.path.isfile(pxdsource_path) and pxdsource.rsplit('.', 1)[1] == 'pxd':
        if os.stat(pxdsource_path)[ST_MTIME] &gt; newestpxd:
          newestpxd = os.stat(pxdsource_path)[ST_MTIME]

  for pyxsource in pyrex_sources:
    compilation_needed = False

    if os.path.isfile(pyxsource.rsplit('.', 1)[0] + '.c'):
      ctime = os.stat(pyxsource.rsplit('.', 1)[0] + '.c')[ST_MTIME]
    else:
      ctime = 0

    if newestpxd &gt; ctime:
      compilation_needed = True
    elif os.stat(pyxsource)[ST_MTIME] &gt; ctime:
      compilation_needed = True

    if compilation_needed:
      Main.compile(pyxsource, options)
</pre>
<p>Well, actually Arc commited <a href="http://www.pysoy.org/changeset?old_path=trunk&#038;old=65&#038;new_path=trunk&#038;new=64">r65</a> too, simplifying the conditionals of the script even more, but this is another story. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Anyway, I hope to have made another little step into making the life of our team a bit simpler. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2007/06/01/a-slighty-smarter-setuppy-for-pysoy-r64/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Summer of Code begins with PySoy r44</title>
		<link>http://encelo.netsons.org/blog/2007/05/29/summer-of-code-begins-with-pysoy-r44/</link>
		<comments>http://encelo.netsons.org/blog/2007/05/29/summer-of-code-begins-with-pysoy-r44/#comments</comments>
		<pubDate>Tue, 29 May 2007 00:11:42 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[GameDev]]></category>
		<category><![CDATA[PySoy]]></category>
		<category><![CDATA[GSoC]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=42</guid>
		<description><![CDATA[Summer of Code has started just today (even if currently it is only a &#8220;Spring of Code&#8221;   ) but a little contribution of mine has already made his way inside the SVN repository of PySoy.

But let&#8217;s start from the beginning&#8230;
After having shown to Arc an early draft of an UML class diagram for [...]]]></description>
			<content:encoded><![CDATA[<p>Summer of Code has started just today (even if currently it is only a &#8220;Spring of Code&#8221; <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ) but a little contribution of mine has already made his way inside the SVN repository of PySoy.</p>
<p><img src='/blog/wp-content/uploads/2007/05/code-obfuscation.jpg' alt='Code Obfuscation' /></p>
<p>But let&#8217;s start from the beginning&#8230;<br />
After having shown to Arc an early draft of an UML class diagram for the current code I decided to come back to work on some test code I had written in the afternoon.<br />
It was just a classical spinning cube demo to actually compare PyOpenGL versus Pyrex speed, I don&#8217;t report the results here because they are quite identical, if I haven&#8217;t done any mistake it should be the absolute minimum complexity of the code which actually determined this result.<br />
Anyway, even without this proof I firmly believe in the power and speed of Pyrex. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Going back to my commit, my changes affected a small yet important area of the code, I think we will remember it in the future. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>BEFORE<br />
In <em>src/windows-glx/soy.windows.pyx</em>:</p>
<pre class="brush: python;">
gl.glClear(0x4100)
</pre>
<p>AFTER<br />
In <em>include/gl.pxd</em>:</p>
<pre class="brush: python;">
[...]
# Constants
  ctypedef enum:
    [...]
    # glPush/PopAttrib bits
    GL_DEPTH_BUFFER_BIT
    GL_COLOR_BUFFER_BIT
[...]
</pre>
<p>In <em>src/windows-glx/soy.windows.pyx</em>:</p>
<pre class="brush: python;">
gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
</pre>
<p>Was it better before or now? <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2007/05/29/summer-of-code-begins-with-pysoy-r44/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Python 2.5 support in globs r46</title>
		<link>http://encelo.netsons.org/blog/2007/05/23/python-25-support-in-globs-r46/</link>
		<comments>http://encelo.netsons.org/blog/2007/05/23/python-25-support-in-globs-r46/#comments</comments>
		<pubDate>Wed, 23 May 2007 21:50:07 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[G.L.O.B.S.]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=39</guid>
		<description><![CDATA[Yes, I should have written about it when I actually committed the revision, but I forgot completely. 
About two months after Python 2.5 has been moved to the current repository of Arch I begun to think that maybe it was time to support the new release of our beloved language/interpreter.

I don&#8217;t know if it can [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, I should have written about it when I actually committed the <a href="http://globs.svn.sourceforge.net/viewvc/globs?view=rev&#038;revision=46">revision</a>, but I forgot completely. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<a href="http://www.archlinux.org/news/299/">About two months</a> after <a href="http://www.python.org/download/releases/2.5/">Python 2.5</a> has been moved to the <em>current</em> repository of Arch I begun to think that maybe it was time to support the new release of our beloved language/interpreter.</p>
<p><img src='/blolg/wp-content/uploads/2007/05/python.png' alt='Python transparent logo' /></p>
<p>I don&#8217;t know if it can be called &#8220;support&#8221;, but at least GL O.B.S. is now aware of it. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
The changes are very simple yet of some importance.<br />
First of all, pysqlite is not needed anymore if you have the integrated <a href=http://docs.python.org/whatsnew/modules.html#SECTION0001440000000000000000>sqlite3 module</a>:</p>
<pre class="brush: python;">
if sys.version_info[:2] &gt;= (2, 5):
  from sqlite3 import dbapi2 as sqlite
else:
  from pysqlite2 import dbapi2 as sqlite
</pre>
<p>Moreover I make use of the updated API of the <a href="http://docs.python.org/lib/module-webbrowser.html">webbrowser module</a>:</p>
<pre class="brush: python;">
if sys.version_info[:2] &gt;= (2, 5):
  webbrowser.open_new_tab(Globs.BROWSE_URL)
else:
  webbrowser.Netscape('firefox').open(Globs.BROWSE_URL)
</pre>
<p>Another addition, not related with the support of Python 2.5, is the <em>check_ver</em> function, which checks if a particular version of OpenGL is available on the machine running GL O.B.S., this have opened the possibility to add an OpenGL 2 only test like GLSL_Parallax into <a href="http://globs.svn.sourceforge.net/viewvc/globs?view=rev&#038;revision=47">benchmarks r47</a>.</p>
<p>Python and GL O.B.S. are getting better and better. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2007/05/23/python-25-support-in-globs-r46/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accepted for Summer of Code</title>
		<link>http://encelo.netsons.org/blog/2007/04/12/accepted-for-summer-of-code/</link>
		<comments>http://encelo.netsons.org/blog/2007/04/12/accepted-for-summer-of-code/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 10:54:05 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[GSoC]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=34</guid>
		<description><![CDATA[&#8220;Dear Applicant,
Congratulations! This email is being sent to inform you that your
application was accepted to take part in the Summer of Code.&#8221;
Yeah, one of my two proposals has been accepted!

My first proposal was about working on GL O.B.S. under the Python Software Foundation, unfortunately it was very likely going to be discarded.
I learned this from [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em>Dear Applicant,<br />
Congratulations! This email is being sent to inform you that your<br />
application was accepted to take part in the <a href="http://code.google.com/soc">Summer of Code</a>.</em>&#8221;<br />
Yeah, one of my two proposals has been accepted!</p>
<p><img src='/blog/wp-content/uploads/2007/04/dilbert00.gif' alt='Dilbert Doodle' /></a></p>
<p>My first proposal was about working on GL O.B.S. under the <a href="http://www.python.org">Python Software Foundation</a>, unfortunately it was very likely going to be discarded.<br />
I learned this from a mentor who contacted me, he wrote that my application was based on a personal program and that it would have been hard to find someone to mentor me, moreover I wouldn&#8217;t have contributed to the Python community. He also added that I could have been a good candidate for his project, he is, indeed, <a href="http://arcriley.blogspot.com">Arc Riley</a>, Project Manager of <a href="http://www.pysoy.org">PySoy</a>.<br />
And so I did, I wrote another <a href="http://code.google.com/soc/psf/appinfo.html?csaid=27C293601526C36C">application</a> and, this time, it has been accepted. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>My work will be to integrate multi-texturing in the PySoy rendering loop and API, document API additions, test the whole under many different free software drivers and then implement some related techniques, like <a href="http://en.wikipedia.org/wiki/Bump_mapping">bump</a> or <a href="http://en.wikipedia.org/wiki/Normal_mapping">normal mapping</a>.</p>
<p>I&#8217;m really glad of this opportunity, I will learn many interesting OpenGL and Python topics and I will improve my design, teamwork and communication skills.<br />
Thank you Google! <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2007/04/12/accepted-for-summer-of-code/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
