<?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; Blender</title>
	<atom:link href="http://encelo.netsons.org/blog/tag/blender/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>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>Blender 2.43</title>
		<link>http://encelo.netsons.org/blog/2007/02/19/blender-243/</link>
		<comments>http://encelo.netsons.org/blog/2007/02/19/blender-243/#comments</comments>
		<pubDate>Mon, 19 Feb 2007 02:57:36 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Blender]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=15</guid>
		<description><![CDATA[Today is a memorable day for Blender!
First of all blender.org got a massive redesign and it&#8217;s now really cool and professional. For instance, have a look at the new features page, I think it&#8217;s a perfect showcase for our beloved program.
Moreover Blender 2.43 was released!

As usual the release log is full of appealing new functionalities [...]]]></description>
			<content:encoded><![CDATA[<p>Today is a memorable day for Blender!<br />
First of all <a href="http://www.blender.org">blender.org</a> got a massive redesign and it&#8217;s now really cool and professional. For instance, have a look at the new <a href="http://www.blender.org/features-gallery/features/">features</a> page, I think it&#8217;s a perfect showcase for our beloved program.</p>
<p>Moreover Blender 2.43 was released!</p>
<p><img src="/blog/wp-content/uploads/2007/03/blender243.jpg" alt="Blender 2.43 Splash" /></p>
<p>As usual the <a href="http://www.blender.org/development/release-logs/blender-243/">release log</a> is full of appealing new functionalities that I&#8217;m eager to try.<br />
Some of them can be previewed in <a href="http://www.blender.org/features-gallery/features/feature-videos/">feature videos</a> or tested using the blend files which come inside the <a href="http://download.blender.org/demo/test/test243.zip">test243.zip</a> archive.</p>
<p>I would like to express my congratulations to the whole Blender community.</p>
]]></content:encoded>
			<wfw:commentRss>http://encelo.netsons.org/blog/2007/02/19/blender-243/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mighty SysAdmins</title>
		<link>http://encelo.netsons.org/blog/2007/01/02/mighty-sysadmins/</link>
		<comments>http://encelo.netsons.org/blog/2007/01/02/mighty-sysadmins/#comments</comments>
		<pubDate>Tue, 02 Jan 2007 01:07:13 +0000</pubDate>
		<dc:creator>encelo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Blender]]></category>
		<category><![CDATA[YAFRay]]></category>

		<guid isPermaLink="false">http://encelo.netsons.org/blog/?p=9</guid>
		<description><![CDATA[It has been some time now since I first used university servers for Blender or Yafray renderings.  
I have an account on these ones:

server1: 2 x Xeon 2.8GHz and 3GB RAM
server2: 4 x Xeon 3.2Ghz and 4GB RAM
server3: 4 x Xeon 3.4GHz and 4GB RAM

The first one is accessible from the outside, then you [...]]]></description>
			<content:encoded><![CDATA[<p>It has been some time now since I first used university servers for Blender or Yafray renderings. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I have an account on these ones:</p>
<ul>
<li>server1: 2 x Xeon 2.8GHz and 3GB RAM</li>
<li>server2: 4 x Xeon 3.2Ghz and 4GB RAM</li>
<li>server3: 4 x Xeon 3.4GHz and 4GB RAM</li>
</ul>
<p>The first one is accessible from the outside, then you can log in the other two, which are serving our computer labs.</p>
<p><img src="/blog/wp-content/uploads/2007/03/servers.jpg" alt="Servers Room" /></p>
<p>But as soon as I was just wetting my appetite I faced a serious problem, for long renderings the renderer process got killed unexpectedly.<br />
The first thing that came up to my mind was a kind of cpu limitation, but both <code>/etc/limits</code> and <code>/etc/security/limits.conf</code> had all the lines commented out and no <a href="http://en.wikipedia.org/wiki/Pluggable_Authentication_Modules">PAM</a> module was loaded in the kernel.</p>
<p>Today I just discovered that is a lot simple if you just run <code>ulimit -t</code>, instead of inspecting system configuration files. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
This way I discovered that there is a 1s limit for server2 (that as a matter of facts was quite unusable for anything serious), 1000s for server3 and unlimited for server 1 (but it runs net daemons so it&#8217;s a lot more controlled than the other two). <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I feel defeated by the mighty power of the <code>root</code> user, who, as a demiurge, can choose everything and enforce his wills with unbreakabre rules. <img src='http://encelo.netsons.org/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
As if the cpu limitation were not enough, today I&#8217;ve also spotted one of the roots encoding a mpeg file of &#8220;<em>Young Frankenstein</em>&#8221; in xvid with mencoder!<br />
Why he can use a university server for a task as personal as encoding a movie (forget for a moment about any legal issue&#8230;) while me, a student who pays for education, cannot use it for something as noble as learning computer graphics?</p>
<p>While overwhelmed by these thoughts I had a nice idea, to render with Yafray&#8217;s regions option and compose pieces with <a href="http://www.imagemagick.org">ImageMagick</a>:</p>
<ul>
<li><code>nice ./yafray -c 4 -r -1:1:-1:0 /tmp/YBtest.xml</code></li>
<li><code>mv /tmp/YBtest.tga /tmp/YBtest1.tga</code></li>
<li><code>nice ./yafray -c 4 -r -1:1:0:1 /tmp/YBtest.xml</code></li>
<li><code>mv /tmp/YBtest.tga /tmp/YBtest2.tga</code></li>
<li><code>composite -compose difference tmp/YBtest1.tga tmp/YBtest2.tga YBtest.png</code></li>
</ul>
<p>Actually <code>-compose difference</code> just ignores black regions, and this can lead to wrong results, I should find in composite manual a compose operator that works with image coordinates.</p>
<p>I&#8217;m too lazy for it, but I&#8217;m sure it&#8217;s possible to automatize the task of region subdivisions using a recursive script that splits every region that cannot be rendered in less than 1000s&#8230;<br />
But anyway, mission accomplished! <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/01/02/mighty-sysadmins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
