<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Softimage Blog &#187; Tools</title>
	<atom:link href="http://www.softimageblog.com/archives/category/tools/feed" rel="self" type="application/rss+xml" />
	<link>http://www.softimageblog.com</link>
	<description>People and thoughts behind Softimage in production...</description>
	<lastBuildDate>Mon, 21 Jun 2010 20:40:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ICE Kinematics</title>
		<link>http://www.softimageblog.com/archives/280#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ice-kinematics</link>
		<comments>http://www.softimageblog.com/archives/280#comments</comments>
		<pubDate>Wed, 03 Sep 2008 14:54:28 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=280</guid>
		<description><![CDATA[Quite a few people have been asking how the unsupported feature of ICE Kinematics can be enabled in XSI.
The video below will give you a rundown on how to activate the feature within the context of a really simple example of getting a ball to float and bounce around on the top of a particle [...]]]></description>
			<content:encoded><![CDATA[<p>Quite a few people have been asking how the unsupported feature of ICE Kinematics can be enabled in XSI.</p>
<p>The video below will give you a rundown on how to activate the feature within the context of a really simple example of getting a ball to float and bounce around on the top of a particle fountain.</p>
<p>Please note that ICE Kinematics are an unsupported feature that you would be using at your own risk. I&#8217;ve had a fair bit of success with it but if it goes boom and you loose time and assets, I will say: I told you so!</p>
<p>Have fun!</p>
<p style="text-align: center;">[There is a video that cannot be displayed in this feed. <a href="http://www.softimageblog.com/archives/280">Visit the blog entry to see the video.]</a></p>
<p style="text-align: left;">By the way&#8230; The line you have to add in the setenv.bat file that you can&#8217;t read in the video is:</p>
<p style="text-align: left;">set XSI_UNSUPPORTED_ICE_KINEMATICS=1</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=280&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/280/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vista Trick : Symbolic Links</title>
		<link>http://www.softimageblog.com/archives/267#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=vista-trick-symbolic-links</link>
		<comments>http://www.softimageblog.com/archives/267#comments</comments>
		<pubDate>Tue, 17 Jun 2008 18:07:52 +0000</pubDate>
		<dc:creator>Luc-Eric</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=267</guid>
		<description><![CDATA[It&#8217;s possible to create symbolic links in Windows Vista just like in Unix. This is helpful if you need to make a directory or file appear to be in different location. In a command prompt:
  mklink /D d:\alias_location  d:\actual\location\of\directory
The /D stands for directory link, because file links are also supported.  Even better, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s possible to <a href="http://technet2.microsoft.com/windowsserver2008/en/library/0ce4df22-2dbc-48fc-9c16-b721ae85f8571033.mspx?mfr=true">create symbolic links</a> in Windows Vista just like in Unix. This is helpful if you need to make a directory or file appear to be in different location. In a command prompt:</p>
<pre>  mklink /D d:\alias_location  d:\actual\location\of\directory</pre>
<p>The /D stands for directory link, because file links are also supported.  Even better, the link can be to a remote location.</p>
<pre>  mklink /D d:\alias_location  \\server\share</pre>
<p>Naturally, if you only wanted a drive letter shortcut, the old &#8216;<a href="http://technet.microsoft.com/en-us/library/bb491006.aspx">subst</a>&#8216; command still works.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=267&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/267/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Proxy Select And Anticipating A User&#8217;s Needs</title>
		<link>http://www.softimageblog.com/archives/263#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=proxy-select-and-anticipating-a-users-needs</link>
		<comments>http://www.softimageblog.com/archives/263#comments</comments>
		<pubDate>Sun, 08 Jun 2008 19:09:41 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=263</guid>
		<description><![CDATA[Two weeks ago Bryan Blevins, CG Supervisor at Wild Canary, asked a question on the Softimage&#124;Net community about the possibility of doing proxy selects.
You all remember the idea of a proxy parameter where editing a parameter in a custom PPG (lets call this one the source) will in fact be changing another elsewhere in the [...]]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago Bryan Blevins, CG Supervisor at <a title="Wild Canary" href="http://www.wildcanary.com/" target="_blank">Wild Canary</a>, asked a question on the <a title="Softimage|Net" href="http://community.softimage.com" target="_blank">Softimage|Net</a> community about the <a href="http://community.softimage.com/showthread.php?t=1361" target="_blank">possibility of doing proxy selects</a>.</p>
<p>You all remember the idea of a proxy parameter where editing a parameter in a custom PPG (lets call this one the source) will in fact be changing another elsewhere in the scene (this one we will call the target). Extend this idea to a selection where selecting a source will in fact &#8216;transfer&#8217; the selection to another object. This could be useful, among other cases, in a rigging scenario.</p>
<p>As it was suggested in the thread, there are many use cases for a functionality like this that can be addressed with native XSI tools and methodologies but nonetheless, I felt like there might be some cases where an actual proxy select could be useful. So I cooked one up for Bryan, and <a title="Proxy Select" href="http://www.xsi-blog.com/userContent/upload/2008/06/proxyselect.zip">here it is</a>.</p>
<p>Select one or more targets and then go to Get -&gt; Property -&gt; Proxy Select and then pick one or more source objects. From then on whenever you select a source object, it will unselect itself and select the targets instead. There is some sanity checking in there to try and avoid dependency loops and the like, just in case.</p>
<p>There are also three menu items in the MCP Select menu that will toggle proxy select functionality in six different ways.</p>
<ul>
<li>Toggle on proxy select for all objects &#8211; when nothing is selected</li>
<li>Toggle off proxy select for all objects &#8211; when nothing is selected</li>
<li>Toggle/Inverse proxy select state for all objects &#8211; when nothing is selected</li>
<li>Toggle on proxy select for selected objects</li>
<li>Toggle off proxy select for selected objects</li>
<li>Toggle/Inverse proxy select state for selected objects</li>
</ul>
<p>I can already hear you asking: &#8220;How can I select a proxy select source to toggle it&#8217;s functionality if it is already on and automatically transfers it&#8217;s selection?&#8221;</p>
<p>Well,</p>
<ul>
<li>If it is only one object you wish to toggle you can go directly to it&#8217;s Proxy Select custom property.</li>
<li>If you wish to act on multiple objects with these toggle menus, you can multi select the objects and toggle them all together. When multiple objects are selected, no selection transfer takes place.</li>
<li>This also means that you can multi select a proxy select source with any other object and then use the menu items, any object that isn&#8217;t a proxy select source will be safely ignored.</li>
</ul>
<p><strong>And then came Thiago</strong></p>
<p>One of the people involved in the thread was Thiago Costa from <a href="http://www.nervo.tv/" target="_blank">Nervo.tv</a>. He is actually the one who suggested an approach for creating the Proxy Select plugin in the first place. Well, about the same time I had sent Bryan my first draft Thiago posted <a href="http://community.softimage.com/showthread.php?p=5744#poststop" target="_blank">his version</a>. I said it in the thread and I will say it again, it is very nicely executed.</p>
<p>One of the things he did is that he anticipated the user&#8217;s needs and thought for a second about what you would like to do with the resulting select.</p>
<p>Something that happens to often (well for me anyway), and especially in the heat of production, is that we fail to properly establish requirements.</p>
<p><em>These requirement will inevitably change.<br />
</em></p>
<p>When the first wave of requirements is put down on paper some time should be spent trying to anticipate the user&#8217;s needs as well as possible future requirements. Even if these extra features aren&#8217;t initially implemented, having this foresight will allow the resulting code to better accomodate change.</p>
<p><strong>Downloads</strong></p>
<p>Check out the <a href="http://community.softimage.com/showthread.php?p=5744#poststop" target="_blank">thread at Softimage|Net</a> for Thiago&#8217;s version.</p>
<p>Download my version from <a href="http://www.xsi-blog.com/userContent/upload/2008/06/proxyselect.zip">here</a>.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=263&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/263/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Points of Light</title>
		<link>http://www.softimageblog.com/archives/219#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=points-of-light</link>
		<comments>http://www.softimageblog.com/archives/219#comments</comments>
		<pubDate>Wed, 06 Jun 2007 02:56:18 +0000</pubDate>
		<dc:creator>Vladimir Jankijevic</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/archives/219</guid>
		<description><![CDATA[Some time ago, I stumbled across the MapVIZ node in Maya and was surprised, that Softimage didn&#8217;t implement something like this in our beloved software package, XSI. Well, last weekend I decided to code it myself.
The first step to take, was to decipher the the file structure of the FG and Photon maps. Since the [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I stumbled across the MapVIZ node in Maya and was surprised, that <a href="http://www.softimage.com">Softimage</a> didn&#8217;t implement something like this in our beloved software package, XSI. Well, last weekend I decided to code it myself.</p>
<p>The first step to take, was to decipher the the file structure of the FG and Photon maps. Since the files are written in binary, this wasn&#8217;t that easy. But with the help of UltraEdit, a HEX editor for Windows, and some trial and error, the main file structure mystery was unveiled. Here is an example of how this looks like in a FG map:</p>
<p><img src='http://www.xsi-blog.com/userContent/upload/2007/06/hex.gif' alt='hex.gif' width='600'/></p>
<p>The blue marked part is the file type and the version of MentalRay. The green part is a 32 bit integer value which is the total FG Point count. Next comes the FG Point itself. One FG point is represented in 104 bytes in total. That&#8217;s the first bright block. The first 12 bytes are the x, y and z coordinates in 32bit floating point numbers. And so on&#8230;</p>
<p><span id="more-219"></span>Final Gathering maps have another structure than Photon maps and thus it took me twice the time to build the file structure.</p>
<p>Once this was done, I had a little look into OpenGL programming and had a little talk to Andrea Interguglielmi. He helped me with the Logic behind the connection between XSI and OpenGL.</p>
<p>What this tool does is in fact pretty simple. When the plugin is loaded, it registers a new DisplayCallback and allocates some basic memory. Then, after you select a map and press on the &#8220;Show Map&#8221; button, it reads the chosen file and creates an array of position and color values which are stored in the memory and then displayed through some basic OpenGL functions.</p>
<p><img src='http://www.xsi-blog.com/userContent/upload/2007/06/ppg.gif' alt='ppg.gif' /></p>
<p>With this tool you have the ability to view your saved FG and Photon maps in your 3D-Viewport of XSI. After installation, you can find it under Get-> Property-> JV_MapMiner. It is provided as is and nobody is responsible in any way for any possible damage.</p>
<p>I hope this tool can help people to optimize their renderings and make their lives a little bit more comfortable.</p>
<p>You can download the <a href="http://www.xsi-blog.com/userContent/upload/2007/06/mapMinerAddon.rar">.xsiaddon</a> (tested on XSI 5.x and 6.1) and a <a href="http://www.xsi-blog.com/userContent/upload/2007/06/mapMinerScene.rar">demo project</a> with one FG map, one GI map, one Caustic map and one GI+Caustic map combined (27mb).</p>
<p>You are welcome to send me bug-reports or suggestions.</p>
<p><a href='http://www.xsi-blog.com/userContent/upload/2007/06/fg_s.mov' title='fg_s.mov'>FG Quicktime</a><br />
<a href='http://www.xsi-blog.com/userContent/upload/2007/06/gi_s.mov' title='gi_s.mov'>GI Quicktime</a><br />
<a href='http://www.xsi-blog.com/userContent/upload/2007/06/caustics_s.mov' title='caustics_s.mov'>Caustics Quicktime</a></p>
<p><img src='http://www.xsi-blog.com/userContent/upload/2007/06/types.gif' alt='types.gif' /></p>
<p>Buddha 3D-Model courtesy of the <a href="http://graphics.stanford.edu/data/3Dscanrep">Stanford Computer Graphics Laboratory</a>.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=219&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/219/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
<enclosure url="http://www.xsi-blog.com/userContent/upload/2007/06/fg_s.mov" length="1318982" type="video/quicktime" />
<enclosure url="http://www.xsi-blog.com/userContent/upload/2007/06/gi_s.mov" length="1713249" type="video/quicktime" />
<enclosure url="http://www.xsi-blog.com/userContent/upload/2007/06/caustics_s.mov" length="1443768" type="video/quicktime" />
		</item>
		<item>
		<title>Colorspaces in XSI</title>
		<link>http://www.softimageblog.com/archives/133#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=colorspaces-in-xsi</link>
		<comments>http://www.softimageblog.com/archives/133#comments</comments>
		<pubDate>Sat, 06 Jan 2007 15:37:21 +0000</pubDate>
		<dc:creator>Harry Bardak</dc:creator>
				<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Texturing]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=133</guid>
		<description><![CDATA[The graphics pipeline from source art to final output is complicated, and requires the artist to work in several different colour spaces along the way. In this article I''ll give a brief overview of colour spaces, and then detail a commonly overlooked area in the texture pipeline where gamma is important.]]></description>
			<content:encoded><![CDATA[<p>The graphics pipeline from source art to final output is complicated, and requires the artist to work in several different colour spaces along the way. In this article I&#8217;ll give a brief overview of colour spaces, and then detail a commonly overlooked area in the texture pipeline where gamma is important.</p>
<p><strong>The sRGB Standard</strong></p>
<p>The sRGB colour space is based on the monitor characteristics expected in a dimly lit office, and has been standardised by the IEC (as IEC 61966-1-2). This colour space has been widely adopted by the industry, and is used universally for CRT, LCD and projector displays. Modern 8-bit image file formats (such as JPEG 2000 or PNG) default to the sRGB colour space.</p>
<p>A value in the sRGB colour space is a floating-point triple, with each value between 0.0 and 1.0. Values outside of this range are clipped. An sRGB colour from this [0, 1] interval is commonly encoded as an 8-bit unsigned integer between 0 and 255.</p>
<p>The pivotal fact to remember about sRGB is that it is <strong>non-linear</strong>. It roughly follows the curve y = x <sup>2.2</sup>, although the actual standard curve is slightly more complicated (and will be listed at the end of this article). A graph of sRGB against gamma 2.2 looks as follows:</p>
<p><img width="545" height="393" src="/userContent/hbardak/colorspaces/srgb-graph.png" /></p>
<p>This mapping has the nice property that more resolution is given to low-luminance RGB values, which fits the human visual model well.</p>
<p><span id="more-133"></span><strong>The Gamma Function As An Approximation</strong></p>
<p>As can be seen by the above graph, the sRGB standard is very close to the gamma 2.2 curve. For this reason, the full sRGB conversion function is often approximated with the much simpler gamma function.</p>
<p>Please note that the value associated with the word gamma is the power value used in the function y = x<sup>p</sup>. Unfortunately gamma is often associated with brightness, which is not exactly what it is doing. The full [0, 1] interval is always mapped back onto the full [0, 1] interval.</p>
<p><strong>What Maths Work In This Colour Space?</strong></p>
<p>In general your lighting pipeline should be done in linear space, so that all lighting is accumulated linearly. This is the approach taken in many film pipeline, and is the only way to ensure that you are being physically correct.</p>
<p>However, assuming that the gamma function approximation is good enough, you can still perform modulate operations. In this case we have some constant A that we wish to modulate our sRGB source data x with, and store the result in sRGB as y. In linear space this would be written as:</p>
<blockquote><p>y<sup>2.2</sup>= A x<sup>2.2</sup> = ( A<sup>1/2.2</sup> x )<sup>2.2</sup></p></blockquote>
<p>Since we are working only in the [0, 1] interval, we can remove the power from both sides and work in the sRGB space itself. In which case:</p>
<blockquote><p>y = A <sup>1/2.2</sup> x</p></blockquote>
<p>So if we convert our constants into sRGB, then modulate operations can still be performed. However, there are only very few operations that work this way. Additive operations (which are used in additive lighting models, or for alpha-blending) <strong>cannot</strong> be reformulated to work in a gamma 2.2 space, simply because the space is non-linear. If you wish to have a correct additive lighting model, then you have to work in a linear space, which will mean that you need a higher-precision framebuffer to at least match the low-luminance granularity of sRGB.</p>
<p><strong>sRGB to linear RGB</strong>: rgb (sRGB), RGB (linear RGB)</p>
<table>
<tr>
<td rowspan="2">R =</td>
<td>r / 12.92</td>
<td>for r &lt;= 0.04045</td>
</tr>
<tr>
<td>( (r + 0.055)/1.055 )<sup>2.4</sup></td>
<td>for r &gt; 0.04045</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">G =</td>
<td>g / 12.92</td>
<td>for g &lt;= 0.04045</td>
</tr>
<tr>
<td>( (g + 0.055)/1.055 )<sup>2.4</sup></td>
<td>for g &gt; 0.04045</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">B =</td>
<td>b / 12.92</td>
<td>for b &lt;= 0.04045</td>
</tr>
<tr>
<td>( (b + 0.055)/1.055 )<sup>2.4</sup></td>
<td>for b &gt; 0.04045</td>
</tr>
</table>
<p>This is commonly approximated as X = x<sup> 2.2</sup> for all channels.</p>
<p><strong>linear RGB to sRGB</strong>: RGB (linear RGB), rgb (sRGB)</p>
<table>
<tr>
<td rowspan="2">r =</td>
<td>12.92 R</td>
<td>for R &lt;= 0.0031308</td>
</tr>
<tr>
<td>1.055 R<sup> 1.0 / 2.4</sup> &#8211; 0.055</td>
<td>for R &gt; 0.0031308</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">g =</td>
<td>12.92 G</td>
<td>for G &lt;= 0.0031308</td>
</tr>
<tr>
<td>1.055 G<sup> 1.0 / 2.4</sup> &#8211; 0.055</td>
<td>for G &gt; 0.0031308</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">b =</td>
<td>12.92 B</td>
<td>for B &lt;= 0.0031308</td>
</tr>
<tr>
<td>1.055 B<sup> 1.0 / 2.4</sup> &#8211; 0.055</td>
<td>for B &gt; 0.0031308</td>
</tr>
</table>
<p>This is commonly approximated as x = X<sup> 1/2.2</sup> for all channels.</p>
<p><strong>Ok But How To Do That in XSI ?</strong></p>
<p>Before the release of XSI v6, we could change the ouput gamma of Mental ray and match approximately the sRGB by using a gamma of 2.2 ( put 1/2.2 in the active effect tab). In version 6 this option is missing unfortunately but don&#8217;t worry there are others third party addon that can do the job for you.</p>
<p>I wrote one of them and you can find them <a href="www.harrybardak.co.uk/data/sRGB_utils.zip">here</a>.</p>
<p>This addon include two shaders. A texture node that convert sRGB image in linear space and a lens shader that convert linear render to sRGB color space.</p>
<p>These shader are intended to be used in a context where you don&#8217;t output anything in float format. I didn&#8217;t try it in this context so you don&#8217;t have any warranty.</p>
<p>The idea is to convert every texture that you create in Lin space and convert every render in sRGB space. By texture I mean any images that are not used to drive data such as displacement map, bump map or normal map. I exclude also floating point image which are considered linear defacto.</p>
<p><strong>Let&#8217;s see these shader in action</strong></p>
<p>I will first focus on the lens shader and then on the texture node.</p>
<p>As I said we need to watch our result according to the monitor profile (sRGB) so to convert our render we need to apply the lens shader. It&#8217;s really easy use add it on the lens shader stack.</p>
<p>My first example is simple. A grid with a phong shader and a light. An area light with a realistic falloff. To do this I am using the <a href="http://www.tek2shoot.com/knowledge-base/softimage-xsi/unexposed-mental-ray-shaders-v1.1-32-64.html">D2S_light</a> with a temperature of 6500 K (White). I set the light intensity to get the same result in the red area.</p>
<p><img width="600" src="/userContent/hbardak/colorspaces/physical_light_comparaison.jpg" /></p>
<p>The left picture is rendered as-is in XSI while the other one is rendered with Lin_to_sRGB Lens shader. As you can see the left picture is overlighted. (intensity around 4000) While the right one behave nicely (with an intensity of 750 only).</p>
<p>Note that even the specular from phong shader looks correct. It looks like the reflection of the area light.</p>
<p>My second example is a simple FG scene with 2 spheres and a plane. The plane and one of the sphere got a DGS shader with only a diffuse term set to a neutral gray. The second sphere is fully reflective to see the environment map.</p>
<p><img width="512" height="256" src="/userContent/hbardak/colorspaces/beach.jpg" /></p>
<p>I used an HDR image from <a href="http://www.debevec.org/">Paul Debevec&#8217;s website</a> called beach.hdr to light my scene with Final Gathering.</p>
<p>The first test is a render as-is:</p>
<p><img width="492" height="282" src="/userContent/hbardak/colorspaces/FG_wrong.jpg" /></p>
<p>As you can see the color of the environement map are more contrast / darker than what we can see in HDR shop. To correct this naturally we will change the exposure but the color will be affected and we will got a more saturated image which is wrong.</p>
<p>If we use the lens shader we go this result:</p>
<p><img width="492" height="282" src="/userContent/hbardak/colorspaces/FG_good.jpg" /></p>
<p>The result this time is what we expected. The color match to what we can see in HDR shop. We can start to work safely because we got the right illumination.</p>
<p><img width="512" height="256" src="/userContent/hbardak/colorspaces/0001WM_diff.jpg" /></p>
<p>On my next example I am introducing a texture on the grey plane by plug to the diffuse slot an image node. I am keeping the same HDR illumination and the lens shader.</p>
<p><img width="466" height="247" src="/userContent/hbardak/colorspaces/FG_texture_wrong.jpg" /></p>
<p>As you can see the texture is washed out. This doesn&#8217;t come from illumination. This wood texture has been generated in sRGB color space. With the lens shader we simply apply an another time the sRGB convertion. What we need is to convert this texture in linear space before the render. It is the purpose of the sRGB_to_Lin texture node. Just plug it between your image node and the diffuse slot and re-render.</p>
<p><img width="466" height="247" src="/userContent/hbardak/colorspaces/FG_texture_good.jpg" /></p>
<p>As you can see now our texture is corrected and looks natural.</p>
<p><strong>Bonus</strong></p>
<p>If you need to change your setup and include these two node to your existing setup your can use the existing script written by <a href="/?author=20">Guillaume Laforge</a> and included in the first archive. It will insert a sRGB_to_Lin node after your image node.</p>
<p>If you have any questions, critics or correction please don&#8217;t hesitate : <a href="mailto:harry.bardak@wanadoo.fr">harry.bardak@wanadoo.fr</a></p>
<p>Edit : Gradient example removed because it seams to confuse more people than it helps. Shaders source code fixed I didn&#8217;t realised that this article was read by non XSI users.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=133&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/133/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Controlling XSI remotely using sockets</title>
		<link>http://www.softimageblog.com/archives/132#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=controlling-xsi-remotely-using-sockets</link>
		<comments>http://www.softimageblog.com/archives/132#comments</comments>
		<pubDate>Sun, 31 Dec 2006 14:21:09 +0000</pubDate>
		<dc:creator>Kim Aldis</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=132</guid>
		<description><![CDATA[A short Python socket server script for remotely communicating with XSI using Telnet]]></description>
			<content:encoded><![CDATA[<p>XSI 6.0 comes with a nice little example of how to connect with XSI remotely. It uses C# and being a little bit dumb and a lottle bit the worse for Christmas wear, I asked on the mailing list if it wouldn&#8217;t have been easier to do using Python, it not having dawned on me that it was, well, a C# example. Luc-Eric immediately chucked the gauntlet back again; &#8220;show us&#8221;, he said. So I will.</p>
<p>It is, of course, more useful than just an example as anyone who&#8217;s used Maya&#8217;s CommandPort can tell you. The C# example is cleverly wrapped in a timer event, allowing it to run in the background and quietly check for a connection every few seconds. More for reasons of clarity than anything else I&#8217;m just going to wrap this up in a function and let someone else decide how best to use it but I will get a little bit into timeouts and how to handle the hang you can get if there&#8217;s nothing at the other end.</p>
<p>Python is a really good example of just how sensible it was to use good existing scripting languages  rather than writing  bad new ones. You not only get the language for free, you also get most of the Open Source community too and with Python that means quite a lot of modules, allowing you to do more stuff than you could shake a stick at in a lifetime of stick shaking.</p>
<p><span id="more-132"></span>I&#8217;d done stuff like this before in Perl and C but not Python and I was interested in how long it was going to take to do this. As it turned out, around 20 minutes, which is pretty good but more testament to the other thing you get for free with Python &#8211; shedloads of free examples &#8211; than any skills I may have.</p>
<p>Python is pretty good at wrapping complicated stuff up and making it easy to use and this is no exception. To read something from a port the sequence of events is:</p>
<ul>
<li>Create a socket</li>
<li>Bind to the socket</li>
<li>Listen on the socket</li>
<li>Accept the connection</li>
<li>Read whatever&#8217;s being sent from the other end</li>
<li>Optionally send something back</li>
<li>Close the connection</li>
</ul>
<p>This is all fine and dandy, except that if there&#8217;s nothing at the other end then the Accept hangs until there is. If nothing ever tries to connect we get a nasty hang that&#8217;s not easy to get out of. So we could do with something that  can peek at the socket and see if there&#8217;s something there. Such a thing is a thing called &#8220;select&#8221;. In generic terms Select() is used to check any kind of file that&#8217;s open for reading to see if there&#8217;s something to read and, at least of grownup operating systems, a socket is treated in the same way as a file. We call select() on the socket just after we start listening. If select returns a list that isn&#8217;t empty then someone&#8217;s knocking at the other end and it&#8217;s safe to go ahead. If it&#8217;s not we ignore the accept call and just return nothing and bingo! no hang.</p>
<p>And finally, I&#8217;ve taken a slightly different slant in executing code to the C# example. It accepts commands to either log a string or run  a script file. It seemed more natural to me to run a string than a file, partly because it seems such a pain creating script files all over the place but mostly because I figured if I could run a string then I could do both the other two things with the code in that string.</p>
<p>Here&#8217;s the code. You can test it by running the script in XSI and using telnet to connect. Either <em>&#8220;telnet localhost 50007&#8243; </em>from the local machine or <em>&#8220;telnet machine 50007&#8243;</em> from some other machine. At the telnet prompt type something like <em>jscript|logmessage(&#8220;Testing&#8221;);</em> will run logmessage(&#8220;Testing&#8221;) at the XSI end. Enjoy.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">select</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> ReadSocket<span style="color: black;">&#40;</span>PORT, TimeOut=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
    s = <span style="color: #dc143c;">socket</span>.<span style="color: #dc143c;">socket</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">socket</span>.<span style="color: black;">AF_INET</span>, <span style="color: #dc143c;">socket</span>.<span style="color: black;">SOCK_STREAM</span><span style="color: black;">&#41;</span>
    s.<span style="color: black;">bind</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span>, PORT<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    s.<span style="color: black;">listen</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># is someone knocking at the other end?</span>
    <span style="color: #808080; font-style: italic;">#</span>
    a = <span style="color: #dc143c;">select</span>.<span style="color: #dc143c;">select</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>s<span style="color: black;">&#93;</span>, <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>, <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>, TimeOut<span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># someone's there</span>
    <span style="color: #808080; font-style: italic;">#</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>a <span style="color: #66cc66;">!</span>= <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:
        <span style="color: #808080; font-style: italic;"># accept the connection</span>
        <span style="color: #808080; font-style: italic;">#</span>
        conn, addr = s.<span style="color: black;">accept</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># get data from the socket</span>
        <span style="color: #808080; font-style: italic;">#</span>
        data = conn.<span style="color: black;">recv</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1024</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># parse the result</span>
        <span style="color: #808080; font-style: italic;">#</span>
        tokens = <span style="color: #dc143c;">re</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\|</span>'</span>, data<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>tokens<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>:
            Application.<span style="color: black;">LogMessage</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Useage: Language | script code&quot;</span><span style="color: black;">&#41;</span>
            sRet = <span style="color: #483d8b;">&quot;Error&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            sRet = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>Application.<span style="color: black;">ExecuteScriptCode</span><span style="color: black;">&#40;</span>tokens<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>, tokens<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># be polite and send something back</span>
        <span style="color: #808080; font-style: italic;">#</span>
        conn.<span style="color: black;">send</span><span style="color: black;">&#40;</span>sRet<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># close the connection and return the result</span>
        <span style="color: #808080; font-style: italic;"># of the last command</span>
        <span style="color: #808080; font-style: italic;">#</span>
        conn.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> sRet
&nbsp;
    <span style="color: #808080; font-style: italic;"># there was nobody there so return false</span>
    <span style="color: #808080; font-style: italic;">#</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">False</span>
&nbsp;
<span style="color: #808080; font-style: italic;">###############################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Testing on port 50007</span>
<span style="color: #808080; font-style: italic;"># with a 10 second timeout.</span>
<span style="color: #808080; font-style: italic;"># You can test this using &quot;telnet hostname 50007&quot; from any other machine</span>
<span style="color: #808080; font-style: italic;"># or &quot;telnet localhost 50007&quot; from this machine</span>
<span style="color: #808080; font-style: italic;"># typing something like 'jscript | logmessage(&quot;testing&quot;)' will run 'logmessage(&quot;testing&quot;)' in the remote XSI.</span>
<span style="color: #808080; font-style: italic;"># 10 seconds should be enough time for you to run across the room and kick off a telnet. If you don't</span>
<span style="color: #808080; font-style: italic;"># make it then it'll just time out.</span>
<span style="color: #808080; font-style: italic;"># The connection is closed once the first string has been parsed but you can, if you wish, concatenate</span>
<span style="color: #808080; font-style: italic;">#  commands, as in 'jscript|logmessage(&quot;testing&quot;)|python Application.LogMessage(&quot;Python Testing&quot;)'</span>
<span style="color: #808080; font-style: italic;">#</span>
s = ReadSocket<span style="color: black;">&#40;</span><span style="color: #ff4500;">50007</span>, <span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">not</span> s<span style="color: black;">&#41;</span>:
    Application.<span style="color: black;">LogMessage</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Timeout&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
    Application.<span style="color: black;">LogMessage</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Connected: %s&quot;</span> <span style="color: #66cc66;">%</span> s<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=132&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/132/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>QuickTime .pic Codec Updated</title>
		<link>http://www.softimageblog.com/archives/128#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quicktime-pic-codec-updated</link>
		<comments>http://www.softimageblog.com/archives/128#comments</comments>
		<pubDate>Tue, 12 Dec 2006 23:25:56 +0000</pubDate>
		<dc:creator>Luc-Eric</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=128</guid>
		<description><![CDATA[Ever gotten an email with a .pic attached and would have liked to be able to just click on it to see it?  
My Softimage .pic codec for QuickTime has been updated with a bug fix for a corrupted image issue reported by a few users 
]]></description>
			<content:encoded><![CDATA[<p>Ever gotten an email with a .pic attached and would have liked to be able to just click on it to see it?  </p>
<p>My <a href="http://www.xsi-blog.com/?p=101">Softimage .pic codec for QuickTime</a> has been updated with a bug fix for a corrupted image issue reported by a few users </p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=128&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/128/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Easily creating Guids in Softimage XSI</title>
		<link>http://www.softimageblog.com/archives/104#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=easily-creating-guids-in-softimage-xsi</link>
		<comments>http://www.softimageblog.com/archives/104#comments</comments>
		<pubDate>Sat, 01 Jul 2006 15:29:32 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=104</guid>
		<description><![CDATA[As far as I''m concerned, once of the last few really ugly pimples on the face of Softimage XSI is the <a href="http://en.wikipedia.org/wiki/Guid">GUID</a>. A key component of SPDL files in XSI, the Globally Unique Identifier helps identify shaders and their parameters. Here is how you can create GUID from within XSI.]]></description>
			<content:encoded><![CDATA[<p>As far as I&#8217;m concerned, one of the last few ugly pimples on the face of Softimage XSI is the GUID. A key component of SPDL files in XSI (SPDL files being another pimple), the Globally Unique Identifier helps identify, among other things, shaders and their parameters.</p>
<p>For some info on the GUID check out <a href="http://en.wikipedia.org/wiki/Guid">wikipedia</a> and a <a href="/archives/83">previous post by Luc-Eric</a>.</p>
<p>There are many ways you can create these identifiers, they are basically just a unique number written in hexadecimal form. Some even advocate taking a preexisting GUID and changing a few characters. Personally I wouldn&#8217;t do this, the opportunity for conflict in my opinion is just too great and creating a GUID is too easy anyway. To create a proper GUID on a windows system you can use the guidgen.exe command or many other methodologies but as long as you&#8217;re in XSI why shouldn&#8217;t XSI be able to create one for you?</p>
<p><span id="more-104"></span>Stick the following Python code in a toolbar button and you&#8217;ll turn Softimage&#8217;s premier tool into an identifier creating machine. Each time you run the script or press the toolbar button, XSI will create a proper unique GUID for you. On top of that it&#8217;ll put the identifier in the Windows clipboard so you can paste it into your SPDL file or whatever other place you want it.</p>
<p><!-- google_ad_section_start(weight=ignore) --></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> pythoncom, win32clipboard
&nbsp;
<span style="color: #808080; font-style: italic;"># Create Guid</span>
guid = pythoncom.<span style="color: black;">CreateGuid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Put Guid in clipboard</span>
win32clipboard.<span style="color: black;">OpenClipboard</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
win32clipboard.<span style="color: black;">EmptyClipboard</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
win32clipboard.<span style="color: black;">SetClipboardText</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>guid<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
win32clipboard.<span style="color: black;">CloseClipboard</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Show Guid</span>
Application.<span style="color: black;">LogMessage</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>guid<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p><!-- google_ad_section_end --></p>
<p>Why should you care about GUIDs? Well <a href="http://web.tiscali.it/stefanoj/">Stefano Jannuzzo</a> will have an article on XSIBlog shortly about Phenomenon in the RenderTree that will make you care about Identifiers.</p>
<p>The above code is for Python on Windows. If anyone has alternative versions for JScript, VBScript as well as the Linux platform, please feel free to post them in the comments, I&#8217;m positive many people will find them usefull.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=104&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/104/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Automating QuickTime at the Command Line on Windows&#8230;</title>
		<link>http://www.softimageblog.com/archives/103#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=automating-quicktime-at-the-command-line-on-windows</link>
		<comments>http://www.softimageblog.com/archives/103#comments</comments>
		<pubDate>Mon, 26 Jun 2006 23:53:41 +0000</pubDate>
		<dc:creator>Luc-Eric</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=103</guid>
		<description><![CDATA[The QuickTime engineers have a problem. The API is huge and difficult to get into, various parts are obsolete and replaced by newer ones and therefore it is error-prone, and it needs to get away from the old MacOS API.
For OS X developers, Apple has made QtKit for Objective C developers so that normal people [...]]]></description>
			<content:encoded><![CDATA[<p>The QuickTime engineers have a problem. The API is huge and difficult to get into, various parts are obsolete and replaced by newer ones and therefore it is error-prone, and it needs to get away from the old MacOS API.</p>
<p>For OS X developers, Apple has made <a href="http://developer.apple.com/quicktime/qtkit.html">QtKit</a> for Objective C developers so that normal people (as normal as a person who choses Object C can be, anyway) can easily add QuickTime support to their app.</p>
<p>At about the same time, for Windows QuickTime 7.0  Apple has done the equivalent and added a new <a href="http://developer.apple.com/quicktime/activexcontrol.html">COM/ActiveX Control</a>.   This is not to be confused with the control that&#8217;s used in the Web Browser, it&#8217;s something totally different that is meant to be used in Visual Basic, C#, and C++ and other COM-enabled languages.</p>
<p>This new access to QuickTime is mostly meant for application developers in these programming languages, however it is possible to access these COM objects from ActiveScripting, so this means VBScript, JScript which come with Windows, and others like Python and Perl.</p>
<p><em>One little known fact is that you can run VBScripts and JScripts at the command-line on any Windows 2000 and XP machine.  The command-line intepreter is called &#8220;<strong>cscript.exe</strong>&#8221; and is located in your &#8220;Windows\System32&#8243; directory.  &#8220;wscript.exe&#8221;  is a windowed equivalent which will pop message boxes instead of displaying messages at the command line.  If for some reason you don&#8217;t have it installed, it&#8217;s a free <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c717d943-7e4b-4622-86eb-95a22b832caa&amp;displaylang=en">download</a>.</em></p>
<p>The scripting interface to QuickTime is still largely undocumented, however you can check out the methods and properties with an <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5233b70d-d9b2-4cb5-aeb6-45664be858b6&amp;DisplayLang=en">OLE object viewer</a>. I&#8217;ve also found some good examples on the web site for the book <a href="http://www.skylark.ie/qt4.net/samplecode.asp">QuickTime for .NET and COM Developers</a> , in the (Chapter 8) samples.</p>
<p><strong>Time for some code.</strong></p>
<p>I&#8217;ve created a script below which will convert an image sequence to a QuickTime movie.</p>
<p>The only hard part was the issue with codec settings.  As you may know from XSI and other products,  codec settings are a binary blob of data, and are not suitable to be set with a script, or nice human-readable properties: you have to go through the codec-specific custom user interface.  However the QuickTime control does allow to save codec settings into an XML file, to be re-applied later.  Again, the data is still not human-editable in this form &#8212;  the XML file contains Base64 data &#8212; you will need to use the codec dialog to change the settings. But at least you only need to pick it interactively once and can re-use the XML file for batch processing.</p>
<p>The first time you run my script, you&#8217;ll pick the codec with the dialog box, and these settings will then be saved into an XML file on the C:\ for the next time. Only known issue: the UI for the QuickTime player will apear during the export process, but that shouldn&#8217;t cause any problem, the script doesn&#8217;t return until the task is done.</p>
<p>QuickTime detects image sequences automatically when you give it an image file with a number in it.  To run the script, type something like<br />
<code>cscript jsQTtest.js D:\clock001.pic  C:\clock.mov</code></p>
<p><em>If you&#8217;re playing with the script and get an Unspecified Error on line 21, try manually launching the QuickTime Player manually before running the script.  commenter <strong>Nathang </strong>wrote:</em></p>
<blockquote><p>I fixed the “C:\qttest\qttest.js(21, 1) (null): Unspecified error ” problem by….</p>
<p><code>//under here:<br />
var qtPlayerApp = WScript.CreateObject(”QuickTimePlayerLib.QuickTimePlayerApp”);</code></p>
<p><code>//Add:<br />
WScript.Sleep(7000)</code></p>
<p>This give quicktime the chance to launch properly</p></blockquote>
<p><em>To get access to the &#8220;Import Image Sequence&#8221; in QuickTime 7.0,  normally you need to upgrade to QuickTimePro, but I&#8217;ve tested my script after disabling my QuickTime Pro license and it seems to work anyway.</em></p>
<p>Here is the script&#8230; click on the image to download it.<br />
<em>credits : I&#8217;ve received some from the QuickTime API mailing list on apple.com to resolve a codec setting issue, and I&#8217;ve used the samples from the book above.</em></p>
<p><em><strong>This <a href="/userContent/upload/jsQTtest.zip">script</a> converts images sequences to movies. It will exit and do nothing if you try to convert a movie to another movie</strong> Try changing the call to CreateNewMovieFromImages to CreateNewMovie to do that!</em></p>
<pre>// to run from the command line :
// cscript jsQTtest.js sourcepath, destpath

// Get script arguments
if (WScript.Arguments.Length &gt;= 2)  {
    sourcePath = WScript.Arguments(0);
    destPath = WScript.Arguments(1);
}   else    {
    WScript.Echo("not enough parameters");
    WScript.Quit();
}

// Launch QuickTime Player Application
var qtPlayerApp = WScript.CreateObject("QuickTimePlayerLib.QuickTimePlayerApp");
if (qtPlayerApp == null)    {
    WScript.Echo("Unable to launch QuickTime Player!");
    WScript.Quit();
}

// Get the QuickTime controler
var qtPlayerSrc = qtPlayerApp.Players(1);
if (qtPlayerSrc == null)
    WScript.Quit();
var qtControl =  qtPlayerSrc.QTControl;

// Set up the exporter and have it configured
var qt = qtPlayerSrc.QTControl.QuickTime;

qt.Exporters.Add();
var qtExporter = qt.Exporters(1);

var CodecInfoFileName = "C:\QuickTimCodecInfo.xml";

var FileSystemObject =  WScript.CreateObject("Scripting.FileSystemObject");
var CodecFileInfo;

if ( FileSystemObject.FileExists(CodecInfoFileName) )
    CodecFileInfo =  FileSystemObject.OpenTextFile( CodecInfoFileName );

qtExporter.TypeName = "QuickTime Movie";
qtControl.CreateNewMovieFromImages( sourcePath,
                                    30,     // frame rate
                                    true ); // rate is in frames per seconds
var qtMovie = qtControl.Movie;
qtExporter.SetDataSource( qtMovie );

if ( CodecFileInfo )    {
    var xmlCodecInfoText = CodecFileInfo.ReadAll();
    // cause the exporter to be reconfigured
    // http://developer.apple.com/technotes/tn2006/tn2120.html
    var tempSettings = qtExporter.Settings;
    tempSettings.XML = xmlCodecInfoText;
    qtExporter.Settings = tempSettings;
} else  {
    qtExporter.ShowSettingsDialog();

    var xmlCodecInfoText = qtExporter.Settings.XML;
    CodecFileInfo = FileSystemObject.CreateTextFile( CodecInfoFileName );
    if ( CodecFileInfo )  {
        CodecFileInfo.WriteLine(xmlCodecInfoText);
        CodecFileInfo.Close();
    }
}
// do the actual export
qtExporter.DestinationFileName = destPath;
qtExporter.ShowProgressDialog = true;
qtExporter.BeginExport();
qtPlayerSrc.Close();</pre>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=103&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/103/feed</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Softimage .pic Codec for QuickTime</title>
		<link>http://www.softimageblog.com/archives/101#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=softimage-pic-codec-for-quicktime</link>
		<comments>http://www.softimageblog.com/archives/101#comments</comments>
		<pubDate>Tue, 20 Jun 2006 21:05:08 +0000</pubDate>
		<dc:creator>Luc-Eric</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=101</guid>
		<description><![CDATA[Updated November 2009 for Quicktime 7 and Vista 64-bit
I have written a codec which allows QuickTime to read .pic files.
A few people have manually associated .pic files with the XSI flipbook or another viewer, but most people have them associated with the QuickTime Picture Viewer by default.
Installing this will not change your current file associations, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Updated November 2009 for Quicktime 7 and Vista 64-bit</strong></p>
<p>I have written a codec which allows QuickTime to read .pic files.</p>
<p>A few people have manually associated .pic files with the XSI flipbook or another viewer, but most people have them associated with the QuickTime Picture Viewer by default.</p>
<p>Installing this will not change your current file associations, but will allow the Picture Viewer to view .pic files when you double-click them instead of being greeted with an &#8221;Unknown Format&#8221; error, caused by QuickTime thinking these are Apple PICT file.<br />
It&#8217;s not necessary to have Softimage installed on the machine, this is completely self-contained</p>
<p><strong>Content of the Package</strong></p>
<ul>
<li>SoftimagePic.qtr</li>
<li>SoftimagePic.qtx</li>
<li>QuicktimeTestPic.pic</li>
<li>Install.bat</li>
</ul>
<p>Double-click Install.bat, which will copy the three other files to %ProgramFiles%\QuickTime\QTComponent, and will launch the Picture Viewer on QuicktimeTestPic.pic to verify the installation.<br />
On Windows Vista and up with UAC, don&#8217;t forget to use <strong>Run As Administrator</strong> for the batch file, otherwise it won&#8217;t be able to copy the files.</p>
<p>I am not aware of any installation problem, but if somehow QuickTime isn&#8217;t finding the codec try to log out and back on to restart it.</p>
<p>Batch file hackers might be interested in seeing how I got the batch file to work from UNC drives, which isn&#8217;t supported by cmd.exe, or testing if the command prompt is 32-bit or 64-bit.</p>
<p><a title="SoftimagePicCodecWIN1_2.zip" href="/userContent/upload/2009/11/softimagepiccodecwin1_2.zip">SoftimagePicCodecWIN1_2.zip (69k)</a></p>
<p><strong>Preliminary OS X Version</strong></p>
<p>Here is a Universal Binary port of this codec for OS X 10.4 (Tiger).</p>
<p>It will allow the QuickTime Player and other QuickTime-enabled apps to load Softimage .pic files. Unfortunately, this will not work in Preview or Finder previews as they by-pass QuickTime for .pic files and use an undocumented Core Image image mechanism instead. It is best to re-associate .pic files with the QuickTime player instead of Preview to allow easy double-click viewing of images. Please read the instructions contained in the installer.</p>
<p>The file contains a disk image with an installer which simply copies the component to /Library/QuickTime. A restart of the system is necessary at this time for the component to be detected.</p>
<p><a href="http://pages.infinit.net/lucer/SoftimagePicOSX.zip">SoftimagePicOSX.zip (128k)</a></p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=101&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/101/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
