<?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; 3d Graphics</title>
	<atom:link href="http://encelo.netsons.org/blog/category/3d-graphics/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>
	</channel>
</rss>
