<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Andy Nicholas</title>
	
	<link>http://www.andynicholas.com</link>
	<description>Technical Resources for VFX and CG</description>
	<lastBuildDate>Tue, 24 Apr 2012 13:11:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AndyNicholas" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="andynicholas" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Softimage user group is reborn!</title>
		<link>http://www.andynicholas.com/?p=1666</link>
		<comments>http://www.andynicholas.com/?p=1666#comments</comments>
		<pubDate>Sun, 22 Apr 2012 15:08:26 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[Headline]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[XSI]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1666</guid>
		<description><![CDATA[After a couple of months of working on the website, I'm very excited to announce that www.softimagecreatives.com has gone live, officially announcing the resurrection of the London Softimage user group.]]></description>
			<content:encoded><![CDATA[<p>After a couple of months of working on the website, I&#8217;m very excited to announce the relaunch of the London Softimage user group, now known as the Softimage Creatives, or &#8220;SiC&#8221; for short. Our website has gone live today at <a href="http://www.softimagecreatives.com" target="_blank">www.softimagecreatives.com</a>.</p>
<p>Myself and <a href="http://www.softimagecreatives.com/siclondon/?page_id=724" target="_blank">6 others</a> are working hard to put together the first meeting on the 29th May. It will be held at The Jerusalem Bar in Soho, right underneath Passion Pictures.</p>
<p>How can you get involved? Well, there are three things you can do:</p>
<ol>
<li>This one&#8217;s compulsory! If you want to come along on 29th May, make sure you register for the event using the &#8220;Register&#8221; button on <a href="http://www.softimagecreatives.com/siclondon/?page_id=235" target="_blank">this page</a>.</li>
<li><a href="http://www.softimagecreatives.com/siclondon/?page_id=787" target="_blank">Let us know</a> if you want to present something at the meeting. It&#8217;ll be quite informal, and you&#8217;ll just be talking to people crowding around you, rather than an entire room. It&#8217;s more like a show and tell, it wouldn&#8217;t have to last more than 15 minutes, and others will be happening simultaneously as you do yours. It&#8217;ll be fun, nothing to be scared about!</li>
<li>We want to show off some of the work you&#8217;ve been doing by putting together a Softimage reel to show at the event. <a href="http://www.softimagecreatives.com/siclondon/?page_id=787" target="_blank">Get in touch</a> if we can use some of your gorgeous graphics in the video.</li>
</ol>
<p>One last thing. Tell everyone!</p>
<p>For more information about the event, including registration information, please <a href="http://www.softimagecreatives.com/siclondon/?page_id=235" target="_blank">visit this page</a>.</p>
<p>Twitter: <a href="https://twitter.com/#!/SIC_London" target="_blank">@SIC_London</a><br />
Facebook: <a href="http://www.facebook.com/pages/SoftimageCreatives/356159824418094" target="_blank">http://www.facebook.com/pages/SoftimageCreatives/356159824418094</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=bjSQC-Jbh3A:krEpBWvuz-w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=bjSQC-Jbh3A:krEpBWvuz-w:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=bjSQC-Jbh3A:krEpBWvuz-w:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=bjSQC-Jbh3A:krEpBWvuz-w:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=bjSQC-Jbh3A:krEpBWvuz-w:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=bjSQC-Jbh3A:krEpBWvuz-w:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=bjSQC-Jbh3A:krEpBWvuz-w:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=bjSQC-Jbh3A:krEpBWvuz-w:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=bjSQC-Jbh3A:krEpBWvuz-w:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/bjSQC-Jbh3A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1666</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started In ICE</title>
		<link>http://www.andynicholas.com/?p=1659</link>
		<comments>http://www.andynicholas.com/?p=1659#comments</comments>
		<pubDate>Mon, 27 Feb 2012 00:22:32 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[ICE]]></category>
		<category><![CDATA[XSI]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1659</guid>
		<description><![CDATA[Here's a video I put together for anyone who's looking for a fast overview of ICE. The video demonstrates some basic techniques with particles, and mostly uses the menus to keep things simple.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a video I put together for anyone who&#8217;s looking for a fast overview of ICE. The video demonstrates some basic techniques with particles, and mostly uses the menus to keep things simple.</p>
<p><object width="580" height="380"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=36662701&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=36662701&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="580" height="380"></embed></object><br /></p>
<p>It&#8217;s worth mentioning that ICE can do a whole lot more than just particles. Here&#8217;s a quick list off the top of my head:</p>
<ul>
<li>Mesh Deformation</li>
<li>Animation of object transforms (ICE kinematics)</li>
<li>Rigid body simulation</li>
<li>Cloth simulation (via Syflex ICE nodes)</li>
<li>Procedural modelling (as of XSI 2012)</li>
<li>Fluid simulation (with built in Lagoa Multiphysics, or alternatively <a target="_blank" href="http://www.mootzoid.com/wb/pages/softimagexsi/emfluid4.php">emFluid</a>)</li>
<li>Point rendering (via <a target="_blank"  href="http://www.mootzoid.com/wb/pages/softimagexsi/emrpc4.php">emRenderPointCloud</a>)</li>
</ul>
<p>So there really is no limit as to what you can do with ICE, and the best thing about it is that it&#8217;s just about the fastest thing out there.</p>
<p>If you&#8217;re into programming, then it also has a great SDK which allows you to develop your own multi-threaded ICE nodes, just in case there&#8217;s something you need to do that it can&#8217;t support natively. (So far, I&#8217;ve only needed to do that once when I had a particularly complex bit of array sorting and processing to do).</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=dK_MLsy-PVg:Pgbiz9lBUQA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=dK_MLsy-PVg:Pgbiz9lBUQA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=dK_MLsy-PVg:Pgbiz9lBUQA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=dK_MLsy-PVg:Pgbiz9lBUQA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=dK_MLsy-PVg:Pgbiz9lBUQA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=dK_MLsy-PVg:Pgbiz9lBUQA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=dK_MLsy-PVg:Pgbiz9lBUQA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=dK_MLsy-PVg:Pgbiz9lBUQA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=dK_MLsy-PVg:Pgbiz9lBUQA:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/dK_MLsy-PVg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1659</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building A Car Rig</title>
		<link>http://www.andynicholas.com/?p=1549</link>
		<comments>http://www.andynicholas.com/?p=1549#comments</comments>
		<pubDate>Thu, 05 Jan 2012 00:36:33 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[JScript]]></category>
		<category><![CDATA[XSI]]></category>
		<category><![CDATA[car]]></category>
		<category><![CDATA[dynamics]]></category>
		<category><![CDATA[rig]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1549</guid>
		<description><![CDATA[This tutorial was written for the November 2008 of 3D World magazine (issue 109). It shows how to create a rig for a 4 wheeled vehicle that uses spring dynamics to simulate suspension movement.]]></description>
			<content:encoded><![CDATA[<h3>Contents</h3>
<ul>
<li><a href="#Notes">Notes About This Tutorial</a></li>
<li><a href="#Introduction">Stage 1: Introduction</a></li>
<li><a href="http://www.andynicholas.com/?p=1549&#038;page=2">Stage 2:  Setting up suspension dynamics</a></li>
<li><a href="http://www.andynicholas.com/?p=1549&#038;page=3">Stage 3: Constructing the main rig</a></li>
<li><a href="http://www.andynicholas.com/?p=1549&#038;page=4">Stage 4: Rigging the CoG (center of gravity)</a></li>
<li><a href="http://www.andynicholas.com/?p=1549&#038;page=5">Stage 5: Adding pitching motion to body</a></li>
<li><a href="http://www.andynicholas.com/?p=1549&#038;page=6">Stage 6: Attaching the 3D mesh to the rig</a></li>
<li><a href="http://www.andynicholas.com/?p=1549&#038;page=7">Stage 7: Animation and Automatic Steering</a></li>
</ul>
<p><br/></p>
<hr/>
<br/></p>
<h3 id="Notes">Notes About This Tutorial </h3>
<p>&nbsp;<br />
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_MagazinePage.jpg" class="lightview" rel="gallery[1549]" title="CarRig_MagazinePage"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_MagazinePage-300x183.jpg" alt="CarRig_MagazinePage" title="CarRig_MagazinePage" width="300" height="183" class="alignleft size-medium wp-image-1578" /></a>This tutorial was written for the November 2008 of 3D World magazine (issue 109). It shows how to create a rig for a 4 wheeled vehicle that uses spring dynamics to simulate suspension movement.</p>
<p>Originally companion scene files were supplied for XSI version 6.5, along with a high resolution model for the vehicle. Since I don&#8217;t have the rights to distribute the model, I&#8217;ve replaced it with a (very ugly!) low resolution proxy. As a result, two of the scene files have been modified using XSI version 9.5. The original start scene is still in XSI 6 format, so you&#8217;ll be able to follow the tutorial if you have an old version of XSI.</p>
<p>Below is a video of what you can expect to create:</p>
<p><object width="580" height="380"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=34582767&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=34582767&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="580" height="380"></embed></object><br /></p>
<p>For clarity I&#8217;ve also uploaded a step-by-step video that shows the process. To make it easy to follow the article and watch the video at the same time, you can click the following image to open it in Vimeo in a new window:</p>
<div align="center"><a href="http://vimeo.com/34583632" target="_blank"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_VideoLink.jpg" alt="CarRig_VideoLink" title="CarRig_VideoLink" width="300" height="225" class="aligncenter size-full wp-image-1588" /></a></div>
<p><br/></p>
<p>One other side effect of recreating the tutorial for XSI 9.5 is that some of the simulation settings have changed. The tutorial text below has been updated to reflect the changes, but the step-by-step video has not. As a result, the old settings for the spring constant (14.0) and spring damping (1.0) will be seen in the video instead of the new settings (80 and 6 respectively). </p>
<p>A few other minor changes have been made to the text, but otherwise, it is exactly as printed in the original magazine. As such, the explanations are quite brief as there were constraints on the number of words. If you feel you need better a explanation of any of the steps, please leave a comment. </p>
<p>If you have any problems viewing the screenshot images at high enough resolution, either go full screen with your browser, or right click and select &#8220;Open Link In New Window&#8221;.</p>
<p>I&#8217;ve provided the following companion files as a single downloadable Zip file:</p>
<ul>
<li>Hummer.emdl</li>
<li>WheelTurnOp.js</li>
<li>vehiclerig_start.scn</li>
<li>vehiclerig_step16_XSI95.scn</li>
<li>vehiclerig_final_XSI95.scn</li>
</ul>
<p>If you want to follow along, then at the very least, you need to start with the &#8220;vehiclerig_start.scn&#8221; scene file.<br/><br />
<a href="/apnwp/wp-content/uploads/2012/01/CarRig_TutorialFiles.zip"><img class="downloadicon" src="http://www.andynicholas.com/apnwp/wp-content/themes/arthemia/images/download.gif" onmouseover="this.src='http://www.andynicholas.com/apnwp/wp-content/themes/arthemia/images/download_o.gif'" onmouseout="this.src='http://www.andynicholas.com/apnwp/wp-content/themes/arthemia/images/download.gif'" alt="Download..." width="92" height="20"/></a> XSI&nbsp;Tutorial&nbsp;Files V1.0 (881&nbsp;Kb)<br />
<br/></p>
<hr/>
<h3 id="Introduction">Introduction</h3>
<p>Designing a vehicle rig to accommodate every possible situation is a complex task, if not impossible. In most cases, you would have a specific rig for a specific set of circumstances. This has parallels with how cars are used in the movie industry where they might have several different versions for specific stunts, as well as a “hero” car for close up work.</p>
<p>The job of the rigger is to put together a system that will allow the animator to concentrate on creating a performance. The animator should never have to worry about the technical aspects of a damped spring system. If a rig is constructed properly, it will automatically respond and recreate the suspension’s subtle dynamics.</p>
<p>The rig that you’re about to make is designed to work for fairly flat surfaces. It has suspension based on a physics simulation which allows it to react to the underlying surface in a realistic way. There is a system to roll the car from front to back as it accelerates, and the vehicle will even steer automatically.</p>
<p>This tutorial is about the assembly of the physics simulation and constraints that make up the suspension, but it’s important to realise that there still leaves a lot to be desired from an animator’s point of view. For example, a rigger would typically provide a synoptic view (a special HTML driven toolbar) or a custom parameter page for the animator to easily access key controls in the rig. An animator may have to spend a huge amount of time with the rig, so it’s the rigger’s duty to make sure that it is as friendly to use as possible.</p>
<p>Also included is a free plug-in that I wrote specifically for this tutorial to rotate the wheels correctly. It’s a very simple script and I would encourage anyone thinking of becoming a TD or rigger to take a look and attempt to understand how it works. The script is fully commented to assist you as much as possible. Step two of the tutorial will take you through the installation process of this plug-in.</p>
<h3>Stage One: Applying the wheel turn plugin</h3>
<ol>
<li>
Start XSI and load the vehiclerig_start scene file. The scene already contains a basic hierarchy of the vehicle and wheel rig, as well as a simple terrain for testing the suspension later. Press [9] to open the schematic to see the rig structure. At the moment, we only have a rig for one wheel. We will duplicate this later for the other wheels after we have rigged it.</p>
<div align="center"><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_Step01.jpg" class="lightview" rel="gallery[1549]" title="CarRig_Step01"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_Step01-300x240.jpg" alt="CarRig_Step01" title="CarRig_Step01" width="300" height="240" class="aligncenter size-medium wp-image-1521" /></a></div>
</li>
<li>
First we need to install a plugin for making the wheels turn correctly. Go to <em>File &gt; Plugin Manager</em> and expand the <em>User Root</em> folder. Right click on the <em>Plug-ins</em> folder and select <em>Explore</em> from the menu. Copy the WheelTurnOp.js file from the downloaded files (see above) to this location. Click the <em>Update All</em> button in Plugin Manager and close its window. You now have a new menu called <em>CarRigging</em>.</p>
<div align="center"><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_Step02.jpg" class="lightview" rel="gallery[1549]" title="CarRig_Step02"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_Step02-300x240.jpg" alt="CarRig_Step02" title="CarRig_Step02" width="300" height="240" class="aligncenter size-medium wp-image-1522" /></a></div>
</li>
<li>
The plugin keeps track of where the wheel has moved from previous frames and applies the correct rotation to the <strong>Wheel_Rot</strong> object. In the schematic view, first select the orange <strong>Wheel_Rot</strong> object and go to the new <em>CarRigging</em> menu at the top of the screen. Select the <em>Apply WheelTurn Op</em> option from the menu and then, in the interactive picking session that starts, pick the green <strong>Wheel_Steer</strong> object. Set the <em>Radius</em> parameter for the operator to 3.75.</p>
<div align="center"><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_Step03.jpg" class="lightview" rel="gallery[1549]" title="CarRig_Step03"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2012/01/CarRig_Step03-300x240.jpg" alt="CarRig_Step03" title="CarRig_Step03" width="300" height="240" class="aligncenter size-medium wp-image-1523" /></a></div>
</li>
</ol>
<p>Move on to the <a href="http://www.andynicholas.com/?p=1549&#038;page=2">next page</a> to continue.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=gIVDan0aKGM:rapEhH68jmc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=gIVDan0aKGM:rapEhH68jmc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=gIVDan0aKGM:rapEhH68jmc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=gIVDan0aKGM:rapEhH68jmc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=gIVDan0aKGM:rapEhH68jmc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=gIVDan0aKGM:rapEhH68jmc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=gIVDan0aKGM:rapEhH68jmc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=gIVDan0aKGM:rapEhH68jmc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=gIVDan0aKGM:rapEhH68jmc:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/gIVDan0aKGM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1549</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Houdini Cheat Sheet</title>
		<link>http://www.andynicholas.com/?p=1344</link>
		<comments>http://www.andynicholas.com/?p=1344#comments</comments>
		<pubDate>Sat, 27 Aug 2011 23:03:11 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Houdini]]></category>
		<category><![CDATA[expressions]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1344</guid>
		<description><![CDATA[A cheat sheet for Houdini showing the most commonly used SOP operators, expressions, and variables.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick cheat sheet for Houdini that I wrote ages ago. It&#8217;s probably got about 95% of what you need to use when you first start out using Houdini. </p>
<p>Hope you find it useful.</p>
<h3>Common Houdini Surface operators (SOPs)</h3>
<table style="font-family: Times; line-height: normal; font-size: small;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Box, Sphere, Grid, Tube, Circle, Line, Torus, Curve</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Some basic operators that give you geometry primitives</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">File</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Loads a mesh (<span>obj</span>, <span>bgeo</span>, etc)</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Trace</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Uses a threshold to generate geometry from an image</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Add</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Creates individual points and/or polygons</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Merge</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Combines multiple pieces of geometry</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Point</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Manipulates point properties and attributes. The second input allows operations between two sets of points from different sources providing they have the same number.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Primitive</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Manipulates primitive (usually polygons) properties and attributes</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Transform</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Moves, rotates, and scales geometry</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Facet</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Most commonly used to calculate <span>normals</span>, but does a few other things too.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Group</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Allows you to assign a group to a set of vertices, points, or primitives. (A bit like XSI’s Clusters)</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Copy</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Copies input geometry. The second input allows you to copy the geometry from the first input, onto each point of the second input. This operator allows loop-style processing by using the Copy/Stamp feature.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Delete</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Deletes geometry. Can be used with a Copy operator to perform loop-style processing.</span></td>
</tr>
<tr>
<td width="103" valign="top"><span><em><span style="font-size: 10pt; font-family: Arial;">AttribCreate</span></em></span><em> </em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Allows you to store custom information at each vertex, point, primitive, or object</span></td>
</tr>
<tr>
<td width="103" valign="top"><span><em><span style="font-size: 10pt; font-family: Arial;">AttribTransfer</span></em></span><em> </em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Copies attributes from one piece of geometry to another. The geometry does not have to match (just like XSI’s GATOR).</span></td>
</tr>
<tr>
<td width="103" valign="top"><span><em><span style="font-size: 10pt; font-family: Arial;">AttribPromote</span></em></span><em> </em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Allows you to do various statistics on an attribute (e.g. average, minimum, maximum, mode, sum of squares, etc.) and transfer it to the corresponding vertex, point, or primitive.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Measure</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Allows you to calculate polygon area, perimeter or mesh curvature.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Cache</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Stores geometry in memory to allow for faster previews.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Trail</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Can calculate per a point velocity, or generate trails of points from animated geometry.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Skin</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Performs a “loft” style operation</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Resample</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Redistributes points along a curve</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Ray</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Does ray tracing based on point <span>nomal</span>. Can be used to shrink wrap one mesh onto another.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Cookie, Boolean</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Different types of Boolean style operations</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Sort</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Can sort point order based on various things.</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Peak</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Transforms points based on their <span>normals</span></span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Connectivity</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Creates an attribute with a value based on connectivity information. Works well with Partition operator</span></td>
</tr>
<tr>
<td width="103" valign="top"><em><span style="font-size: 10pt; font-family: Arial;">Partition</span></em></td>
<td width="465" valign="top"><span style="font-size: 9pt; font-family: Arial;">Assigns geometry to a group based on an attribute value. Often used with the Connectivity operator</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h3>Common Houdini Expressions</h3>
<p>You can find the full list of expressions here:<br />
<a target="_blank" href="http://www.sidefx.com/docs/houdini11.0/expressions/">http://www.sidefx.com/docs/houdini11.0/expressions/</a></p>
<table style="font-family: Times; line-height: normal; font-size: small;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="319" valign="top"><span><strong><span style="font-size: 10pt; font-family: Arial;">ch</span></strong></span><strong><span style="font-size: 10pt; font-family: Arial;">(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;parameter path&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Gets the current value of the parameter</span></td>
</tr>
<tr>
<td width="319" valign="top"><span><strong><span style="font-size: 10pt; font-family: Arial;">chf</span></strong></span><strong><span style="font-size: 10pt; font-family: Arial;">(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;parameter path&gt;,&lt;frame&gt; </span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Gets the value of the parameter at a particular frame</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">stamp(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;Copy SOP path&gt;, &lt;stamp variable&gt;, &lt;default value&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Retrieves the current value of the specified stamp variable (See Houdini docs for more info on the <a target="_blank" href="http://www.sidefx.com/docs/houdini11.0/copy/stamping">copy-stamping process</a>)</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">point(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;SOP path&gt;, &lt;point number&gt;, &lt;attribute name&gt;, &lt;index&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Retrieves a point attribute value. If attribute is a vector (e.g. position), then index specifies vector component (e.g., 0=”x”, 1=”y”, 2=”z”)</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">prim(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;SOP path&gt;, &lt;point number&gt;, &lt;attribute name&gt;, &lt;index&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Same as point, but for primitives</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">clamp(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;value&gt;,&lt;min&gt;,&lt;max&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Keeps the value within the minimum and maximum values</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">fit(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;value&gt;,&lt;min&gt;,&lt;max&gt;,&lt;<span>newmin</span>&gt;,&lt;<span>newmax</span>&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong><em> </em></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Remaps the value from the old range to the new range and clamps it.</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">fit01(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;value&gt;,&lt;<span>newmin</span>&gt;,&lt;<span>newmax</span>&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Just like <span>fit(</span>) but assumes value is already in the range 0 to 1.</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">smooth(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;value&gt;,&lt;min&gt;,&lt;max&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong><em> </em></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Outputs a smoothed value between 0 and 1 as value goes from minimum to maximum.</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">noise(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;x&gt;, &lt;y&gt;, &lt;z&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Returns a noise value for a given position in space.</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">rand(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;seed&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Gives a random number based on the seed value. The returned value will always be the same for a particular seed.</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">length(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;x&gt;, &lt;y&gt;, &lt;z&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Returns the length of the vector</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">distance(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;x1&gt;, &lt;y1&gt;, &lt;z1&gt;,&lt;x2&gt;, &lt;y2&gt;, &lt;z2&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Returns the distance between two points</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">if(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;<span>expr</span>&gt;, &lt;value if true&gt;, &lt;value if false&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Gives a choice of two values depending on the expression evaluating to true or false</span></td>
</tr>
<tr>
<td width="319" valign="top"><span><strong><span style="font-size: 10pt; font-family: Arial;">opinput</span></strong></span><strong><span style="font-size: 10pt; font-family: Arial;">(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;operator path&gt;, &lt;input index&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Returns the path of the operator connected to the input specified by the input index.</span></td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">bbox(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;SOP path&gt;, &lt;dimension type&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Returns the required measurement of the bounding box of some geometry. &#8220;dimension type&#8221; can be one of these:</span></p>
<p>D_XMIN, D_YMIN, D_ZMIN, D_XMAX, D_YMAX, D_ZMAX, D_XSIZE, D_YSIZE, D_ZSIZE</td>
</tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">centroid(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;SOP path&gt;, &lt;dimension type&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Returns the X, Y, or Z position of the center of the bounding box. &#8220;dimension type&#8221; can be one of these:</span></p>
<p>D_X, D_Y, D_Z</td>
</tr>
<tr>
<td width="319" valign="top"><strong><span style="font-size: 10pt; font-family: Arial;">pic(</span></strong><em><span style="font-size: 10pt; font-family: Arial;">&lt;COP path&gt;, &lt;u&gt;, &lt;v&gt;, &lt;color type&gt;</span></em><strong><span style="font-size: 10pt; font-family: Arial;">)</span></strong></td>
<td width="249" valign="top"><span style="font-size: 9pt; font-family: Arial;">Returns the interpolated pixel color from a compositing operator at the specified UV. “color type” can be one of these:</span></p>
<p>D_CR, D_CG, D_CB, D_CA, D_CHUE, D_CSAT, D_CVAL, D_CLUM</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Houdini expressions also contain the common mathematical functions that are found in most scripting and expression languages. Here are just a few:</p>
<p>sin, cos, tan, asin, acos, atan, atan2, abs, pow, sqrt, ceil, floor, atof, dot, cross, deg, rad, exp, frac, hsv, rgb, min, max, log, log10, round, substr, strreplace</p>
<p>Note: Trigonometric functions accept angles in degrees.</p>
<p>The modulus operation is achieved using the % character, and boolean logic is achieved using the standard C operators, i.e. <. >, <=, >=, ==, !=, !</p>
<h3>Common Houdini Expression Local Variables</h3>
<p>Important: The following variables are NOT available in every operator. Each operator has its own local variables, and you can find which ones in Houdini&#8217;s help documentation. The ones listed here are the ones you’ll most commonly encounter.</p>
<table style="font-family: Times; line-height: normal; font-size: small;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$PT</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Point number. Used in most SOPs that manipulate points</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$PR</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Primitive number. Used in most SOPs that manipulate primitives</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$CY</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Used by the Copy SOP to identify the current copy being made. <strong><em>Unless</em></strong> the second Copy input is being used, in which case $PT will be used instead.</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$TX, $TY, $TZ</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Position of a point</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$NX, $NY, $NZ</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Normal</span><span style="font-size: 9pt; font-family: Arial;"> of a point/primitive</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$CR, $CG, $CB, $CA</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Color of a point/primitive</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$VX, $VY, $VZ</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Velocity of a point</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$BBX, $BBY, $BBZ</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">The normalised (0 to 1) position of the point in the bounding box</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$CEX, $CEY, $CEZ</span></td>
<td width="385" valign="top"><span><span style="font-size: 9pt; font-family: Arial;">Centroid</span></span><span style="font-size: 9pt; font-family: Arial;"> of the geometry</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$AGE</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Number of seconds a particle has been alive</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$LIFE</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Normalised age (0 to 1) of a particle</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$XMIN, $XMAX, etc.</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Extents of the bounding box</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$SIZEX, $SIZEY, $SIZEZ</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Size of the bounding box</span></td>
</tr>
<tr>
<td width="183" valign="top"><span style="font-size: 10pt; font-family: Arial;">$TX2, $TY2, $TZ2</span></td>
<td width="385" valign="top"><span style="font-size: 9pt; font-family: Arial;">Used to identify the position of a point coming from the second input of a Point SOP. Similarly for other attributes, e.g. <span>Normals</span>, $NX2, etc.</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=7uMTIQQO28U:4kvO-F0SfU4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=7uMTIQQO28U:4kvO-F0SfU4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=7uMTIQQO28U:4kvO-F0SfU4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=7uMTIQQO28U:4kvO-F0SfU4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=7uMTIQQO28U:4kvO-F0SfU4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=7uMTIQQO28U:4kvO-F0SfU4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=7uMTIQQO28U:4kvO-F0SfU4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=7uMTIQQO28U:4kvO-F0SfU4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=7uMTIQQO28U:4kvO-F0SfU4:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/7uMTIQQO28U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1344</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>CineStyle for Canon EOS DSLRs</title>
		<link>http://www.andynicholas.com/?p=1275</link>
		<comments>http://www.andynicholas.com/?p=1275#comments</comments>
		<pubDate>Sun, 07 Aug 2011 16:27:56 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[5DMkII]]></category>
		<category><![CDATA[Canon]]></category>
		<category><![CDATA[Cinestyle]]></category>
		<category><![CDATA[colour space]]></category>
		<category><![CDATA[linear]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[sRGB]]></category>
		<category><![CDATA[Technicolor]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1275</guid>
		<description><![CDATA[All about Cinestyle. Technicolor's new picture style for the Canon 5D MkII.]]></description>
			<content:encoded><![CDATA[<h3>Contents</h3>
<ul>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#whyusecinestyle">Why use Cinestyle?</a></li>
<li><a href="#videonoiseindarks">Video noise in dark regions</a></li>
<li><a href="#takingstills">What about taking stills?</a></li>
<li><a href="#disadvantages">Are there any disadvantages?</a></li>
<li><a href="#installing">Installing Cinestyle</a></li>
<li><a href="#settingup">Setting up the Canon 5DMkII</a></li>
<li><a href="#shootingcinestyle">Shooting with Cinestyle</a></li>
<li><a href="#postprocessing">Post processing the footage</a></li>
<li><a href="#workingwithluts">Working with LUTs</a></li>
<li><a href="#linearcolourspace">What about Linear Colour Space?</a></li>
<li><a href="#goingfromhere">Where do we go from here?</a></li>
<li><a href="#afinalplea">A final plea</a></li>
</ul>
<h3 id="introduction">Introduction</h3>
<p>If you haven&#8217;t seen it already, Technicolor have released a custom Picture Style called <em>Cinestyle</em> for the Canon DSLRs. </p>
<blockquote><p><a target="_blank" href="http://www.technicolor.com/en/hi/cinema/filmmaking/digital-printer-lights/cinestyle">http://www.technicolor.com/en/hi/cinema/filmmaking/digital-printer-lights/cinestyle</a></p></blockquote>
<p>&nbsp;<br />
Apparently Technicolor have been working on this for the last year in an attempt to bring the Canon DSLRs more in line with other digital film cameras such as RED and the Alexa. The Cinestyle profile produces a very flat looking footage that retains a lot more detail in the darker areas. Technically speaking, it encodes the images received from the sensor into log colour space. Anyone used to working with raw footage from film will recognise the flat grade look to the footage. The aim is that it produces footage that is much easier to colour correct while retaining as much quality in the image as possible.</p>
<p>This post is an attempt to try to collate and filter as much up to date and correct information about Cinestyle and the practicalities of using it with the 5D MkII. There seems to be a lot of misunderstanding out there about what this is all about, particularly when it comes to working with lookup tables, or LUTs. (Nobody&#8217;s perfect though, so please leave a comment if you think I&#8217;ve got something wrong myself!)</p>
<p>Much of this information I&#8217;ll be sourcing from <a target="_blank" href="http://www.cinema5d.com/viewtopic.php?f=56&#038;t=30317">this thread</a> on the Cinema5D forum. I&#8217;ll try to provide links as I go through to give proper credit and so that you can read the posts for yourself. If there are any dead links, please let me know in the comments.</p>
<h3  id="whyusecinestyle">Why use Cinestyle?</h3>
<p>So first thing&#8217;s first; what are the benefits of using Cinestyle? Well, shooting in log colour space means that you retain more information in the darker and brighter areas. Note, that this doesn&#8217;t mean that you&#8217;re suddenly achieving greater dynamic range. The chip on your camera hasn&#8217;t changed and so you can&#8217;t magic dynamic range out of nowhere. All it means in practice is that you are getting better detail in the dark and light areas within the existing dynamic range.</p>
<p>All this messing around with the colour space is done before the lossy stages in the camera i.e. H264 compression (Source: <a target="_blank" href="http://www.cinema5d.com/viewtopic.php?f=56&#038;t=29407&#038;p=184003&#038;hilit=Cinestyle#p182866">post by Matt Thomas</a>) which, of course, makes sense as otherwise it would be further degrading the signal.</p>
<p>The thing worth noting about H264 compression is that it is most aggressive at the low and high ends of the luminosity range, so by using the log colour space, it is effectively moving the valuable colour information away from the nasty compression artifacts. Again, Matt Thomas explains the concept very well <a target="_blank" href="http://www.cinema5d.com/viewtopic.php?f=56&#038;t=30317&#038;p=185918&#038;hilit=Cinestyle#p185918">here</a>. He says:</p>
<blockquote><p>The principle behind CineStyle is to move your shadow details up, away from the more destructive shadow region, which the H264 CODEC will damage more aggressively. By moving your &#8220;blacks&#8221; up into the lower mids, you will have more compressed data devoted to subtle gradations from the h264 CODEC. The same is true for highlights. By keeping the contrast very low, it allows for your highlights to be moved further from the destructive part of the h264&#8217;s white points, which, like the black points, have much less detail allowed by the CODEC than mid tones allow.</p></blockquote>
<p>So I decided to put it to the test.</p>
<h3 id="videonoiseindarks">Video noise In dark regions</h3>
<p>The following images illustrate the big advantage of using Cinestyle with video. It&#8217;s designed to test the amount of noise in the dark levels of the image.</p>
<table>
<tr>
<td width="257" valign="top" style="padding-right: 10px;">
 The image on the right shows a still from the video output from the camera when Cinestyle is enabled. You can see, compared to the next set of images, the low contrast here produced by Technicolor&#8217;s picture style.
</td>
<td align="center">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidCinestylePictureProfile.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_VidCinestylePictureProfile"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidCinestylePictureProfile-300x168.jpg" alt="CsEOS_VidCinestylePictureProfile" title="CsEOS_VidCinestylePictureProfile" width="250" height="140" class="aligncenter size-medium wp-image-1324" /></a><br />
Cinestyle picture style (no LUT)
</td>
</tr>
</table>
<p>Once the lookup table is applied (in the right hand image below), the result is very similar to the video produced by the Normal picture mode (below on the left). More info later in this post on how to apply the lookup table.</p>
<table>
<tr>
<td align="center">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidNormalPictureProfile.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_VidNormalPictureProfile"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidNormalPictureProfile-300x168.jpg" alt="CsEOS_VidNormalPictureProfile" title="CsEOS_VidNormalPictureProfile" width="250" height="140" class="aligncenter size-medium wp-image-1326" /></a><br />
Normal picture style
</td>
<td align="center">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidCinestylePictureProfile_LUT.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_VidCinestylePictureProfile_LUT"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidCinestylePictureProfile_LUT-300x168.jpg" alt="CsEOS_VidCinestylePictureProfile_LUT" title="CsEOS_VidCinestylePictureProfile_LUT" width="250" height="140" class="aligncenter size-medium wp-image-1322" /></a><br />
Cinestyle picture style with LUT
</td>
</tr>
</table>
<p>This is where things get interesting. If we now apply a Exposure filter in After Effects with a value of +7.7 to both images, we get the following:</p>
<table>
<tr>
<td align="center">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidNormalPictureProfile_OverExposed.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_VidNormalPictureProfile_OverExposed"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidNormalPictureProfile_OverExposed-300x168.jpg" alt="CsEOS_VidNormalPictureProfile_OverExposed" title="CsEOS_VidNormalPictureProfile_OverExposed" width="250" height="140" class="aligncenter size-medium wp-image-1325" /></a><br />
Normal with +7.7 Exposure
</td>
<td align="center">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidCinestylePictureProfile_LUTOverExposed.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_VidCinestylePictureProfile_LUTOverExposed"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_VidCinestylePictureProfile_LUTOverExposed-300x168.jpg" alt="CsEOS_VidCinestylePictureProfile_LUTOverExposed" title="CsEOS_VidCinestylePictureProfile_LUTOverExposed" width="250" height="140" class="aligncenter size-medium wp-image-1323" /></a><br />
Cinestyle with LUT and +7.7 Exposure
</td>
</tr>
</table>
<p>You can see, even in the thumbnails, that there is noticeable banding in the image captured from the Normal picture style image (to see it more clearly, right click on each image and select &#8220;Open Link In New Window&#8221;). It&#8217;s pretty obvious that the Cinestyle video is giving us much more information in the dark areas. </p>
<h3 id="takingstills">What about taking stills?</h3>
<p>Okay, this bit was a surprise&#8230; If you take a picture using the Cinestyle mode while using Jpeg as your storage medium, you get the flat low contrast appearance in the image. All fine so far. What is surprising however, is that if you set the 5DMkII to store RAW, there is still a subtle yet noticeable difference. Usually, changing picture mode (even switching to black and white Monochrome mode) has no effect on the RAW image at all. However, in this case, something interesting is happening with Cinestyle.</p>
<p>With the two images below, at first glance the RAW doesn&#8217;t appear to be particularly affected by Cinestyle. RAW files basically ignore most of the camera settings like picture profiles, white balance, etc., so this would be as expected. </p>
<table>
<tr>
<td align="center" valign="top">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicNormalPictureProfile.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_PicNormalPictureProfile"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicNormalPictureProfile-300x200.jpg" alt="CsEOS_PicNormalPictureProfile" title="CsEOS_PicNormalPictureProfile" width="250" height="140" class="alignnone size-medium wp-image-1321" /></a><br />
Normal picture style
</td>
<td align="center" valign="top">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicCinestylePictureProfile.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_PicCinestylePictureProfile"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicCinestylePictureProfile-300x200.jpg" alt="CsEOS_PicCinestylePictureProfile" title="CsEOS_PicCinestylePictureProfile" width="250" height="140" class="alignnone size-medium wp-image-1319" /></a><br />
Cinestyle picture style
</td>
</tr>
</table>
<p>&nbsp;<br />
However, if we now overexpose both images, we get this:</p>
<table>
<tr>
<td align="center">
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicNormalPictureProfile_OverExposed.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_PicNormalPictureProfile_OverExposed"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicNormalPictureProfile_OverExposed-300x200.jpg" alt="CsEOS_PicNormalPictureProfile_OverExposed" title="CsEOS_PicNormalPictureProfile_OverExposed" width="250" height="140" class="alignnone size-medium wp-image-1320" /></a>
</td>
<td>
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicCinestylePictureProfile_OverExposed.jpg" class="lightview" rel="gallery[1275]" title="CsEOS_PicCinestylePictureProfile_OverExposed"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/08/CsEOS_PicCinestylePictureProfile_OverExposed-300x200.jpg" alt="CsEOS_PicCinestylePictureProfile_OverExposed" title="CsEOS_PicCinestylePictureProfile_OverExposed" width="250" height="140" class="alignnone size-medium wp-image-1318" /></a>
</td>
</tr>
</table>
<p>It&#8217;s a very subtle difference which you probably won&#8217;t notice unless you view the full size images side by side (again, just right click on each image and select &#8220;Open Link In New Window&#8221;). If you look in the darker areas, you&#8217;ll notice that the Normal picture profile hue tends towards red in the darker areas, whereas Cinestyle appears to retain the correct hue through to the darkest point.</p>
<p>Wow. So Cinestyle seems to be doing something genuinely funky with the colour processing pipeline in the 5DMkII. Something that none of the other picture styles do. This only goes to confirm that Technicolor must have been working very closely with Canon to implement Cinestyle.</p>
<h3 id="disadvantages">Are there any disadvantages?</h3>
<p>Yes, possibly. In tests I&#8217;ve done, it&#8217;s quickly apparent that there&#8217;s a black offset. A large number of posts online suggest that black is mapped to a value of 16. In my test however, it only appeared to be around 8. This would seem to be confirmed by the Cinestyle LUT. Going into After Effects and making a solid layer at RGB <8,8,8> and applying the Cinestyle LUT (see later), the resulting RGB value that the LUT returns is <1,1,1>, whereas an input of RGB <7,7,7> results in <0,0,0>.</p>
<p>If you want to see the black offset for yourself, the test is very easy to do on your camera and is noticeable just looking at the LCD viewfinder. Just leave the lens cap on and take two short bursts of video, one with Cinestyle, and one in Normal mode. Press the play button and flick between them using the front dial, you&#8217;ll be able to see that the black is obviously lighter in the Cinestyle footage. When I tested the colour values in After Effects, it gave values around 7 or 8 as the minimum.</p>
<p>Similar tests with overexposure showed that the white was <strong>not</strong> offset, i.e. with full exposure, it used the maximum white value of 255. The offset in the black helps to avoid the more destructive compression of H264, but it also means that we&#8217;re losing colour resolution. This could result in banding issues if the colour grading is pushed too far in the mid tones where there might not have been issue before. For a good example of this, see <a target="_blank" href="http://www.cinema5d.com/viewtopic.php?f=56&#038;t=30317&#038;p=186334&#038;hilit=Cinestyle#p186331">this post</a> by Richard Crook. Also, check out <a target="_blank" href="http://blog.cliffetzel.com/post/3724296989/hdslr-color-grading-before-and-after">this video</a> which discusses some of the problems involved using flatter colour profiles.</p>
<p>Which then leaves us in a bit of a dilemma. Should we be using Cinestyle at all? Unfortunately, I don&#8217;t think there&#8217;s an easy answer. I&#8217;d say that it depends on what you&#8217;re going to shoot. As Richard says in a <a target="_blank" href="http://www.cinema5d.com/viewtopic.php?f=56&#038;t=30317&#038;p=186334&#038;hilit=Cinestyle#p186331">later post</a>:</p>
<blockquote><p>If you are shooting a situation like, for example, in a forest&#8230;then banding is a moot point because there is so much texture it doesn&#8217;t matter. But shooting a low dynamic range subject like the sky or a wall, both with subtle gradients, a flatter profile like Cinestyle isn&#8217;t a good choice.
</p></blockquote>
<p>That makes sense to me. From a post production point of view though, it&#8217;s a bit of a pain, because if the camera operator is switching between different colour profiles on a per shot basis, then that&#8217;s one more thing you (or the clapper loader) has to keep track of.</p>
<h3 id="installing">Installing Cinestyle</h3>
<p>To install the Cinestyle profile, you first need to download it from <a target="_blank" href="http://www.technicolor.com/en/hi/cinema/filmmaking/digital-printer-lights/cinestyle">Technicolor&#8217;s website</a>.</p>
<p>Once you&#8217;ve got that, you need to make sure that you have the EOS Utility installed on your machine. It&#8217;s supplied on a CD that came with the 5DMkII, but if you don&#8217;t have it handy then you can download EOS Utility from <a target="_blank" href="http://www.usa.canon.com/cusa/support/consumer/eos_slr_camera_systems/eos_digital_slr_cameras/eos_5d_mark_ii#DriversAndSoftware">Canon US</a>. The only issue with downloading it, is that it&#8217;s engineered by Canon to be an update-only install (why do they make things so hard for us!!). Luckily, it&#8217;s quite easy to turn the update installation into a full one. Full instructions can be found on <a target="_blank" href="http://www.northlight-images.co.uk/article_pages/install_canon_software.html">Keith Cooper&#8217;s photography website</a>.</p>
<p>The step by step instructions for installation can be found at <a target="_blank" href="http://www.technicolor.com/en/hi/cinema/filmmaking/digital-printer-lights/cinestyle">Technicolor</a>, but for your convenience, I&#8217;ve copied them in below.</p>
<ol>
<li>Ensure that EOS Utility v2.6 or later is installed on your computer</li>
<li>Download the Technicolor CineStyle Picture Style file</li>
<li>Connect your camera to your computer using the appropriate USB cable<br />
Note: for the EOS 5D Mark II you may need to set &#8220;Communication&#8221; to &#8220;PC connect.&#8221; in the camera&#8217;s menu</li>
<li>Start the Canon EOS Utility</li>
<li>Select &#8220;Camera settings/Remote shooting&#8221; on the main window</li>
<li>Once the capture window opens, click the camera icon</li>
<li>Click &#8220;Register User Defined style&#8221; under &#8220;Shooting menu&#8221;</li>
<li>Once the new page &#8220;Register Picture Style File&#8221; opens, select one of User Def. 1, 2 or 3 at the top of the new page</li>
<li>Click the open file icon</li>
<li>Select the CineStyle.pf2 file you&#8217;ve just downloaded</li>
<li>Click on OK</li>
</ol>
<h3 id="settingup">Setting up the Canon 5DMkII</h3>
<p>There are a couple of subtle issues that you should be aware of to maximise your the quality of your footage. Neither of them are killers, but it&#8217;s a good idea to be aware of them.</p>
<p>The first thing to know (and the source for the following explanation is a great in-depth article at <a target="_blank" href="http://shootintheshot.joshsilfen.com/2010/05/13/canon-hd-dslr-native-iso/">Josh Silfen&#8217;s website</a>), is about how the 5DMkII works with the ISO setting. To paraphrase Josh&#8217;s article, the sensor in your camera has an intrinsic ISO setting associated with it of ISO 100. The ISOs that are at doubling sensitivities above this (i.e. 200, 400, 800, 1600, 3200, 6400) are also native ISO&#8217;s (derived, I suspect, from directly manipulating the way the sensor is employed). All the other ISOs are based on these and are either 1/3 stop over or under exposed.</p>
<p>For example, it is approximately true that:</p>
<blockquote><p>
<strong>ISO 320</strong>   =   <strong>ISO 400</strong> x 2^(-1/3)<br />
<strong>ISO 500</strong>   =   <strong>ISO 400</strong> x 2^(+1/3)
</p></blockquote>
<p>This is a digital process after the image has been captured, and means that from a visual point of view, the pull down ISOs of 160, 320, 640, etc. will appear to have less noise. Unfortunately, the stopping down also means we have less dynamic range, as the highlights lose 1/3 of a stop as well. We end up with a trade off, and so it&#8217;s definitely something to be aware of. Please read <a target="_blank" href="http://shootintheshot.joshsilfen.com/2010/05/13/canon-hd-dslr-native-iso/">Josh&#8217;s full article</a> on this for more in depth information.</p>
<p>The other thing to know, is why you probably shouldn&#8217;t use Highlight Tone Priority. Again, Josh comes to our rescue with another brilliant post on this which you can find <a target="_blank" href="http://shootintheshot.joshsilfen.com/2010/11/29/highlight-tone-priority-in-canons-dslrs/">here</a>. Essentially, the message is that Highlight Tone Priority doesn&#8217;t give you any extra dynamic range, and you have a little less control over exactly what the camera is capturing. You&#8217;re doing colour correction in-camera, rather than in post.</p>
<h3 id="shootingcinestyle">Shooting with Cinestyle</h3>
<p>The main thing to know is not to set the exposure for your video with the CineStyle profile enabled. As Richard Crook notes in <a target="_blank" href="http://www.cinema5d.com/viewtopic.php?f=56&#038;t=30317&#038;hilit=technicolor+cinestyle&#038;start=190#p187680">this post</a>, going a stop either side of the correct exposure makes little difference to what you can see in the camera&#8217;s LCD screen. That&#8217;s a big change to be unaware of.</p>
<p>So unfortunately that means you&#8217;ll need to set up the exposure using the Normal picture style, and then switch to Cinestyle for capture. Not ideal. It&#8217;d be great if it were possible to capture using one style and preview using another, but I guess we&#8217;ll have to keep wishing.</p>
<h3 id="postprocessing">Post processing the footage</h3>
<p>Once you&#8217;ve taken your video, what&#8217;s the best way to process it? RareVision&#8217;s tool <a target="_blank" href="http://rarevision.com/5dtorgb/">5DToRGB</a> will convert your H.264 quicktime movie into DPX files using some sort of clever processing technique to achieve better results than the standard quicktime codec for decompression.</p>
<p>If you&#8217;ve got a lot of files to convert, you can use this <a target="_blank" href="http://www.noside.fr/5dtorgb-batch/">batch tool</a> from Noside to convert multiple videos at once using 5DToRGB.</p>
<p>The footage that comes out of the camera looks very flat. That&#8217;s why Technicolor provide a lookup table (LUT) to view the footage with. In order to use it with After Effects, you can download for free <a target="_blank" href="http://www.redgiantsoftware.com/products/free/">Magic Bullet LUT Buddy 1.0</a>. This allows you to apply the LUT to a layer as an effect. There seems to be a couple of issues with LUT Buddy crashing, but it is possible to work around the problem by converting the LUT to a different format. More information on this fix from <a target="_blank" href="http://www.larssteenhoff.com/blog/?p=1299">Lars Steenhoff&#8217;s blog post</a>.</p>
<h3 id="workingwithluts">Working with LUTs</h3>
<p>There seems to be a fair bit of misunderstanding in the online DSLR community about what LUTs are and how to work with them. It&#8217;s understandable, as they&#8217;re not something most photographers have to deal with, so there follows a brief explanation.</p>
<p>In an ideal world, before manipulation in post with CGI and compositing, all footage should be converted into linear colour space (sometimes also called &#8220;scene referred&#8221; colour space). Linear colour space is where the brightness of a pixel is directly proportional to the amount of light that it received in the camera, i.e. a doubling of pixel intensity, means double the received light. </p>
<p>Most people are used to using images that are encoded in sRGB colour space. This has a gamma correction curve of approximately 2.2 encoded into the intensities so that it displays correctly on a monitor (which has a response curve of 2.2). But this means that for an sRGB image, if a pixel receives double the intensity in camera, it won&#8217;t be double the brightness in the image. </p>
<p>The problem with using and manipulating sRGB images is that a lot of mathematical operations in compositing don&#8217;t work due to the maths being affected by the baked in gamma curve. On the other hand, although we can use linear images, they don&#8217;t look very good when directly viewed on monitors and it&#8217;s very hard to make aesthetic judgements.</p>
<p>This is where LUTs are a big help. They allow us to view images in one colour space (i.e. sRGB), while the software processes them in another (i.e. linear). It&#8217;s a little bit like looking through a pair of sunglasses; the image isn&#8217;t being being changed, but it&#8217;s altered at the last minute for your benefit so that you can see it properly.</p>
<p>So in VFX, LUTs are used all the time to work with footage in linear colour space during compositing. It means that the software can do all it&#8217;s operations correctly in linear space, while we can view the result through the LUT that turns it into something that we can view properly on our monitor. In addition, we&#8217;ll often encode a grade (colour correction) into the LUT so that we can see how the final image will appear once the colourists have done their magic on it and applied the final look.</p>
<p>The problem with software like After Effects, is that their colour space handling is extremely confusing to deal with. Seeing as After Effects doesn&#8217;t directly support LUTs (as pointed out in the comments section, CS5 now has a plugin to apply LUTs in a similar way to Magic Bullet, unfortunately there&#8217;s still no way to load a LUT into the colour management settings), then I&#8217;d generally recommend applying LUT Buddy to an adjustment layer at the top of the main composition. As you work, everything can be viewed with this applied.</p>
<p>Colour corrections can be done before or after the LUT layer. In fact, you can even throw away the LUT altogether and do your own grade from scratch. It&#8217;s a little bit arbitrary for reasons explained in the next section.</p>
<h3 id="linearcolourspace">What about Linear Colour Space?</h3>
<p>That&#8217;s a very good question. The big problem with Cinestyle is that the supplied LUT converts from a log based colour space to something very similar to the original REC 709 colour space, and NOT linear. A lot of people online are saying that the LUT <strong>does</strong> convert to linear, but it doesn&#8217;t as the final result still looks perceptually correct on a 2.2 monitor. This means that it must have a 2.2 gamma correction applied to it, and so it&#8217;s probably REC 709 or sRGB. </p>
<p>As of this moment in time, Technicolor have not released a LUT to go from Cinestyle to linear. This is a bit of a major issue for anyone wanting to composite with this footage. In theory, it should be possible to use the LUT to convert from Cinestyle to REC 709, and then convert from REC 709 to linear, although I&#8217;ve not tested it&#8217;s accuracy yet.</p>
<h3 id="goingfromhere">Where do we go from here?</h3>
<p>In lieu of Technicolor releasing a Cinestyle to Linear lookup table, I believe the next step is to look into measuring the camera response curve and deriving my own lookup table to convert to linear space. I believe a paper exists by Paul Debevec that illustrates this process. I&#8217;ll post a link if I can find it.</p>
<h3 id="afinalplea">A final plea</h3>
<p>Dear Technicolor. Cinestyle is great and opens up our ability to capture higher quality video, but it&#8217;s severely limiting if the proper technical details aren&#8217;t released to the community to allow us to use it in the correct way. The lack of a clear specification of what the supplied LUT actually does (i.e. the destination colour space) is a surprising omission in this release. Publicly releasing a LUT to go from Cinestyle to Linear would be a simple solution to this problem.</p>
<p>Please, give us more information!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=flJKJJkErjI:kBa2JuX087k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=flJKJJkErjI:kBa2JuX087k:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=flJKJJkErjI:kBa2JuX087k:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=flJKJJkErjI:kBa2JuX087k:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=flJKJJkErjI:kBa2JuX087k:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=flJKJJkErjI:kBa2JuX087k:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=flJKJJkErjI:kBa2JuX087k:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=flJKJJkErjI:kBa2JuX087k:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=flJKJJkErjI:kBa2JuX087k:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/flJKJJkErjI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1275</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>AT&amp;T Spring</title>
		<link>http://www.andynicholas.com/?p=1209</link>
		<comments>http://www.andynicholas.com/?p=1209#comments</comments>
		<pubDate>Sat, 19 Mar 2011 16:25:22 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[ICE]]></category>
		<category><![CDATA[XSI]]></category>
		<category><![CDATA[Arnold]]></category>
		<category><![CDATA[Mill]]></category>
		<category><![CDATA[particles]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1209</guid>
		<description><![CDATA[A question and answer session discussing the techniques used for the AT&#038;T Spring commercial. This was a job I jointly led in our Mill New York office earlier this year.

Written for 132nd edition of Digital Media World Magazine.]]></description>
			<content:encoded><![CDATA[<blockquote><p>This was taken from a question and answer session where I discussed the techniques used for the AT&#038;T Spring commercial; a job I jointly led at our Mill New York office earlier this year.</p>
<p>Written for 132nd edition of <a target="_blank" href="http://www.digitalmedia-world.com/">Digital Media World Magazine</a>.
</p></blockquote>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_WashingtonStChicago_Clean.jpg" class="lightview" rel="gallery[1209]" title="ATT_WashingtonStChicago_Clean"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_WashingtonStChicago_Clean-300x168.jpg" alt="ATT_WashingtonStChicago_Clean" title="ATT_WashingtonStChicago_Clean" width="300" height="168" class="alignleft size-medium wp-image-1241" /></a></p>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_WashingtonStChicago.jpg" class="lightview" rel="gallery[1209]" title="ATT_WashingtonStChicago"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_WashingtonStChicago-300x168.jpg" alt="ATT_WashingtonStChicago" title="ATT_WashingtonStChicago" width="300" height="168" class="alignleft size-medium wp-image-1242" /></a></p>
<p><b><big>Q. </big></b><em>How does this vine growing simulation relate to or borrow from the familiar particle, flocking, crowd or even city-building simulations? If you have based it on existing software could you say what that is?</em></p>
<p><b><big>A. </big></b>The vine growing simulation was created inside Autodesk&#8217;s XSI using ICE. ICE is such a fast and flexible system to use that it makes it easy to prototype a wide range of ideas very quickly. We were also rendering in XSI, so keeping the majority of the work in a single 3D application helped to simplify the job considerably.</p>
<p>The system itself was constructed from scratch. It used particles to crawl over the buildings leaving ICE strand trails behind that represented the vine growth. After the vine particle moved a random distance, a stalk particle was generated and a leaf was attached to the end of it. As the stalk grew, the leaf would proceed through an animation to represent the emergence of the leaf from the bud. Every now and then, a new vine branch would get generated and the process repeated recursively up to a limit. If we needed flowers on the vines, then we&#8217;d just occasionally swap in a flower instead of a leaf.</p>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_HouseWide_Clean.jpg" class="lightview" rel="gallery[1209]" title="ATT_HouseWide_Clean"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_HouseWide_Clean-300x168.jpg" alt="ATT_HouseWide_Clean" title="ATT_HouseWide_Clean" width="300" height="168" class="alignright size-medium wp-image-1235" /></a></p>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_HouseWide.jpg" class="lightview" rel="gallery[1209]" title="ATT_HouseWide"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_HouseWide-300x168.jpg" alt="ATT_HouseWide" title="ATT_HouseWide" width="300" height="168" class="alignright size-medium wp-image-1236" /></a></p>
<p>There were only a couple of shots in the AT&#038;T commercial that required seeing the vines and flowers grow together, but the growing simulation was still used for many of the static shots like Chicago&#8217;s Washington Street as it provided a nice natural coverage of the buildings. Particle systems based on volume emission were used for many of the wider shots and also for where the flowers and leaves needed to look a bit more bushy. </p>
<p>For some elements we used the Ivy Generator written by Thomas Luft (University of Konstanz). It&#8217;s a free to use application (even for commercial use) for creating ivy vines and leaves. It&#8217;s available to download from his own university webpage (http://graphics.uni-konstanz.de/~luft/ivy_generator/). Initially we thought that we&#8217;d use it on most of the shots, but we had to be careful to make sure it matched the look of our own ivy and it didn&#8217;t offer us quite as much control to art direct the growth of the ivy as our own proprietary system. In the end, we mainly used it for dangling ivy from bridges.</p>
<p>Finally, when we needed precise control over the placement of vines, bezier curves could be hand drawn and snapped onto the underlying geometry. ICE set-ups would use these curves to generate renderable vines and scatter leaves and flowers. That was a big time saver and it really helped to blend in some of the particle generated elements. It was kind of fun drawing them on with our Wacom tablets so it made for a nice break from tweaking the simulations.</p>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_LincolnMemorial.jpg" class="lightview" rel="gallery[1209]" title="ATT_LincolnMemorial"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_LincolnMemorial-300x168.jpg" alt="ATT_LincolnMemorial" title="ATT_LincolnMemorial" width="300" height="168" class="alignleft size-medium wp-image-1237" /></a><b><big>Q. </big></b><em>How are plates chosen that will work well with the application?</em></p>
<p><b><big>A. </big></b>The plates weren&#8217;t chosen for the ivy simulation as it was still in development at the time of editing. However the directors (Josh and Jonathan Baker from TWiN) had a clear vision of exactly how far the ivy and the flowers should have grown on each shot. It made life a lot easier during the layout process as it minimised experimentation. Some of the shots were nudged or swapped around in the edit to support the narrative as the work progressed. Having this flexibility in the edit meant that we could let the plate dictate to some degree the composition of the ivy and helped it feel more natural.</p>
<p><b><big>Q. </big></b><em>How do you give the application enough 3D information about the scene so it knows the coverage it needs to achieve?</em></p>
<p><b><big>A. </big></b>As you&#8217;d expect, the first process was to track the plate. We found that we needed to get a similar level of accuracy as if we were tracking a plate for stereoscopic 3D because we needed to get a tight geometry match. No cheating was allowed! Once we&#8217;d built the model, positions were specified for the ivy to sprout from. The ivy grows simultaneously from multiple locations but each root can be given different behaviour, such as speed of growth, duration, and direction. It gave us a lot of control over the layout. Additionally, hints, in the form of arrow shaped objects, were placed to act as a force field to guide the way the ivy crawled across the surface. </p>
<p><b><big>Q. </big></b><em>what other essential information does it need about the scene and about the plants, flowers etc before it can start?</em></p>
<p><b><big>A. </big></b>The most important controlling factor over the plants is the direction that the underlying surface is facing. Everything about the growth and orientation of the leaves and flowers is based on that. The model had to be adjusted in several cases to get the desired response. Some shots benefited from the flowers being made to turn slightly towards camera which helped to increase the sense of volume to the foliage.</p>
<p><b><big>Q. </big></b><em>Can the density be controlled?</em><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_RandysDonuts_Clean.jpg" class="lightview" rel="gallery[1209]" title="ATT_RandysDonuts_Clean"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_RandysDonuts_Clean-300x168.jpg" alt="ATT_RandysDonuts_Clean" title="ATT_RandysDonuts_Clean" width="300" height="168" class="alignleft size-medium wp-image-1239" /></a><br />
<a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_RandysDonuts.jpg" class="lightview" rel="gallery[1209]" title="ATT_RandysDonuts"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_RandysDonuts-300x168.jpg" alt="ATT_RandysDonuts" title="ATT_RandysDonuts" width="300" height="168" class="alignleft size-medium wp-image-1240" /></a></p>
<p><b><big>A. </big></b>Being essentially a recursive system, the ivy simulation was very sensitive to small changes in its setup, which meant it was necessary to try to keep everything about the inputs to the simulation as consistent as possible. For example, we were very careful to keep the scale of the scenes the same so that once we achieved a look that we liked, we could leave all the controls for leaf emission and density alone. This simplified everything considerably and meant we could achieve a consistent look across all the shots.</p>
<p>The important aesthetic that was tweaked on each shot was the relative layout of the flowers and leaves. Generally, we used flowers to accentuate the lit areas of the plate while the leaves tended to be kept to the shade. Not only did it make sense that a plant would grow that way, but it also helped to get a better sense of depth and shape. It also meant we could keep the orange colors bright and avoid the potential for muddy browns. All of this can be seen to best effect in the &#8220;Randy&#8217;s Donut&#8221; shot in the 60 second version of the spot. </p>
<p><b><big>Q. </big></b><em>Once the plants and flowers are in place, how does the lighting work so that they look like a natural part of the environment?</em></p>
<p><b><big>A. </big></b>For many of the shots, we used the Arnold renderer due to the excessive amount of particle instanced geometry we were using. Arnold chews this stuff up and it meant that we could get quite ambitious with the level of detail that we put into some of the shots. For one of the wider city shots at the end of the 60 sec spot we actually used individual flower and leaf instances, despite the fact that you could fit several into a single pixel of the final image. The amount of geometry didn&#8217;t seem to matter and in the end it helped to really sell the scale of it all and remain consistent to the other shots with the lighting.</p>
<p>Arnold is also extremely good at bouncing light around in a soft diffuse way. This was perfect for the shot where the man walks out of his house to find it covered in flowers. The final image you see in the spot is pretty close to the render we got straight out of XSI. We just cranked up the bounce lighting component for the shader which helped to soften the lighting and steered it towards the complex light interaction that you get within dense foliage.</p>
<p>For the closeup shots we used mental ray because we know how to get the most out of it to be able to really sell the level of detail that was needed. If you look closely you should be able to see a subtle hair system that was added to the vines for increased realism. Mental ray also has the advantage that it&#8217;s The Mill&#8217;s primary renderer, so all of our artists know it very well. </p>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_NewOrleans.jpg" class="lightview" rel="gallery[1209]" title="ATT_NewOrleans"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_NewOrleans-300x168.jpg" alt="ATT_NewOrleans" title="ATT_NewOrleans" width="300" height="168" class="alignright size-medium wp-image-1238" /></a><b><big>Q. </big></b><em>When it comes to including the hand animated flowers in the foreground,is this an artistic type of decision &#8211; that is, does the simulation  hold up only at certain distances from the camera?</em></p>
<p><b><big>A. </big></b>For me, I think the opening shots of the commercial go to prove that you can&#8217;t beat an animator&#8217;s sense of timing and composition. Those shots work really well and the level of control the animators have is way above what I can offer as an FX TD writing a simulation. </p>
<p>We did find that from initial tests, the simulation was able to stand up to fairly close scrutiny due to the visual complexity of the stalks and leaves. For the New Orleans balcony shot we used a hand animated rig in the immediate foreground but we were able to use the particle simulation for the rest of the layout. It&#8217;s also one of the few shots where we can see the flowers and leaves growing using the particle system.</p>
<p><b><big>Q. </big></b><em>Are your hand-animated flowers all CG elements or could you employ some live action footage of real flowers?</em></p>
<p><b><big>A. </big></b>I think it was felt that timelapse footage has the potential to look quite flickery unless done in a very controlled environment, so all the flowers and ivy were done in CG. If we&#8217;d gone the timelapse route, I think it would have been tricky to capture all the elements at the correct angles and lighting that we&#8217;d have needed.</p>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_FirstGrowth.jpg" class="lightview" rel="gallery[1209]" title="ATT_FirstGrowth"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_FirstGrowth-300x168.jpg" alt="ATT_FirstGrowth" title="ATT_FirstGrowth" width="300" height="168" class="alignleft size-medium wp-image-1232" /></a><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_FlowerOpening.jpg" class="lightview" rel="gallery[1209]" title="ATT_FlowerOpening"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/03/ATT_FlowerOpening-300x168.jpg" alt="ATT_FlowerOpening" title="ATT_FlowerOpening" width="300" height="168" class="alignleft size-medium wp-image-1233" /></a><b><big>Q. </big></b><em>Are the animators working with the same elements that the simulation is using to populate the environments?</em></p>
<p><b><big>A. </big></b>No, the assets were quite separate. We had a custom rig for the animation team to be able to grow vines and sprout leaves, and we always had them animating the high resolution flowers. We could blend them in quite easily with the particle based flowers in the distance if necessary.</p>
<p><b><big>Q. </big></b><em>This application could really be useful in many situations. What ways have you been considering that you could extend or modify it to work for other projects?</em></p>
<p><b><big>A. </big></b>The first step would be looking into simplification of the simulation. We used three independent particle systems for the vines, stalks, and leaves/flowers and it proved to be a little cumbersome for caching. We occasionally ran into synchronisation issues where leaves would start sprouting in mid air! </p>
<p>After that, it&#8217;s all about adding controllability and stability to the system for artists who maybe haven&#8217;t quite got into ICE yet but might need to use similar functionality in their projects. Adding convincing vegetation is one of those things that CG generally finds to be quite a difficult challenge, so having a stock solution like this is always useful.</p>
<h2>Credits</h2>
<blockquote><p>
<strong><big>Agency</big></strong><br />
<strong>Agency:</strong> BBDO<br />
<strong>Producer:</strong> Jenny Russo Novak<br />
<strong>Creative Director:</strong> Bobby Pierce, Jean Robaire, Stephen McMennamy</p>
<p><strong><big>Production</big></strong><br />
<strong>Production Company:</strong> Rabbit Content<br />
<strong>Director:</strong> TWiN<br />
<strong>Executive Producer:</strong> Jeff Sommar, Joby Barnhart<br />
<strong>Producer:</strong> Zac Zimmerman</p>
<p><strong><big>Editorial</big></strong><br />
<strong>Editing Company:</strong> Arcade Edit<br />
<strong>Editor:</strong> Paul Martinez<br />
<strong>Edit Assist:</strong> Will Hasell</p>
<p><strong><big>Post-Production / VFX</big></strong><br />
<strong>Post-Production / VFX Company:</strong> Mill New York<br />
<strong>Mill Office:</strong> New York<br />
<strong>VFX Producer:</strong> Boo Wong<br />
<strong>Shoot Supervisor:</strong> Angus Kneale, Michael Gibson, Adrian Hurley<br />
<strong>2D Lead Artists:</strong> Westley Sarokin<br />
<strong>3D Lead Artists:</strong> Rob Petrie, Andy Nicholas<br />
<strong>2D Artists:</strong> Markus Lundqvist<br />
<strong>3D Artists:</strong> Andrew Proctor, Vince Baertson, Eva Kuehlmann, Jeff Dates, Boris Ustaev, Ajit Menon, Sam Crees, Naotaka Minami, Hassan Taimur, James Williams<br />
<strong>Assist:</strong> Brendan O’Neil, Brian Houlihan<br />
<strong>Colourist:</strong> Fergus McCall<br />
<strong>Additional: Nuke:</strong> Antoine Douadi, Francois Turquety, Dexter Davey
</p></blockquote>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=taAj1U_6X7E:C9xEi-tIuhE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=taAj1U_6X7E:C9xEi-tIuhE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=taAj1U_6X7E:C9xEi-tIuhE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=taAj1U_6X7E:C9xEi-tIuhE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=taAj1U_6X7E:C9xEi-tIuhE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=taAj1U_6X7E:C9xEi-tIuhE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=taAj1U_6X7E:C9xEi-tIuhE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=taAj1U_6X7E:C9xEi-tIuhE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=taAj1U_6X7E:C9xEi-tIuhE:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/taAj1U_6X7E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1209</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shooting on the GoPro Hero HD</title>
		<link>http://www.andynicholas.com/?p=1118</link>
		<comments>http://www.andynicholas.com/?p=1118#comments</comments>
		<pubDate>Sat, 01 Jan 2011 20:40:31 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[GoPro]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1118</guid>
		<description><![CDATA[If you're thinking of shooting video for any sort of extreme sport, then the GoPro Hero HD camera is a great choice. I used one for filming a windsurfing holiday in Egypt last year and got some great footage.

Here's 10 practical tips for shooting on the GoPro Hero HD camera.]]></description>
			<content:encoded><![CDATA[<p>Happy New Year folks. I&#8217;ve not posted here for a few months now as things have been pretty busy, but I wanted to write a short blogpost about using the <a href="http://www.goprocamera.com/products/hd-hero-naked-camera.php" target="_blank">GoPro Hero HD</a> camera.</p>
<p><iframe class="alignright" width="250" height="250" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?ie=UTF8&amp;hl=en&amp;msa=0&amp;msid=210290647999076127642.000498896f83e308ef0b1&amp;ll=28.88316,34.244385&amp;spn=3.337553,6.04248&amp;z=7&amp;output=embed"></iframe></p>
<p>Last November I took a break in Dahab, Egypt. It&#8217;s a great place to windsurf, mainly because it&#8217;s a damn sight warmer than over here in the UK, but it also has a large lagoon which protects the main bay from any swell and stops you getting swept out to sea (kinda handy!).</p>
<p>I was over there two years before and managed to get some great shots with my old Canon 300D of some of the pro&#8217;s doing various tricks like the &#8220;Grubby&#8221; pictured below (This is what it <a target="_blank" href="http://www.youtube.com/watch?v=MjPM8qtiv1M">should look like</a>).</p>
<p><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/01/Dahab01.jpg" class="lightview" rel="gallery[1118]" title="Dahab Windsurfer"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2011/01/Dahab01-199x300.jpg" alt="Dahab Windsurfer" title="Dahab Windsurfer" width="199" height="300" class="alignleft size-medium wp-image-1125" /></a></p>
<p><br/><br />
A word of warning for anyone doing much travelling at the moment. It seems that some of the airlines leaving the UK are getting quite strict about carry-on baggage weight. I&#8217;m a bit of a gadget freak, and I don&#8217;t particularly trust the baggage handling system, so my carry-on bag had a Macbook Pro, iPad, Canon 5D MkII (with two lenses) and the GoPro HD camera. The check-in girl took one look at the straining shoulder strap and weighed it in at about 13 kilos which is over half the weight of the hold luggage limit! So yes, they made me repack. You have been warned!</p>
<p>So before I went away I bought a GoPro HD. A friend of mine at The Mill had used one on his skiing holiday and it looked pretty awesome. I also saw this great video by GoPro themselves <a target="_blank" href="http://www.youtube.com/watch?v=gfraQL1wQ2s">here</a> which is well worth a watch.</p>
<p>They&#8217;re not particularly cheap (£269 for the <a target="_blank" href="http://www.amazon.co.uk/gp/product/B0030ZESEQ">basic set</a>), so I guess it&#8217;s understandable that I was a little protective over it the first time I took it out on the water. I had a bit of blast around on the windsurfer, took a look at it and noticed that it wasn&#8217;t switched on anymore. I could see that there was water condensation inside the casing too, at which point I assumed the worst and figured that the case had leaked water and shorted out the camera.</p>
<p>Anyway, it turned out that the camera was fine. Apparently, the one issue with the GoPro is that the water tight casing means that changes in temperature can cause condensation to form. The camera had just turned itself off after it had reached the 3.4Gb file size limit and stopped recording (more on this below). GoPro sell <a target="_blank" href="http://www.goprocamera.com/products/anti-fog-inserts.php">anti-fog strips</a> that you can buy that stop fogging from happening, but don&#8217;t bother, there are some simple steps you can take that will guarantee you won&#8217;t get any fogging and it won&#8217;t cost you a penny.</p>
<p>Right, so in the time honoured tradition of internet blogging; here are 10 tips and tricks for making the GoPro work for you:</p>
<ol>
<li>
<h4>Preventing Condensation</h4>
<p>Condensation is formed when warm humid air meets a cold surface. In my situation, I shut the camera case when it was on dry land in the warm humid air and as soon as the camera got wet, the clear perspex case cooled and condensation formed, resulting in a blurred washed out image. Not nice!</p>
<p>As I mentioned above, you can use the GoPro <a target="_blank" href="http://www.goprocamera.com/products/anti-fog-inserts.php">anti-fog strips</a>, but otherwise you just need a source of dry cool air. An air-conditioning unit is perfect for this, or a fridge. Whatever you use, expose the case to the cool air for a minute, put the camera inside, and carefully shut the case. As an added precaution, put a small piece of toilet tissue behind the camera. That should make sure you won&#8217;t get any condensation at all. Doing this everyday before I went out worked perfectly. (Thanks to the <a target="_blank" href="http://goprouser.freeforums.org/"> GoPro forums</a> for this tip)
</li>
<li>
<h4>Closing the case</h4>
<p>The case is what keeps your £270 camera from annihilation by salty water so it pays to look after the mechanism that keeps it shut. The clip that holds the case shut is made of pretty sturdy stuff. However, it&#8217;s plastic, so it&#8217;s vulnerable to UV damage from the sun that can cause it to become brittle. Knowing how to shut the case in a way that applies a minimum stress on the clip is a good idea.</p>
<p>One of the users on the <a target="_blank" href="http://goprouser.freeforums.org/">GoPro forums</a> shows the proper way to do it:</p>
<p><object width="540" height="320"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10572386&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10572386&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="540" height="320"></embed></object><br /></p>
<p>Another thing to check is the casing&#8217;s rubber seal. It&#8217;s is the last defence against water getting into the case so you need to treat it with care. It&#8217;s always worth just giving it a wipe after being on the beach to make sure you don&#8217;t get any sand in it. Hairs getting trapped are another thing to watch out for.
</li>
<li>
<h4>Tether it because it <big>doesn&#8217;t float!</big></h4>
<p>You might be surprised to know that no component of the camera system or mounting brackets float. That&#8217;s right. It all sinks. Like a stone.</p>
<p>That&#8217;s why it&#8217;s essential to tether your camera in some way to something that does float, whether that&#8217;s you, your windsurfer, or your rig. This is especially important if you ever wear the camera on your head using the <a target="_blank" href="http://www.goprocamera.com/products/head-strap-mount.php">head strap mount</a>. If you get catapulted, you can expect to see your camera bouncing across the water <a target="_blank" href="http://en.wikipedia.org/wiki/Bouncing_bomb">Barnes Wallis</a> style if you don&#8217;t have it fixed to you in some way. Generally, you need to keep the tether short so you don&#8217;t get strangled, but enough to give it some play.
</li>
<li>
<h4>Tighten the screws as much as you can</h4>
<p>The black plastic clamps that fix the camera to the windsurfer mast or boom can flex by quite a lot, but it&#8217;s surprisingly tough. You may be scared to tighten the screws too much as it can look as if you&#8217;re going to break the clamp, but it&#8217;s actually fine. If you don&#8217;t tighten it properly, the flexibility can mean that the camera can slip during filming.</p>
<p>If you watch my video at the bottom of this article, you&#8217;ll notice I hit a bit of chop at 1:01 that causes the camera to nod down a few degrees because I didn&#8217;t tighten it fully. Oops.</li>
<li>
<h4>Know your hardware limits</h4>
<p>I bought my GoPro with a 16Gb memory card. That&#8217;s enough space for about 2 hours of HD footage. As I mentioned above, there&#8217;s a 3.4Gb limit on the file size that can be written to the cards (something which is apparently to be fixed by GoPro), so that means a maximum of approximately 30 minutes of continuous video.</p>
<p>It&#8217;s easy to let the camera just run, but unless you keep track of how long it&#8217;s been recording, then you run the risk of the camera stopping on you and missing some awesome shots. Unfortunately I learnt this from bitter experience!</p>
<p>Before every trip out on the windsurfer, I&#8217;d start the camera. As soon as I got back, I&#8217;d stop it again. Each session lasted on average about 10 minutes so it made sure I always captured the action.
</li>
<li>
<h4>Short takes for easy editing</h4>
<p>As a result of the previous point; keeping your takes short makes life a lot easier in post when it comes to editing it all together. Instead of having to trawl through a huge 3.4Gb video file, you can do a lot of culling of unwanted footage by just deleting files.</li>
<li>
<h4>Keeping file size down</h4>
<p>There&#8217;s another reason to not let your GoPro camera record for the maximum duration. The longer it records for, the greater the chance exists of a file getting corrupted as it can occasionally write bad data to the movie file. This only happened to me once in a weeks worth of recording and it&#8217;s hardly unexpected considering the extreme conditions and motion the camera gets exposed to.</p>
<p>It&#8217;s not a complete disaster though, as it is possible to recover most of the corrupted footage (see below).</li>
<li>
<h4>Firmware upgrade</h4>
<p>When you get your camera, check to see if it has PAL support. If not, go to <a target="_blank" href="http://www.goprocamera.com/support/hdheroupdate.php">here</a> and download the latest update. There are a few other additions to the software, but the PAL support is probably the most useful.</li>
<li>
<h4>Recovering corrupt videos</h4>
<p>As mentioned above, the GoPro can occasionally corrupt videos. The good news is that there&#8217;s a Perl script that can fix it for you. You can download the original script from this <a target="_blank" href="http://goprouser.freeforums.org/stickie-corrupt-video-file-restore-repair-utility-t1013.html#p7623">forum post</a>. </p>
<p>One thing to note is that the script doesn&#8217;t directly support the PAL formats, However it&#8217;s a fairly simple fix to change the script yourself. You just need to change the $framerate variables at the top from 30 to 25, and from 60 to 50 and it works. (If you can&#8217;t figure it out, drop a comment below and I&#8217;ll go into more detail).</p>
<p>If you do this, you&#8217;ll find that you should be able to play the file in VLC, but other programs might still have issues opening the video. This may or may not be a problem depending what you&#8217;re wanting to do with it.</p>
<p>Oh, and you&#8217;ll also lose audio, but that&#8217;s not generally a problem since capturing audio through the waterproof casing is something you&#8217;ll rarely want to do anyway.
</li>
<li>
<h4>Resolution and implications</h4>
<p>I initially started shooting with full 1920&#215;1080 HD, but ended up switching to 1280&#215;960. Why? Three reasons. </p>
<ul>
<li>Firstly it let me reduce the file size, so I could shoot more footage and have less issues with corruption.
</li>
<li>Secondly, the full HD refused to load into After Effects whereas the 960p could be loaded directly. I believe you can convert the 1080p using <a target="_blank" href="http://www.squared5.com/">Mpeg Streamclip</a> into a format that After Effects will load, but I&#8217;ve not tried it yet.</li>
<li>Finally, the format you use results in a different field of view being captured. Footage shot at 1280&#215;960 has a field of view of 170º compared to that at full 1920&#215;1080 HD which has a 25% narrower field of view at 127º. I felt that the wider angle worked better for the shot from the mast so I went with the 960p. Here&#8217;s a link to the <a target="_blank" href="http://www.goprocamera.com/files/English-HD-HERO-Instructions-100903.pdf">PDF of the manual</a>. It shows the full range of resolutions that the camera supports.</li>
</ul>
<p>From tests I did at 960p, it could be resized up to full 1080p and sharpened slightly to give a very similar result. I need to do a few more experiments with this though, so I&#8217;ll post the results up here when I do.
</li>
</ol>
<p>So, here&#8217;s the video. You&#8217;ll notice that it isn&#8217;t as sharp as the GoPro skiing video. I expect that that&#8217;s partly down to the fact that I used 960p, but it&#8217;s also because I rotated (and therefore cropped) the image to make the camera angle a little more natural.</p>
<p>Thanks again go to the users at the <a target="_blank" href="http://goprouser.freeforums.org/"> GoPro forum</a>. There&#8217;s a wealth of information over there, so go check it out.</p>
<p>Anyway, enjoy&#8230;</p>
<p><object width="580" height="380"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=16580886&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=16580886&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="580" height="380"></embed></object><br /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=9CAqYr55Wmw:ALWlKfdIPMw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=9CAqYr55Wmw:ALWlKfdIPMw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=9CAqYr55Wmw:ALWlKfdIPMw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=9CAqYr55Wmw:ALWlKfdIPMw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=9CAqYr55Wmw:ALWlKfdIPMw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=9CAqYr55Wmw:ALWlKfdIPMw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=9CAqYr55Wmw:ALWlKfdIPMw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=9CAqYr55Wmw:ALWlKfdIPMw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=9CAqYr55Wmw:ALWlKfdIPMw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/9CAqYr55Wmw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1118</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Replace ICE String</title>
		<link>http://www.andynicholas.com/?p=1096</link>
		<comments>http://www.andynicholas.com/?p=1096#comments</comments>
		<pubDate>Sun, 17 Oct 2010 13:13:57 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[ICE]]></category>
		<category><![CDATA[XSI]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1096</guid>
		<description><![CDATA[The Replace ICE String tool lets you effortlessly change attribute names in your ICE trees.]]></description>
			<content:encoded><![CDATA[<h3>Description</h3>
<p>The Replace ICE String tool lets you effortlessly change attribute names in your ICE trees. This is often a common yet error prone task when tidying up compounds for release, due to long forgotten attributes hidden in the depths of other compounds.</p>
<h3>Installation</h3>
<p>The plugin is provided as a python plug-in file, and you just need to put it inside a Plugins directory for XSI to recognise it.</p>
<p><a href="apnwp/wp-content/uploads/2010/10/ReplaceICEString.zip"><img class="downloadicon" src="http://www.andynicholas.com/apnwp/wp-content/themes/arthemia/images/download.gif" onmouseover="this.src='http://www.andynicholas.com/apnwp/wp-content/themes/arthemia/images/download_o.gif'" onmouseout="this.src='http://www.andynicholas.com/apnwp/wp-content/themes/arthemia/images/download.gif'" alt="Download..." width="92" height="20"/></a> Replace&nbsp;ICE&nbsp;String V1.0 (3Kb)</p>
<h4>Versions</h4>
<p><i>1.0: Initial release</i></p>
<h3>Getting Started</h3>
<p>After you&#8217;ve installed the plugin, open an ICE Tree Editor. You should have a new entry in the ICE Tree Editor&#8217;s User Tools menu.</p>
<div align="center"><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2010/10/Menu.jpg" class="lightview" rel="gallery[1096]" title="Menu"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2010/10/Menu-300x134.jpg" alt="Menu" title="Menu" width="300" height="134" class="aligncenter size-medium wp-image-1098" /></a></div>
<p>Make sure you&#8217;ve got an active ICE Tree displayed in the window, and select <em>User Tools -&gt; Replace ICE String</em>. You should see this dialog:</p>
<div align="center"><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2010/10/Dialog.jpg" class="lightview" rel="gallery[1096]" title="Dialog"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2010/10/Dialog-300x220.jpg" alt="Dialog" title="Dialog" width="300" height="220" class="aligncenter size-medium wp-image-1102" /></a></div>
<p>The functionality of this tool shouldn&#8217;t need much explanation as it works in the same way as any text based search replace tool. However, there are a few key points that need to be mentioned.</p>
<h3>Previews</h3>
<p>There is a preview button that shows every replacement the tool will make. It&#8217;s always a good idea to do a preview before you run the tool, as it&#8217;s easy to overlook situations you might not have considered.</p>
<div align="center"><a href="http://www.andynicholas.com/apnwp/wp-content/uploads/2010/10/SearchReplace.jpg" class="lightview" rel="gallery[1096]" title="SearchReplace"><img src="http://www.andynicholas.com/apnwp/wp-content/uploads/2010/10/SearchReplace-273x300.jpg" alt="SearchReplace" title="SearchReplace" width="273" height="300" class="aligncenter size-medium wp-image-1103" /></a></div>
<p></p>
<h3>Scope of Replacement</h3>
<p>It&#8217;s important to note that the search/replace is recursive. It will always drill down into all compounds beneath the inital viewing location in the tree.</p>
<p>When you launch the tool from the menu, it stores the current location of the ICE Tree Editor in the entry called &#8220;Ice Tree&#8221; (at the top of the dialog). This is where the tool will perform the search and replace. This means that if you view the root of the ICE Tree and run the tool, it will operate on the entire tree. If you are inside a compound, it will only run on the nodes contained in that compound.</p>
<p>If you view a different tree or use another ICE Tree editor, the Replace ICE String tool will not recognise you&#8217;ve changed what you&#8217;re looking at and will still operate on the original selection, so be careful! To change the location, just open a new Replace ICE String tool dialog from the ICE Tree Editor.</p>
<h3>Limiting to Get/Set Data nodes</h3>
<p>Generally you only want to replace strings that are located inside <em>Get Data</em> and <em>Set Data</em> nodes, so you have a checkbox that gives you the option to restrict the operation to those nodes to help speed up the process. This filter also includes the <em>Get Data At Previous Frame</em> node.</p>
<p>If you don&#8217;t use the Get/Set Data filter, then the tool will attempt to do a search and replace on all string based parameters in your tree. Again, it&#8217;s advisable to run a preview before doing this.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=ayIzA8IXrWo:aXrBnOCNp_Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=ayIzA8IXrWo:aXrBnOCNp_Y:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=ayIzA8IXrWo:aXrBnOCNp_Y:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=ayIzA8IXrWo:aXrBnOCNp_Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=ayIzA8IXrWo:aXrBnOCNp_Y:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=ayIzA8IXrWo:aXrBnOCNp_Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=ayIzA8IXrWo:aXrBnOCNp_Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=ayIzA8IXrWo:aXrBnOCNp_Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=ayIzA8IXrWo:aXrBnOCNp_Y:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/ayIzA8IXrWo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1096</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solutions for Python in XSI (Part 2)</title>
		<link>http://www.andynicholas.com/?p=1016</link>
		<comments>http://www.andynicholas.com/?p=1016#comments</comments>
		<pubDate>Tue, 13 Jul 2010 13:06:36 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[XSI]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1016</guid>
		<description><![CDATA[This is the second article of two that show solutions to common problems faced when using Python in XSI. 

It discusses a useful way of importing your own Python modules into your plugins.]]></description>
			<content:encoded><![CDATA[<p>This is the second of two articles that will show you solutions to common problems you&#8217;ll face when using Python in XSI. </p>
<h3>Importing Python Modules</h3>
<p>Python modules offer a great way to reuse code. Often you&#8217;ll find that you want to share code between your plugins, especially in a pipeline situation. </p>
<p>XSI isn&#8217;t particularly flexible with how it lets you import modules. At the moment, you have to install your custom written modules in a  folder and use the <b>PYTHONPATH</b> environment variable to point to that location (or add it to the list of paths stored in <b>sys.path</b> at run time.) </p>
<p>Wouldn&#8217;t it be good if we were able to import Python modules so that:</p>
<ul>
<li>You can keep your modules with the plugin that uses them.</li>
<li>You never have to modify your Python path, even when you move the installed plugin to a different location.</li>
<li>The module is only loaded when you need it.</li>
</ul>
<p>Of course, you can just use a standard XSI plugin and register some commands, but there are situations where it might be preferable to use a module. For example:</p>
<ol>
<li>If the functions to be included are very small helper functions that need to be called repeatedly. It might be best to avoid registering commands since they have a slight performance overhead to their execution.</li>
<li>If the functions are non XSI specific and don&#8217;t make much logical sense to be added as XSI commands.</li>
<li>If the functions need to be pass or return Python types such as classes, tuples, sets, lists and dictionaries. There are <a href="http://softimage.wiki.softimage.com/index.php/Python_(XSISDK)#Exposing_a_Python_Object_to_XSI" target="_blank">workarounds</a> for these, but they don&#8217;t really assist with making your code clean and maintainable.</li>
<li>If you want to keep your code hidden, you can put your implementation inside the module and only distribute the .pyc compiled version.</li>
</ol>
<h3>A new way to import modules</h3>
<p>The good news is that you can use the following Python class to mimic the behaviour of an imported module.</p>
<pre><code>
import win32com.client
from win32com.client import constants

import os.path
import imp

<em>#Note: You only need the following line if you're
#putting this code in a file that isn't an XSI plugin.</em>
Application = win32com.client.Dispatch("XSI.Application").Application

class Import:

    def __init__(self, pluginName, moduleName):
        self.pluginName = pluginName
        self.moduleName = moduleName
        self.module = None

    def __getattr__(self, name):
        <em>#Has the module already been loaded?</em>
        if self.module:
            return self.module.__dict__[name]

        <em>#Try and load the module</em>
        path=""
        try:
            path = Application.Plugins(self.pluginName).FileName
        except:
            Application.LogMessage("[Plugin Python Module: " \
                             +self.pluginName+"] " \
                             +"Plugin name doesn't exist or hasn't been loaded" \
                             ,constants.siError)
            return None

        <em>#Import the module</em>
        result = imp.find_module(self.moduleName, [os.path.dirname(path)])
        self.module = imp.load_module(self.moduleName, result[0], \
                                      result[1],result[2])

        if not self.module:
            Application.LogMessage("[Plugin Python Module: " \
                             +self.pluginName+"] " \
                             +"Couldn't load module: "+self.moduleName \
                             ,constants.siError)
            return None

        <em>#Evaluate the attribute</em>
        return self.module.__dict__[name]

</code></pre>
<p>Assuming you&#8217;ve placed the above code into a globally accessible module called <b>xsiimport</b>, then you would use it like this: </p>
<p><em>Note: I&#8217;ve highlighted the specific bits of the code that are relevant</em></p>
<pre><code>
import win32com.client
from win32com.client import constants

<span style="color:#a33"><b>import xsiimport

g_PluginName = "TestCommandPlugin"

<em>#Think of this next line as a normal import statement</em>
testpymodule = xsiimport.Import(g_PluginName, "testpymodule")</b></span>

def XSILoadPlugin( in_reg ):
    in_reg.Author = "Andy"
    <span style="color:#a33"><b>in_reg.Name = g_PluginName</b></span>
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand("MyCommand","MyCommand")
    <em>#RegistrationInsertionPoint - do not remove this line</em>

    return true

def MyCommand_Execute():
    <span style="color:#a33"><b><em>#Use testpymodule as you would any other python module

    #Call functions</em>
    result = testpymodule.DoSomething("inputString")

    <em>#Create classes</em>
    myClassInst = testpymodule.MyClass()</b></span>

</code></pre>
<p>As shown, the easiest way to use this class is to import it from a module located in your standard Python path. As a result this would generally only work in a studio environment where you are able to make sure your art team are working on the same file system and with the same environment variables.</p>
<p>If you intend to distribute your plugin, then the alternative is to copy the class definition to each of your plugins that needs to use it. While untidy, the benefits it offers are probably worth it, but I&#8217;ll leave it to you to decide.</p>
<h3>How it works</h3>
<p>So if you&#8217;re interested in what&#8217;s happening under the hood, I&#8217;ll briefly run through what&#8217;s happening.</p>
<p>This line in our plugin:</p>
<pre><code>
testpymodule = xsiimport.Import(g_PluginName, "testpymodule")</b></span>

</code></pre>
<p>doesn&#8217;t actually do anything apart from create an instance of the Import class. In its constructor, it just stores the name of the plugin and the name of the module we want to import.</p>
<p>The reason the class doesn&#8217;t load the module at this stage is because the plugin probably hasn&#8217;t been registered with XSI yet (don&#8217;t forget, we&#8217;re still running code in global scope here). Therefore, we can&#8217;t ask XSI for the file path of the plugin using the Application.Plugins collection.</p>
<p>The module only gets loaded when we ask it to do something in our command like this:</p>
<pre><code>
    <em>#Call functions</em>
    result = testpymodule.DoSomething("inputString")

    <em>#Create classes</em>
    myClassInst = testpymodule.MyClass()</b></span>

</code></pre>
<p>At this point, the <b>__getattr__</b> member function of the <b>Import</b> class is called. It checks to see if the module has already been loaded and loads it if it hasn&#8217;t. Either way, the class returns the attribute that is asked for, where it is either called as a function or used to create an instance of a class (as shown above).</p>
<p>This delayed loading mechanism is the reason that this system works and why it&#8217;s so robust. All other methods that I&#8217;ve tried suffer because the plugin isn&#8217;t loaded, which forces you to <a href="http://softimage.wiki.softimage.com/index.php/Python_Custom_Modules_(XSISDK)" target="_blank">import modules inside function declarations</a> (which feels a bit hacky)</p>
<p>To load the module, I&#8217;m using the <b>imp</b> module. It exposes the lower level commands inside the import mechanism. By calling <b>imp.find_module()</b> followed by <b>imp.load_module()</b>, it forces a reload of the module and flushes any cache stored for that module. Generally, this behaviour is desirable as XSI tends to be quite aggressive with it&#8217;s caching.</p>
<p>And in case you&#8217;re wondering. Yes. This method for importing works fine with the callback mechanism in the <a href="http://www.andynicholas.com/?p=1014">previous article</a>.</p>
<hr/>
<h3>Update: 25 Oct, 2010</h3>
<p>Autodesk&#8217;s new release of the XSI 2011 Advantage Pack contains a new python module called <strong>siutils</strong> that gives you some of the functionality described in this article. Read more <a href="http://xsisupport.wordpress.com/2010/10/24/python-importing-modules-into-plugins/" target="_blank">here</a>. </p>
<p>The ability to use the <strong>__sipath__</strong> variable now means that you don&#8217;t need to use the plugin path lookup to find the location of the current plugin. Assuming this value is valid before the plugin is registered (I&#8217;ve not tested it yet) then this would remove the need to use the delayed load method discussed in this article.</p>
<hr/>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=rIfCoWsoAkM:ueULpgMM0vw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=rIfCoWsoAkM:ueULpgMM0vw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=rIfCoWsoAkM:ueULpgMM0vw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=rIfCoWsoAkM:ueULpgMM0vw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=rIfCoWsoAkM:ueULpgMM0vw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=rIfCoWsoAkM:ueULpgMM0vw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=rIfCoWsoAkM:ueULpgMM0vw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=rIfCoWsoAkM:ueULpgMM0vw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=rIfCoWsoAkM:ueULpgMM0vw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/rIfCoWsoAkM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1016</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Solutions for Python in XSI (Part 1)</title>
		<link>http://www.andynicholas.com/?p=1014</link>
		<comments>http://www.andynicholas.com/?p=1014#comments</comments>
		<pubDate>Thu, 08 Jul 2010 13:06:04 +0000</pubDate>
		<dc:creator>AndyN</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[XSI]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.andynicholas.com/?p=1014</guid>
		<description><![CDATA[This article is the first of two that will show you solutions to a couple of common problems you'll face when using Python in XSI. 

Here we look at passing functions to PPGs to be used as PPG logic. Something simple in other scripting languages, but harder in Python.]]></description>
			<content:encoded><![CDATA[<p>This article is the first of two that will show you solutions to a couple of common problems you&#8217;ll face when using Python in XSI. </p>
<h3>How to pass functions to PPG logic in Python</h3>
<p>When making user interfaces in XSI, I find that I often need to create custom properties on the fly, rather that fully self-installed custom property plugins. When doing this, I usually need to pass callback functions to the PPGLogic attribute so that XSI knows what to do when a button is clicked or a value changes. In JScript, this is simply done using the toString() method of the JScript function object, like this:</p>
<pre><code>
function MyJScriptCommand_Execute(  )
{
    prop = XSIFactory.CreateObject("CustomProperty")
    prop.AddParameter2("myValue",siInt4,0,0,100,0,100,
                            siClassifUnknown,
                            siPersistable | siKeyable);

    layout = prop.PPGLayout;
    layout.AddItem("myValue");
    layout.AddButton("myButton");

    layout.language="JScript"
    <span style="color:#a33"><b>layout.logic=myValue_OnChanged.toString()+
                     myButton_OnClicked.toString();</b></span>
    InspectObj(prop);
    return true;
}

function myValue_OnChanged()
{
    LogMessage("myValue was changed");
}

function myButton_OnClicked()
{
    LogMessage("myButton was clicked");
}

</code></pre>
<p>Despite the flexibility that Python offers as a language, it doesn&#8217;t have a mechanism able to do this. So we need to find another method.</p>
<h3>Triple Quoted Strings</h3>
<p>One common way to do it is to write your functions inside a triple quoted string. Here&#8217;s the Python equivalent of the above code:</p>
<pre><code>
def MyPythonCommand_Execute(  ):

    prop = XSIFactory.CreateObject("CustomProperty")
    prop.AddParameter2("myValue",constants.siInt4,0,0,100,0,100,
                            constants.siClassifUnknown,
                            constants.siPersistable | constants.siKeyable)

    layout = prop.PPGLayout
    layout.AddItem("myValue")
    layout.AddButton("myButton")

    layout.Language="Python"
    <span style="color:#a33"><b>layout.logic='''
def myValue_OnChanged():
    LogMessage("myValue was changed")

def myButton_OnClicked():
    LogMessage("myButton was clicked")
'''</b></span>
    Application.InspectObj(prop)
    return true;

</code></pre>
<p>This is perfectly acceptable and works fine, but it does have a few drawbacks:</p>
<ul>
<li>It makes the code look ugly and less readable. Python is formatted in a specific way due to the indentation being linked to the syntactical interpretation. Putting code inside a triple quoted string goes somewhat against this ideal.</li>
<li>Most text editors will not show the syntax highlighting for the callback code, and will highlight it as a string. This is a minor problem but can be annoying, particularly if you&#8217;re building a complex string with escaped characters.</li>
<li>All the code inside the triple quotes is executed in a new scope. This means that any global constants, helper functions, or module imports will have to be repeated inside the triple quoted section. This can lead to a lot of code duplication, which is obviously a bad thing.</li>
</ul>
<h3>Using the Logic File attribute</h3>
<p>It would be fair to say that the triple quoted string method isn&#8217;t particularly convenient. Are there any other ways that we can do this?</p>
<p>Yes. If you look at the PPGLayout attributes, you&#8217;ll see that we have the ability to specify a PPG logic file. This is a file in which we can put all our callback functions, and as long as we tell XSI where to find it, everything should work fine. For example:</p>
<pre><code>
def MyPythonCommand_Execute(  ):

    prop = XSIFactory.CreateObject("CustomProperty")
    prop.AddParameter2("myValue",constants.siInt4,0,0,100,0,100,
                            constants.siClassifUnknown,
                            constants.siPersistable | constants.siKeyable)

    layout = prop.PPGLayout
    layout.AddItem("myValue")
    layout.AddButton("myButton")

    layout.Language="Python"
    <span style="color:#a33"><b>layout.SetAttribute(constants.siUILogicFile,
                        "C:\\Workgroup\\Application\\Plugins\\PPGCallbacks.py")</b></span>
    Application.InspectObj(prop)

</code></pre>
<p>&#8230;and in a separate file called PPGCallbacks.py</p>
<pre><code>
def myValue_OnChanged():
    LogMessage("myValue was changed")

def myButton_OnClicked():
    LogMessage("myButton was clicked")

</code></pre>
<p>This certainly gets around the problem of syntax highlighting, but it still means we have to redeclare global constants, helper functions, and reimport modules. It also gives us two extra problems of having to hardcode the location of the logic file, and having to make sure that the plugin file and the callback file are always installed together. If anything goes wrong with either of those, you&#8217;re not going to know about it until you open the PPG and press a button or change a value.</p>
<p>Okay, why not eliminate the extra file and just point it at the original script? </p>
<pre><code>
def MyPythonCommand_Execute(  ):

    prop = XSIFactory.CreateObject("CustomProperty")
    prop.AddParameter2("myValue",constants.siInt4,0,0,100,0,100,
                            constants.siClassifUnknown,
                            constants.siPersistable | constants.siKeyable)

    layout = prop.PPGLayout
    layout.AddItem("myValue")
    layout.AddButton("myButton")

    layout.Language="Python"
    <span style="color:#a33"><b>layout.SetAttribute(constants.siUILogicFile,
                 "C:\\Workgroup\\Application\\Plugins\\MyPythonPlugin.py")</b></span>
    Application.InspectObj(prop)

<span style="color:#a33"><b>def myValue_OnChanged():
    LogMessage("myValue was changed")

def myButton_OnClicked():
    LogMessage("myButton was clicked")</b></span>

</code></pre>
<p>That&#8217;s much better. We don&#8217;t need to manage two files and we can put all our callback code in the same file as the PPG definition. It starts behaving a lot like a self-installed custom property, although we still have the problem of hard coding the path.</p>
<h3>Using XSI&#8217;s plugin registry</h3>
<p>The solution is to look up the path to the current plugin file using Application.Plugins. </p>
<p>Let&#8217;s look at the details of how this works.</p>
<p>Application.Plugins is a collection of XSI plugin objects. We can retrieve any particular one by asking for it by name. This is the one we declared it with in the registration function.</p>
<pre><code>
def XSILoadPlugin( in_reg ):
    in_reg.Author = "Andy"
    in_reg.Name = <span style="color:#a33"><b>"My Python Plugin"</b></span>
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand("MyPythonCommand","MyPythonCommand")
    #RegistrationInsertionPoint - do not remove this line

    return true

</code></pre>
<p>By using this name to index into the plugin collection, XSI will return us a Plugin object:</p>
<pre><code>
pluginObject = Application.Plugins("My Python Plugin")

</code></pre>
<p>Once we have the plugin object we can ask it for its filename:</p>
<pre><code>
LogMessage(Application.Plugins("My Python Plugin").FileName)

# INFO : C:\Workgroup\Application\Plugins\MyPythonPlugin.py

</code></pre>
<p>So to set the logic file to point to the current plugin, we can just do this:</p>
<pre><code>
layout.SetAttribute(constants.siUILogicFile,
                    Application.Plugins("My Python Plugin").FileName)

</code></pre>
<p>To obey the rule I mentioned earlier about not defining the same thing twice, we can define the plugin name as a global variable right at the top of the script. The final script looks like this:</p>
<pre><code>
import win32com.client
from win32com.client import constants

<span style="color:#a33"><b>g_pluginName = "My Python Plugin"</b></span>

def XSILoadPlugin( in_reg ):
    in_reg.Author = "Andy"
    <span style="color:#a33"><b>in_reg.Name = g_pluginName</b></span>
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand("MyPythonCommand","MyPythonCommand")
    #RegistrationInsertionPoint - do not remove this line

    return true

def MyPythonCommand_Execute(  ):

    prop = XSIFactory.CreateObject("CustomProperty")
    prop.AddParameter2("myValue",constants.siInt4,0,0,100,0,100,
                            constants.siClassifUnknown,
                            constants.siPersistable | constants.siKeyable)

    layout = prop.PPGLayout
    layout.AddItem("myValue")
    layout.AddButton("myButton")

    layout.Language="Python"
    <span style="color:#a33"><b>layout.SetAttribute(constants.siUILogicFile,
                        Application.Plugins(g_pluginName).FileName)</b></span>
    Application.InspectObj(prop)

def myValue_OnChanged():
    LogMessage("myValue was changed")

def myButton_OnClicked():
    LogMessage("myButton was clicked")

</code></pre>
<p>That&#8217;s all there is to it. Now we have a workable strategy that has the following advantages:</p>
<ul>
<li>Tidy code</li>
<li>Full syntax highlighting</li>
<li>All the code is in a single file</li>
<li>All the constant definitions, helper functions, and imports only need to be written once</li>
</ul>
<p>Note that the callback code is still being executed in a different context. There&#8217;s no way around that. This means that changes to the values of global variables will not get passed through to the callback code. Global constants work fine because they are declared in global scope and don&#8217;t change.</p>
<p>In the second installment of this article, I&#8217;ll be showing you how to load python modules that are specific to your plugin using a similar system.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=-7KTR6HdPwY:KKVUnI16Yi4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=-7KTR6HdPwY:KKVUnI16Yi4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=-7KTR6HdPwY:KKVUnI16Yi4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=-7KTR6HdPwY:KKVUnI16Yi4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=-7KTR6HdPwY:KKVUnI16Yi4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=-7KTR6HdPwY:KKVUnI16Yi4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=-7KTR6HdPwY:KKVUnI16Yi4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyNicholas?a=-7KTR6HdPwY:KKVUnI16Yi4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/AndyNicholas?i=-7KTR6HdPwY:KKVUnI16Yi4:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyNicholas/~4/-7KTR6HdPwY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andynicholas.com/?feed=rss2&amp;p=1014</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
