<?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>Computer Graphics, Linux and Everything... &#187; flord</title>
	<atom:link href="http://francoislord.com/blog/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://francoislord.com/blog</link>
	<description></description>
	<lastBuildDate>Fri, 25 Nov 2011 18:44:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>ICE Scatter Compound</title>
		<link>http://francoislord.com/blog/computer-graphics/softimage/ice-scatter-compound_201</link>
		<comments>http://francoislord.com/blog/computer-graphics/softimage/ice-scatter-compound_201#comments</comments>
		<pubDate>Thu, 07 Apr 2011 19:15:02 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Softimage]]></category>
		<category><![CDATA[Arnold]]></category>
		<category><![CDATA[ICE]]></category>
		<category><![CDATA[particles]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=201</guid>
		<description><![CDATA[After some tests with Arnold, we quickly realized we didn&#8217;t need Vue anymore for stuff like scattering trees on a landscape. An artist at Oblique asked me to create a compound in ICE to mimic the parameters in Vue to scatter particles with some rules. Here is the compound. It&#8217;s quickly done but it works.
FL_ScatterTool.1.3.xsicompound.zip
edit: [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in <b>/home/content/f/r/a/francoislord/html/blog/wp-content/plugins/flattr/flattr5.php</b> on line <b>425</b><br />
<p>After some tests with Arnold, we quickly realized we didn&#8217;t need Vue anymore for stuff like scattering trees on a landscape. An artist at Oblique asked me to create a compound in ICE to mimic the parameters in Vue to scatter particles with some rules. Here is the compound. It&#8217;s quickly done but it works.</p>
<p><a title="FL_ScatterTool.1.3.xsicompound.zip" href="http://francoislord.com/blog/wp-content/uploads/2011/04/FL_ScatterTool.1.3.xsicompound.zip">FL_ScatterTool.1.3.xsicompound.zip</a></p>
<p>edit: It appears the Density_Map isn&#8217;t working. I&#8217;ll have to find some time to fix it.</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/computer-graphics/softimage/ice-scatter-compound_201/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dubois Anaglyph Nuke Gizmo</title>
		<link>http://francoislord.com/blog/computer-graphics/nuke/dubois-anaglyph-nuke-gizmo_186</link>
		<comments>http://francoislord.com/blog/computer-graphics/nuke/dubois-anaglyph-nuke-gizmo_186#comments</comments>
		<pubDate>Wed, 06 Apr 2011 02:35:26 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Nuke]]></category>
		<category><![CDATA[anaglyph]]></category>
		<category><![CDATA[stereoscopy]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=186</guid>
		<description><![CDATA[I don&#8217;t remember how I stumbled on Eric Dubois&#8217; page on how to create an optimized anaglyph while keeping the colors, but I do remember that I thought it was semi useless since I always do my anaglyphs in black and white, it just works so much better. Even the default anaglyph node in Nuke [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in <b>/home/content/f/r/a/francoislord/html/blog/wp-content/plugins/flattr/flattr5.php</b> on line <b>425</b><br />
<p>I don&#8217;t remember how I stumbled on <a href="http://www.site.uottawa.ca/~edubois/anaglyph/" target="_blank">Eric Dubois&#8217; page</a> on how to create an optimized anaglyph while keeping the colors, but I do remember that I thought it was semi useless since I always do my anaglyphs in black and white, it just works so much better. Even the default anaglyph node in Nuke creates black and white images.</p>
<p>Since I&#8217;m working on IMAX projects at the moment, I often use the proxy mode and I quickly realized that the anaglyph node&#8217;s offset parameter isn&#8217;t constant when activating the proxy. So I thought I would do my own anaglyph node. And then I remembered Eric Dubois&#8217; method which was just a color matrix in linear space. It couldn&#8217;t be simpler to implement in Nuke. After experimenting a bit with it, I must say this method is awesome. I am surprised to see nobody did a Nuke gizmo before me, or that they didn&#8217;t publish it.</p>
<p>Haven&#8217;t used it much yet, but I doubt there should be any problems with  it. It complains when you don&#8217;t have &#8216;left&#8217; and &#8216;right&#8217; views, but why  would you do that? <img src='http://francoislord.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a title="DuboisAnaglyph.gizmo" href="http://francoislord.com/blog/wp-content/uploads/2011/04/DuboisAnaglyph.gizmo.zip">DuboisAnaglyph.gizmo.zip</a></p>
<p>I also uploaded the gizmo on nukepedia. <a href="http://www.nukepedia.com/gizmos/duboisanaglyph" target="_blank">http://www.nukepedia.com/gizmos/duboisanaglyph</a><br />
At the time of this writing, it&#8217;s still waiting for moderation.</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/computer-graphics/nuke/dubois-anaglyph-nuke-gizmo_186/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scaling Mountains</title>
		<link>http://francoislord.com/blog/computer-graphics/scaling-mountains_167</link>
		<comments>http://francoislord.com/blog/computer-graphics/scaling-mountains_167#comments</comments>
		<pubDate>Fri, 25 Feb 2011 02:16:41 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Computer Graphics]]></category>
		<category><![CDATA[Softimage]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=167</guid>
		<description><![CDATA[I needed to load some DEM file into Softimage and Polytrans didn&#8217;t like the DEM flavor I had in hands. I wrote my own script to import it and happily ended up with a very hires model of the Rocky Mountains to scale. One Softimage unit equals 1 kilometer.
When I get the camera very close [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in <b>/home/content/f/r/a/francoislord/html/blog/wp-content/plugins/flattr/flattr5.php</b> on line <b>425</b><br />
<p>I needed to load some DEM file into Softimage and Polytrans didn&#8217;t like the DEM flavor I had in hands. I wrote my own script to import it and happily ended up with a very hires model of the Rocky Mountains to scale. One Softimage unit equals 1 kilometer.</p>
<p>When I get the camera very close to the geometry, the mountains look good. Their shape looks normal and the slopes feel right. However, when I frame all the geometry in the viewport, the mountains look flat and boring. I have to scale them up 5 times in Y to get them to look nice again.</p>
<p>I made a linear camera movement from far to close and keyframed the Y scaling parameter from 5 to 1 linearly as well to see if it would present any apparent change. To my surprise, it&#8217;s not very apparent.</p>
<p>(Video: Watch this video on the post page)</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/computer-graphics/scaling-mountains_167/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encoding H.264/AVC videos for PS3 using ffmpeg</title>
		<link>http://francoislord.com/blog/everything/encoding-h-264avc-videos-for-ps3-using-ffmpeg_144</link>
		<comments>http://francoislord.com/blog/everything/encoding-h-264avc-videos-for-ps3-using-ffmpeg_144#comments</comments>
		<pubDate>Mon, 26 Oct 2009 21:12:29 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[PS3]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=144</guid>
		<description><![CDATA[OK, I&#8217;m tired of loading up my script just to see what&#8217;s the command line to encode AVC videos for the PS3 so I&#8217;m posting it here. This way It&#8217;ll be quicker for me to come see it here.
The PS3 doesn&#8217;t play Quicktime files. It much prefers mp4, which is an open standard (not to [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in <b>/home/content/f/r/a/francoislord/html/blog/wp-content/plugins/flattr/flattr5.php</b> on line <b>425</b><br />
<p>OK, I&#8217;m tired of loading up my script just to see what&#8217;s the command line to encode AVC videos for the PS3 so I&#8217;m posting it here. This way It&#8217;ll be quicker for me to come see it here.</p>
<p>The PS3 doesn&#8217;t play Quicktime files. It much prefers mp4, which is an open standard (not to be confused with open source). The best and fastest way I&#8217;ve found to encode mp4 files is with ffmpeg. Yes, it&#8217;s command line but it&#8217;s easy enough to remember the basic syntax rapidly.</p>
<p>The syntax has several blocks, depending on what you need, all blocks may not be required.</p>
<pre>ffmpeg
-r 23.98
-i FrameSequence.%04d.jpg
-i Sound.wav
-vcodec libx264 -acodec libfaac
-b 35M -ab 224k
-mbd rd -flags 4mv,trell,aic,qprd,mv0,loop -cmp 2 -subcmp 2 -flags2 dct8x8+skiprd -level 41 -bf 3 -qmin 10
-threads 0
OutputFile.mp4</pre>
<p>Let&#8217;s look at this in details.<br />
It begins with the executable (duh)<br />
<code>ffmpeg</code></p>
<p>Then you must set the frame rate only if you&#8217;re loading a sequence of frames. BTW, it only reads jpeg and png files, and it must begin at 0 or 1.<br />
<code>-r 23.98</code></p>
<p>The input files, several if your audio is separated from the video.<br />
<code>-i FrameSequence.%04d.jpg<br />
-i Sound.wav</code></p>
<p>The formats, determined by the codecs. AVC for Video and AAC for audio.<br />
<code>-vcodec libx264 -acodec libfaac</code></p>
<p>The bit rates. I use 35Mbit/s for 1080p, 15 for 720p and 5 for SD.<br />
<code>-b 35M -ab 224k</code></p>
<p>This line must be entered as is. It set the encoding parameters the PS3 requires.<br />
<code>-mbd rd -flags 4mv,trell,aic,qprd,mv0,loop -cmp 2 -subcmp 2 -flags2 dct8x8+skiprd -level 41 -bf 3 -qmin 10</code></p>
<p>This will force ffmpeg to use all the cores on your machines, potentially speeding up the conversion considerably.<br />
<code>-threads 0</code></p>
<p>And the output file, with the mp4 extention.<br />
<code>OutputFile.mp4</code></p>
<p>This command works for ffmpeg 0.5 and probably later. You can find ffmpeg for Windows <a href="http://ffmpeg.zeranoe.com/builds/" target="_blank">here</a>.<br />
Thanks to <a href="http://ps3wiki.qj.net/index.php/Using_ffmpeg_to_transcode_video_for_the_PS3">this site</a> for providing the original syntax. I added the -qmin 10 part because libx264 was acting weird without it.</p>
<p>It is important to know that if you&#8217;re encoding a video you have made using computer softwares, your video might look a bit too contrasted. Blacks might be too black and whites too white. This is because pixel values on your computer range from 0 to 255, and on your TV they range from 16 to 235. Any pixel that has a value below 16 in your movie will appear as black on your TV. To correct this, you must compress the colors of all the frames in your movie to make sure the darkest thing is set above 16 and the brightest thing is below 235. Then it will show up correctly on your TV when played with the PS3. There is a setting in the PS3 to avoid this, but your TV must be compatible, and not all TVs are compatible, far from it.</p>
<p>EDIT: with recent linux distribution (Mandriva 2010.1 in my case) comes a new version of ffmpeg. This new version requires some changes to the command line. First, you have to add the argument <em>-vpre slow</em> somewhere. Also, the <em>libfaac </em>codec has been replaced by <em>aac</em>. The command would then looks like this:</p>
<pre>ffmpeg
-r 23.98
-i FrameSequence.%04d.jpg
-i Sound.wav
-vcodec libx264 -acodec aac -b 35M -ab 224k
-vpre slow -mbd rd -flags 4mv,trell,aic,qprd,mv0,loop -cmp 2 -subcmp 2 -flags2 dct8x8+skiprd -level 41 -bf 3 -qmin 10
-threads 0
OutputFile.mp4</pre>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/everything/encoding-h-264avc-videos-for-ps3-using-ffmpeg_144/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First Attempt at Shooting Stars Timelapse</title>
		<link>http://francoislord.com/blog/photography/first-attempt-at-shooting-stars-timelapse_129</link>
		<comments>http://francoislord.com/blog/photography/first-attempt-at-shooting-stars-timelapse_129#comments</comments>
		<pubDate>Sat, 15 Aug 2009 15:23:42 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[timelapse]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=129</guid>
		<description><![CDATA[I finally got a chance to shoot a timelapse of the stars at my father&#8217;s country house this week. And to make things even better, it was August 12th&#8230; the shooting stars night. I learned a few things this night.

To make a starfield timelapse, it must be dark, very dark. The tinyest light pollution from [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got a chance to shoot a timelapse of the stars at my father&#8217;s country house this week. And to make things even better, it was August 12th&#8230; the shooting stars night. I learned a few things this night.</p>
<ol>
<li>To make a starfield timelapse, it must be dark, very dark. The tinyest light pollution from a nearby village will be amplified by the long exposures and be visible in the shot.</li>
<li>To make a starfield timelapse, it must be dry. On the banks of the St-Lawrence river, in August, the moisture condenses on the lens and you are lucky to get 50 frames before it happens.</li>
<li>To make a starfield timelapse, you must use a camera that has as little dead pixels as possible. Mine is getting old (Canon Rebel XT) and I discovered it has many, many dead pixels.</li>
<li>To make a starfield timelapse, 1 minutes exposure per frame is good, but not enough to see the Milky Way.</li>
<li>To make a starfield timelapse, it is preferable to see something in the shot like a mountain or a house. Otherwise, all you see is a few stars rotating. Those objects in the shot would also recieve light from the moon when it rises possibly creating a cool effect.</li>
</ol>
<p>I used my <a href="http://www.aputure.com/en/product/digital_timer_remote_shutter.htm" target="_blank">new shiny timelapse machine</a> for this one since it allows for longer exposure times than what the camera supports. It proved to be useful and is perhaps the only thing that worked as expected that night.</p>
<p>So here is the result. I made the mistake of shooting in RAW. I should have shot in jpeg and used the noise reduction function of the camera. When I saw the result, I didn&#8217;t bother to process it too much and remove the dead pixels and color-correct it. I just set the black point to clip the light pollution and the noise and trimmed the bad frames.</p>
<p><object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" width="450" height="300" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"><param name="loop" value="true" /><param name="cache" value="true" /><param name="correction" value="none" /><param name="playeveryframe" value="true" /><param name="src" value="http://francoislord.com/Videos/Perseids2.mp4" /><embed type="video/quicktime" width="450" height="300" src="http://francoislord.com/Videos/Perseids2.mp4" playeveryframe="true" correction="none" cache="true" loop="true"></embed></object></p>
<p>1 minute exposure per frame, 8 seconds between frames, ISO 200, 12mm, F4.</p>
<p>I consider it to be a failure. The stars you see that don&#8217;t move are dead pixels (or dust on your screen). Near the end of the movie, you see the stars dim a little. That&#8217;s where the humidity started condensing on the lens. In the hi-res version, we can see one or two shooting stars, but they&#8217;re not very apparent. I didn&#8217;t bother posting the hi-res version.</p>
<p>I wanted to leave the camera outside all night but when I saw the amount of condensation there was on the lens after only an hour, I stopped the whole thing. The next morning when I saw all the water condensed on my car, I was glad I didn&#8217;t leave my camera outside.</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/photography/first-attempt-at-shooting-stars-timelapse_129/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dropbox on Mandriva</title>
		<link>http://francoislord.com/blog/linux/mandriva/dropbox-on-mandriva-20091_123</link>
		<comments>http://francoislord.com/blog/linux/mandriva/dropbox-on-mandriva-20091_123#comments</comments>
		<pubDate>Sat, 11 Jul 2009 15:55:17 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=123</guid>
		<description><![CDATA[Download and run this script https://dl.getdropbox.com/u/43645/dbcli.py
This will download and install the latest Dropbox version and start it. Once you configured it as you like, hit ctrl+c to kill it. We will configure it to start automatically when you log in.
Type &#8216;systemsettings&#8217; in a shell, go to the Advanced tab and double click on Autostart. Click [...]]]></description>
			<content:encoded><![CDATA[<p>Download and run this script <a href="https://dl.getdropbox.com/u/43645/dbcli.py">https://dl.getdropbox.com/u/43645/dbcli.py</a></p>
<p>This will download and install the latest Dropbox version and start it. Once you configured it as you like, hit ctrl+c to kill it. We will configure it to start automatically when you log in.</p>
<p>Type &#8216;systemsettings&#8217; in a shell, go to the Advanced tab and double click on Autostart. Click the Add Program button. Browse to this file ~/.dropbox-dist/dropbox and click OK. Next time you log in, Dropbox should start.</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/linux/mandriva/dropbox-on-mandriva-20091_123/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup dual monitor in Mandriva 2009.1 with nVidia</title>
		<link>http://francoislord.com/blog/linux/mandriva/how-to-setup-dual-monitor-in-mandriva-20091-with-nvidia_120</link>
		<comments>http://francoislord.com/blog/linux/mandriva/how-to-setup-dual-monitor-in-mandriva-20091-with-nvidia_120#comments</comments>
		<pubDate>Tue, 05 May 2009 14:58:52 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Mandriva]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=120</guid>
		<description><![CDATA[I just installed Mandriva 2009.1 and one of the first things I did was to setup my dual monitor the same way I did for the past several versions of Mandriva. But this time, it didn't work. I mean, it worked, but it didn't save the xorg.conf and I had to redo the config everytime I logged in. After a bit of work, I found what had changed. Here the new procedure from the begining.]]></description>
			<content:encoded><![CDATA[<p>I just installed Mandriva 2009.1 and one of the first things I did was to setup my dual monitor the same way I did for the past several versions of Mandriva. But this time, it didn&#8217;t work. I mean, it worked, but it didn&#8217;t save the xorg.conf and I had to redo the config everytime I logged in. After a bit of work, I found what had changed. Here the new procedure from the begining.</p>
<ol>
<li>In the Mandriva Control Center (drakconf), go to Hardware -&gt; Set Up The Graphical Server.</li>
<li>Click Options, check &#8220;Enable duplicate display on the second display&#8221;. Click OK.</li>
<li>Log out, and back in.</li>
<li>Open a terminal as root.</li>
<li>Type /usr/bin/nvidia-settings</li>
<li>Go to &#8220;X Server Display Configuration&#8221;</li>
<li>Select one of the monitors and set its position to &#8220;Right of&#8221; or &#8220;Left of&#8221;.</li>
<li>Click Apply. You should see something different on both screens.</li>
<li>Click &#8220;Save to X configuration file&#8221;.</li>
</ol>
<p>Before that, I changed the permissions on the xorg.conf file to be able to write to it as a user. This is what doesn&#8217;t work anymore. Something brings back the permissions of that file to root only. So you need to run the nvidia-settings as root. Mandriva should simply ask for your root password when opening this tool, perhaps in the next version.</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/linux/mandriva/how-to-setup-dual-monitor-in-mandriva-20091-with-nvidia_120/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>NukeProcess</title>
		<link>http://francoislord.com/blog/computer-graphics/nuke/nukeprocess_74</link>
		<comments>http://francoislord.com/blog/computer-graphics/nuke/nukeprocess_74#comments</comments>
		<pubDate>Sun, 26 Apr 2009 22:16:06 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Nuke]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[pipeline]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=74</guid>
		<description><![CDATA[One thing I liked about Shake and miss in Nuke was its ability to process images easily from the command line. When working on automation tools for a pipeline, this was a very useful feature and a easy one to learn. After realizing that Nuke wasn't built from a command line software and that such a feature surely won't come anytime soon, I decided to spend some time writing my own tool to use Nuke from the exterior. It's not a command line API, but it's an API that can be used by any Python script anywhere in the pipeline.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">One thing I liked about Shake and miss in Nuke was its ability to process images easily from the command line. When working on automation tools for a pipeline, this was a very useful feature and a easy one to learn. After realizing that Nuke wasn&#8217;t built from a command line software and that such a feature surely won&#8217;t come anytime soon, I decided to spend some time writing my own tool to use Nuke from the exterior. It&#8217;s not a command line API, but it&#8217;s an API that can be used by any Python script anywhere in the pipeline.</p>
<p style="text-align: justify;">Oblique, my employer, has allowed me to release it publicly. So here it is&#8230; <a href="http://francoislord.com/NukeTools/nukeprocess.py" target="_self">nukeprocess.py</a>.<br />
Save this inside your custom python library or inside your Python&#8217;s site-packages directory. Since this is a tool for controlling an application via programming, I assume you know where to save a python file to use it. You will have to modify some parts to make sure it points to the right Nuke installation and to your own Python library.</p>
<p style="text-align: justify;">It creates a Python script that can be run inside Nuke. It then starts Nuke and pipe the script to the STDIN, executes the script and exits Nuke. At the time of this writing, it works with Nuke 5.1v4.</p>
<p style="text-align: justify;">If you find any bugs or have any comments about this tool, don&#8217;t hesitate to tell me. I&#8217;ve been using it in production for a few weeks now and I still find a few bugs from time to time. I would like it to be as solid as possible since Oblique pipeline will rely on it. Also, feel free to modify it to your own needs. I would appreciate if you told me what you did. In the Oblique internal version, I added a method to process on the render farm, but since our render manager API is custom made, I felt it was unnecessary for a public release.</p>
<p style="text-align: justify;">Its usage is simple. You first create an instance of the NukeProcess class by giving it the name of the sequence you want to work with as well as its first frame, last frame and step. You then add nodes with the createNode() method by setting all the knob values with arguments. And execute the whole thing with the executeVerbose() method. The knob names you pass as args must be the scripting name. You can find them by hovering the mouse over any knob in Nuke, the tooltip is the script name.</p>
<h3>Usage examples</h3>
<pre><span style="color: #008000;">#
# <span style="text-decoration: underline;"><strong>To resize a sequence of images, color correct it, and save to jpeg:
</strong></span><strong>#</strong></span>
from nukeprocess import NukeProcess
np = NukeProcess("/someplace/someImageSequence.%04d.exr", 1, 100, 1)
np.createNode("Reformat", type='to box', box_width=1920, box_height=1080,
              box_fixed=True, resize='fit', black_outside=True)
np.createNode('Grade', black=.00537, white=.83)
np.createNode("Write", file="/someplace/someImageSequence_HD.%04d.jpg",
              file_type='jpeg', _jpeg_quality=1)
np.executeVerbose()<span style="color: #008000;">

</span><span style="color: #008000;">#
# <span style="text-decoration: underline;"><strong>To resize a sequence, offset it to frame 1 and put gray bars:
</strong></span><strong>#</strong></span>
from nukeprocess import NukeProcess

<span style="color: #008000;"># When declaring a empty string, it creates a Constant node instead of a Read.</span>
np = nukeprocess.NukeProcess("", 1, sequence.getEnd()-sequence.getStart()+1,
                             color="{from_byte(64)}") 

<span style="color: #008000;"># Use the addCode() method when you need to do something special.</span>
np.addCode("f = nuke.addFormat('512 288 PreviewMovie')")
np.addCode("n.knob('format').setValue(f)")

<span style="color: #008000;"># We save the node in a variable to use it later in the connectInput() method</span>
np.saveNodeInVariable('constant') 

<span style="color: #008000;"># sequence.getStart() and sequence.getEnd() come from another API,
# in this case a custom file browser.</span>
np.createNode("Read", file="/somePlace/sequence.%04d.exr",
              first=sequence.getStart(), last=sequence.getEnd(),
              frame="frame+%d" % (sequence.getStart()+1))
np.createNode('Shuffle', alpha=6)
np.createNode("Reformat", type="to box", box_width=512, box_height=288,
              resize='fit', black_outside=True, box_fixed=True)

<span style="color: #008000;"># The connectInput() method works on the previously added node.</span>
np.createNode("Merge")
np.connectInput('constant')
np.createNode("Write", file="/somePlace/sequence_fit.%04d.exr",
              file_type="exr", compression='ZIP')

<span style="color: #008000;"># to debug the script, you can print it and paste it in an interactive Nuke.</span>
print np.getScript()
np.executeVerbose()

<span style="color: #008000;">#
# <span style="text-decoration: underline;"><strong>To monitor the process:
</strong></span><strong>#</strong></span>
from nukeprocess import NukeProcess
np = NukeProcess("/someplace/someImageSequence.%04d.exr", 1, 100, 1)
np.createNode("Write", file="/someplace/someImageSequence_HD.%04d.jpg",
              file_type='jpeg', _jpeg_quality=1)
oProcess = np.execute(1, 100, 1)
sOutLine = "."
while sOutLine != "":
    sOutLine = oProcess.stdout.readline()
    # Update process progress
    # Writing /someplace/someImageSequence_HD.0001.jpg took 1.08 seconds
    if sOutLine.startswith('Writing'):
        # Extract frame number from sOutLine
        try:
            iFrame = int(sOutLine.split()[1].rsplit('.')[-2])
        except:
            pass
        else:
            print("Processing frame: %d" % iFrame)

oProcess.wait()
result = oProcess.returncode</pre>
<h3>Documentation:</h3>
<p>NukeProcess methods:</p>
<li><strong>__init__(InputSequence, StartFrame, EndFrame, [Step], **kwargs)</strong><br />
When instancing the NukeProcess, a createNode(&#8220;Read&#8221;) is done and<br />
**kwargs are passed.</li>
<li><strong>createNode(NodeName, **kwargs)</strong><br />
Adds a node in the script. Knobs values can be set via<br />
keyword arguments.<br />
example:<br />
np = createNode(&#8216;Write&#8217;, file=&#8217;C:/patate.####.exr&#8217;, premultiplied=True)</p>
<p>Internally, createNode() returns n, and uses n.knob().setValue() to<br />
set the parameters. If you need to create some branches, you might want<br />
to use saveNodeInVariable([variable]) to keep the last added node in a safe variable<br />
since n will always be overwritten on the next createNode(). You can then later use<br />
connectInput([variable]) to connect the second input of a merge node for example.</li>
<li><strong>addCode(Code)</strong><br />
Adds a line of code to the script.</li>
<li><strong>saveNodeInVariable(Variable)</strong><br />
Saves the previously added node in a variable to be used by connectInput().</li>
<li><strong>connectInput(Variable)</strong><br />
Allows branching by connecting the secondary input of the previously added node<br />
to be connected to the node inside Variable.<br />
equivalent to: addCode(&#8220;n.connectInput(0, %s)&#8221; % sVariable)</li>
<li><strong>execute([StartFrame], [EndFrame], [Step])</strong><br />
Launches the render and returns a subprocess.Popen instance.<br />
stdios are piped so you can use oProcess.stdin.readline().<br />
Optional args:<br />
iStartFrame, iEndFrame, iStep<br />
If args are not present, start and end frames are taken from the input sequence.</li>
<li><strong>executeVerbose([StartFrame], [EndFrame], [Step])</strong><br />
Launches the render and prints the output of the process.<br />
Optional args:<br />
iStartFrame, iEndFrame, iStep<br />
If args are not present, start and end frames are taken from the input sequence.</li>
<li><strong>getScript()</strong><br />
Returns the script in its ready-to-use form,<br />
with the right indentation.</li>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/computer-graphics/nuke/nukeprocess_74/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Rocheuses 2009, Jour 6</title>
		<link>http://francoislord.com/blog/uncategorized/rocheuses-2009-jour-6_70</link>
		<comments>http://francoislord.com/blog/uncategorized/rocheuses-2009-jour-6_70#comments</comments>
		<pubDate>Mon, 16 Feb 2009 17:05:40 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=70</guid>
		<description><![CDATA[Rien de bien spécial. On a continué à faire la même piste toute la journée parce que c&#8217;était le seule place où il y avait un peu de neige.
]]></description>
			<content:encoded><![CDATA[<p>Rien de bien spécial. On a continué à <a href="http://francoislord.com/Videos/Bruno_dans_la_DoubleDiamant_saoul.mp4" target="_blank">faire la même piste</a> toute la journée parce que c&#8217;était le seule place où il y avait <a href="http://francoislord.com/Videos/Skier_dans_un_jardin.mp4" target="_blank">un peu de neige</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/uncategorized/rocheuses-2009-jour-6_70/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rocheuses 2009, Jour 5</title>
		<link>http://francoislord.com/blog/uncategorized/rocheuses-2009-jour-5_62</link>
		<comments>http://francoislord.com/blog/uncategorized/rocheuses-2009-jour-5_62#comments</comments>
		<pubDate>Thu, 12 Feb 2009 23:54:29 +0000</pubDate>
		<dc:creator>flord</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://francoislord.com/blog/?p=62</guid>
		<description><![CDATA[On a fait une déscente pour voir de quoi les conditions avaient l&#8217;air. C&#8217;etait tellement crap qu&#8217;il a fallu que je remonte  un bout à pied parce que j&#8217;étais pris dans une pente où il y avait plus de buissons que de neige. On est donc remonté dans la gondole pour aller prendre une bière [...]]]></description>
			<content:encoded><![CDATA[<p>On a fait une déscente pour voir de quoi les conditions avaient l&#8217;air. C&#8217;etait tellement crap qu&#8217;il a fallu que je remonte  un bout à pied parce que j&#8217;étais pris dans une pente où il y avait plus de buissons que de neige. On est donc remonté dans la gondole pour aller prendre une bière au resto le plus haut au Canada. Cinq ou six pintes plus tard, on est retournés faire la double diamant d&#8217;hier. J&#8217;avais de la misère à descendre parce que je riais trop.</p>
]]></content:encoded>
			<wfw:commentRss>http://francoislord.com/blog/uncategorized/rocheuses-2009-jour-5_62/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

