<?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; Bablings and Ramblings</title>
	<atom:link href="http://www.softimageblog.com/archives/category/bablings-and-ramblings/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>A Shortcut For Your Shortcuts</title>
		<link>http://www.softimageblog.com/archives/256#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-shortcut-for-your-shortcuts</link>
		<comments>http://www.softimageblog.com/archives/256#comments</comments>
		<pubDate>Thu, 03 Apr 2008 02:56:02 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=256</guid>
		<description><![CDATA[When working with XSI in a facility I often use Python modules to better package my code and allow easy reuse of key parts in the different tools that are developed. These modules I usually keep in a location on the main drive of the workstations, for example: C:\&#60;facilityName&#62;\libs\python.
I&#8217;ll also put in place a system [...]]]></description>
			<content:encoded><![CDATA[<p>When working with XSI in a facility I often use Python modules to better package my code and allow easy reuse of key parts in the different tools that are developed. These modules I usually keep in a location on the main drive of the workstations, for example: C:\&lt;facilityName&gt;\libs\python.</p>
<p>I&#8217;ll also put in place a system to push central library changes to the local computers and insert the library location in the PYTHONPATH environment variable.</p>
<p>The <a href="http://softimage.wiki.avid.com">XSI Wiki</a> has a great page on the pros and cons of <a href="http://softimage.wiki.avid.com/index.php/Python_Custom_Modules_(XSISDK)">the module approach</a>. One of the cons is that the <code>Application</code> global variable is only accessible in your script files and plugin files and not in your modules.</p>
<p><span id="more-256"></span>In the past I would put the following code at the top of my various modules:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> win32com
<span style="color: #ff7700;font-weight:bold;">from</span> win32com.<span style="color: black;">client</span> <span style="color: #ff7700;font-weight:bold;">import</span> constants <span style="color: #ff7700;font-weight:bold;">as</span> c
xsi = win32com.<span style="color: black;">client</span>.<span style="color: black;">Dispatch</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'XSI.Application'</span><span style="color: black;">&#41;</span>.<span style="color: black;">Application</span>
log = xsi.<span style="color: black;">Logmessage</span></pre></td></tr></table></div>

<p>Following this would be a bunch of other shortcuts and dispatch commands for XSIUtils, XSIUIToolkit, XSIMath, etc&#8230;</p>
<p>Being tired of inserting these lines at the header of every module and a subset of this code (for shortcuts) at every script or plugin, I decided to centralize them and move them to their own module.</p>
<p>The library structure looks like so:</p>
<pre>../libpath/
    vg/
        xsi/
            __init__.py
            xsiModule1.py
            xsiModule2.py
            [...]</pre>
<p>In the <code>__init__.py</code> file I put the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> win32com
<span style="color: #ff7700;font-weight:bold;">from</span> win32com.<span style="color: black;">client</span> <span style="color: #ff7700;font-weight:bold;">import</span> constants <span style="color: #ff7700;font-weight:bold;">as</span> c
xsi = win32com.<span style="color: black;">client</span>.<span style="color: black;">Dispatch</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'XSI.Application'</span><span style="color: black;">&#41;</span>.<span style="color: black;">Application</span>
log = xsi.<span style="color: black;">Logmessage</span>
<span style="color: #808080; font-style: italic;"># [... more shortcuts and dispatch commands ...]</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> getShortcuts<span style="color: black;">&#40;</span>g<span style="color: black;">&#41;</span>:
    g<span style="color: black;">&#91;</span><span style="color: #483d8b;">'win32com'</span><span style="color: black;">&#93;</span> = win32com
    g<span style="color: black;">&#91;</span><span style="color: #483d8b;">'c'</span><span style="color: black;">&#93;</span> = c
    g<span style="color: black;">&#91;</span><span style="color: #483d8b;">'xsi'</span><span style="color: black;">&#93;</span> = xsi
    g<span style="color: black;">&#91;</span><span style="color: #483d8b;">'log'</span><span style="color: black;">&#93;</span> = log
    <span style="color: #808080; font-style: italic;"># [... more shortcuts and dispatch commands scope transfers...]</span></pre></td></tr></table></div>

<p>This allows me to benefit from the shortcuts in the rest of the <code>__init__.py</code> file where some general XSI functions are kept but also start my other modules, scripts and plugins with the following two lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> vg.<span style="color: black;">xsi</span> <span style="color: #ff7700;font-weight:bold;">as</span> vx
vx.<span style="color: black;">getShortcuts</span><span style="color: black;">&#40;</span><span style="color: #008000;">globals</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>By providing the <code>getShortcuts</code> function with a dict representing the global scope of my module, script or plugin, the function can edit the members of the scope and give me all the necessary symbols.</p>
<p>Another stupid trick rears it&#8217;s head! ;)<br />
Happy scripting!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=256&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/256/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Steven Caron, OBJ Files, Sexy Bits and Waste</title>
		<link>http://www.softimageblog.com/archives/249#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=steven-caron-obj-files-sexy-bits-and-waste</link>
		<comments>http://www.softimageblog.com/archives/249#comments</comments>
		<pubDate>Sat, 01 Mar 2008 20:25:45 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/archives/249</guid>
		<description><![CDATA[What do all these things have in common?
The weird wirings in my brain. That&#8217;s what.
Back to the beginning
At the end of last October Steven Caron sent me a plugin he wrote that allows an XSI user to drag and drop .obj files into the interface and have them import automatically according to settings in a [...]]]></description>
			<content:encoded><![CDATA[<p>What do all these things have in common?</p>
<p>The weird wirings in my brain. That&#8217;s what.</p>
<p><strong>Back to the beginning</strong></p>
<p>At the end of last October Steven Caron sent me a <a href="http://www.xsi-blog.com/userContent/scaron/ObjDnD.xsiaddon">plugin</a> he wrote that allows an XSI user to drag and drop .obj files into the interface and have them import automatically according to settings in a custom preference. I was a bit swamped at the time putting up the infrastructure for a new VFX department at my new workplace. And then I totally forgot about it&#8230; Sorry Steven.</p>
<p>This past week Steven politely reminded me of my omission so I ran back to my email archives and installed it. Neat piece of work.</p>
<p>I didn&#8217;t want to just post up the tool as I don&#8217;t really see this blog being about tool distribution but about how said tools work and the neat tricks they use. With that philosophy in mind I cracked open Steven&#8217;s tool to dig out some of its sexier bits and maybe demystify them for the audience.</p>
<p>To my surprise there weren&#8217;t any sexy bits. Please don&#8217;t get me wrong, the tool works superbly, how much more intuitive can you get than drag and drop. The tool is also extremely well written, concise and straightforward. There just aren&#8217;t any weird tricks or convoluted syntax or things that would generally have you scratching your head.</p>
<p>Then I noticed this in his version trapping code (yes folks, the drag and drop event is new in XSI 6.5):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span> tXSIVersion<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: #66cc66;">&lt;</span> <span style="color: #ff4500;">6</span>:
    xsiPrint<span style="color: black;">&#40;</span> xsi.<span style="color: black;">Version</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot; doesn't support the 'siOnDragAndDrop' event!&quot;</span> <span style="color: black;">&#41;</span>
    xsi.<span style="color: black;">UnloadPlugin</span><span style="color: black;">&#40;</span> in_reg.<span style="color: black;">name</span>, <span style="color: #008000;">True</span> <span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">False</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span> tXSIVersion<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> <span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> <span style="color: #ff4500;">5</span>:
        xsiPrint<span style="color: black;">&#40;</span> xsi.<span style="color: black;">Version</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot; doesn't support the 'siOnDragAndDrop' event!&quot;</span> <span style="color: black;">&#41;</span>
        xsi.<span style="color: black;">UnloadPlugin</span><span style="color: black;">&#40;</span> in_reg.<span style="color: black;">name</span>, <span style="color: #008000;">True</span> <span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">False</span></pre></td></tr></table></div>

<p><span id="more-249"></span><b>About the waste part</b></p>
<p>Bare with me&#8230;</p>
<p>Last week I was reading a really neat <a href="http://www.wired.com/techbiz/it/magazine/16-03/ff_free">article</a> in <a href="http://www.wired.com">Wired</a> by Chris Anderson entitled <i>&#8220;Free! Why $0.00 Is the Future of Business&#8221;</i>. I invite you to read it, especially the section beginning on page two: <i>Waste and Waste Again</i>.</p>
<p>&#8230;So if in the seventies you had to be really tight with your algorithms and optimizations because cpu cycles were so scarce, today I guess we can really waste them. Just the other day I setup an 8 core MacPro with BootCamp, XP x64 and XSI. Whatever I did to the machine, I swear, I could hear it yawn because it was bored.</p>
<p>Which brings me back to Steven&#8217;s code. Could it have been written like so:</p>
</pre>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>27
28
29
30
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span> tXSIVersion<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: #66cc66;">&lt;</span> <span style="color: #ff4500;">6</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span> tXSIVersion<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> <span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> <span style="color: #ff4500;">5</span>:
    xsiPrint<span style="color: black;">&#40;</span> xsi.<span style="color: black;">Version</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot; doesn't support the 'siOnDragAndDrop' event!&quot;</span> <span style="color: black;">&#41;</span>
    xsi.<span style="color: black;">UnloadPlugin</span><span style="color: black;">&#40;</span> in_reg.<span style="color: black;">name</span>, <span style="color: #008000;">True</span> <span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">False</span></pre></td></tr></table></div>

<p>Is it more or less readable by a programmer?<br />
It probably executes in a few cycles less but is it worth it?<br />
Python is interpreted so if the parser goes through this version quicker, is it worty of any mention?<br />
Is it more maintainable?</p>
<p>This example is really simple but in a bigger project, or with more complex cases, should we really be worrying if today transistors and cpu cycles are so cheap as to not even matter anymore</p>
<p>When I'm stuck on a piece of code or when I hit that time of the afternoon where most of my energy is diverted to digesting, I'll often reread my code and tighten it, remove redundancy, put in functions instead of copying a few lines in two locations, consolidate <i>if</i> statements, etc... One of my colleagues used to tell me that <i>"Premature optimization is the root of all evil."</i></p>
<p>Honestly, if I look back at a good proportion of the code I have written, it either executes in a blink of an eye on today's computers or it sits there waiting 90% of the time for user interaction. Should we, as technical XSI users, XSI scripters or TDs, even worry about optimization from a performance standpoint or a maintainability standpoint? What can be considered a good optimization and what should be considered a bad one?</p>
<p>And now that you're really wondering what I'm rambling about, I'll shut up and let you <a href="http://www.xsi-blog.com/userContent/scaron/ObjDnD.xsiaddon">download Steven's addon</a>.</p>
<p>Have a good weekend.</pre>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=249&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/249/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Is it time to move to Vista?</title>
		<link>http://www.softimageblog.com/archives/131#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=is-it-time-to-move-to-vista</link>
		<comments>http://www.softimageblog.com/archives/131#comments</comments>
		<pubDate>Fri, 29 Dec 2006 20:46:17 +0000</pubDate>
		<dc:creator>Luc-Eric</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=131</guid>
		<description><![CDATA[XSI 6.0 was being finished pretty much at the same time as Vista was on RC so we didn&#8217;t have to fully test XSI on Vista in depth, there was just too many things going on at the same time. New compilers, new MainWin, new render core, new setups, etc. 
On one hand, 6.0 adds [...]]]></description>
			<content:encoded><![CDATA[<p>XSI 6.0 was being finished pretty much at the same time as Vista was on RC so we didn&#8217;t have to fully test XSI on Vista in depth, there was just too many things going on at the same time. New compilers, new MainWin, new render core, new setups, etc. </p>
<p>On one hand, 6.0 adds DirectX 10 support, which is an extremely significant departure from DirectX 9, and is exclusive to Vista. That&#8217;s right, neither Windows XP nor the XBox 360 will support DirectX 10, and users need a bleeding edge graphics card. Still, game developers need to get ready now for games that will come out in a couple of years, and they can do so with XSI. We&#8217;ve also fixed a few glitches that XSI had when running under Vista. For example, the buttons did not work in message boxes, due to a problem with our skinning mechanism. One can work-around the problem by using the keyboard to select the buttons instead. On the other hand, we do not presently have a dongle driver compatible with Vista, so this means it is required to run the license server off another machine. (I think this does not affect Foundation, which doesn&#8217;t have a dongle.)  Softimage is very committed to having good Vista support, and will provide updates on the subject during 2007. Right now we do have a few users running under Vista and we&#8217;re very interested in your experience if you are doing this; do not hesitate to add your comments to this post.</p>
<p>Windows XP should still be available for general purchase for at least one year, and it is probably best to stay with it in the immediate future. At the other extreme, while we do not test and support Windows 2000 anymore, we do have several users that still use it. We are not at this time using any feature specific to XP, nor are we planning anything of the sort at this time. In my opinion, if you have a laptop it is a good idea to upgrade to at least XP, because it is faster, and graphic driver support for 2000 can be scarce. XP is also required for hyper-threading support and has newer and better drivers. You can turn on &#8220;classic mode&#8221; in XP to make XP continue to look like Windows 2000 :D</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=131&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/131/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Points on a sphere</title>
		<link>http://www.softimageblog.com/archives/115#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=points-on-a-sphere</link>
		<comments>http://www.softimageblog.com/archives/115#comments</comments>
		<pubDate>Wed, 04 Oct 2006 05:00:59 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=115</guid>
		<description><![CDATA[A few algorithms to distribute points on the surface of a sphere.]]></description>
			<content:encoded><![CDATA[<p>I can think of a few reasons why you would want to evenly distribute points on the surface of a sphere. How one would go about it is another thing entirely. When I recently had to create lights on the surface of a sphere for a light rig, I had to Google around for algorithms and I thought I would share some results with you.</p>
<p><strong>Defining Evenly Distributed</strong></p>
<p>Some would argue that for points to be evenly distributed on a sphere the resulting polygonal object defined by the points needs to have faces that are equal as well as an equal number of faces leading into every vertex. These perfect shapes are known as <a href="http://en.wikipedia.org/wiki/Platonic_solid">Platonic Solids</a>.</p>
<p>There are unfortunately only five platonic solids: the tetrahedron, cube, octahedron, dodecahedron and icosahedron each having 4, 8, 6, 20 and 12 vertices.</p>
<p>So unless that is exactly the number of points you wish to have around your sphere we must somehow redefine evenly distributed. There is a great discussion on this titled &#8220;<a href="http://www.math.niu.edu/~rusin/known-math/95/sphere.faq">Topics On Sphere Distributions</a>&#8221; by Dave Rusin.</p>
<p>In our case, let&#8217;s ignore how the points would combine to create a solid and concentrate on the distance relationship to its neighbors considering the whole set. For any given number of points what we want is for the minimum distance between any two points to be as large as possible. Makes sense? If any two closest points in the whole set are as far apart as possible, all points should be equally distant from their closest neighbor. That is what we will define as evenly distributed.</p>
<p><span id="more-115"></span><strong>How to achieve even distribution</strong></p>
<p>One of the most precise ways to organize points on a sphere, given our definition, would be to simulate them repelling themselves with equal force until they settled (see <a href="http://www.chiark.greenend.org.uk/~sgtatham/polyhedra/">this document</a> by Simon Tatham). It would be exact but wouldn&#8217;t necessarily be quick. Then there are three algorithms that approximate the same result all the while requiring less computational power.</p>
<p>The first one is <a href="http://www.math.niu.edu/~rusin/known-math/95/equispace.elect">Dave Rusin&#8217;s Disco Ball</a>. Although it will wield a very precise pattern the algorithm does not allow to specify an exact number of points which are then distributed. </p>
<p>The second one is the method of <a href="http://sitemason.vanderbilt.edu/page/hmbADS">Saff and Kuijlaars</a>. This second one packs the points much less tightly than the Disco Ball but manages to do so with any arbitrary number of points.</p>
<p>Finally there is an algorithm based on the greek golden ratio, the <a href="http://cgafaq.info/wiki/Evenly_distributed_points_on_sphere">Golden Section spiral</a>. This last stab at the problem can generate a set packed more evenly than Saff and Kuijlaars while being able to specify any number of points.</p>
<p><a href="http://www.ogre.nu/pack/pack.htm">Here</a> is a graphical comparison of the three methods.</p>
<p><strong>My Golden Section Spiral</strong></p>
<p>Here is a Python implementation of the Golden Section spiral:</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
</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;">math</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> pointsOnSphere<span style="color: black;">&#40;</span>N<span style="color: black;">&#41;</span>:
    N = <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>N<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># in case we got an int which we surely got</span>
    pts = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
    inc = <span style="color: #dc143c;">math</span>.<span style="color: black;">pi</span> <span style="color: #66cc66;">*</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">3</span> - <span style="color: #dc143c;">math</span>.<span style="color: black;">sqrt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">5</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    off = <span style="color: #ff4500;">2</span> / N
    <span style="color: #ff7700;font-weight:bold;">for</span> k <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, N<span style="color: black;">&#41;</span>:
        y = k <span style="color: #66cc66;">*</span> off - <span style="color: #ff4500;">1</span> + <span style="color: black;">&#40;</span>off / <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
        r = <span style="color: #dc143c;">math</span>.<span style="color: black;">sqrt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span> - y<span style="color: #66cc66;">*</span>y<span style="color: black;">&#41;</span>
        phi = k <span style="color: #66cc66;">*</span> inc
        pts.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #dc143c;">math</span>.<span style="color: black;">cos</span><span style="color: black;">&#40;</span>phi<span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span>r, y, <span style="color: #dc143c;">math</span>.<span style="color: black;">sin</span><span style="color: black;">&#40;</span>phi<span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span>r<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> pts</pre></td></tr></table></div>

<p>By passing any arbitrary number of points to the function, it will return an array of points in space representing the locations of all points on a unit sphere. You can then multiply this unit vector by whatever length you wish to get the position on a sphere of any size.</p>
<p>Paste the above code in the script editor followed by this concrete XSI example and run it to see the results:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> pt <span style="color: #ff7700;font-weight:bold;">in</span> pointsOnSphere<span style="color: black;">&#40;</span><span style="color: #ff4500;">80</span><span style="color: black;">&#41;</span>:
    n = Application.<span style="color: black;">ActiveSceneRoot</span>.<span style="color: black;">AddNull</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    n.<span style="color: black;">size</span> = <span style="color: #ff4500;">0.05</span>
    t = n.<span style="color: black;">Kinematics</span>.<span style="color: black;">Global</span>.<span style="color: black;">Transform</span>
    t.<span style="color: black;">SetTranslationFromValues</span><span style="color: black;">&#40;</span>pt<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>, pt<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>, pt<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    n.<span style="color: black;">Kinematics</span>.<span style="color: black;">Global</span>.<span style="color: black;">Transform</span> = t</pre></td></tr></table></div>

<p>Voilà! I hope this helps you on your way to the perfect spherical distribution. ;)<br />
Yeah&#8230; I sometimes have a hard time remembering that our job is to make pretty pictures.</p>
<p>Cheers,</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=115&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/115/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>ADAPT 2006</title>
		<link>http://www.softimageblog.com/archives/114#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=adapt-2006</link>
		<comments>http://www.softimageblog.com/archives/114#comments</comments>
		<pubDate>Mon, 25 Sep 2006 02:40:25 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=114</guid>
		<description><![CDATA[I went to Adapt 2006 this weekend and decided to post about it. You'll see some stuff on here in the future that will be born of some ideas I picked up during this weekend, of that I'm positive.]]></description>
			<content:encoded><![CDATA[<p>I went to <a href="http://www.adaptmontreal.com/a2006/">Adapt 2006</a> this weekend and decided to post about it. You&#8217;ll see some stuff on here in the future that will be born of some ideas I picked up during this weekend, of that I&#8217;m positive.</p>
<p><strong>Aaron Holly<br />
<a href="http://disney.go.com/">Disney Feature Animation</a></strong></p>
<p>First Talk of Saturday was Aaron Holly, rigger at Disney. The talk was about deformable rigging in Maya. The idea is to enable animators, who often have a background in classical 2D animation, to achieve the exact pose they require including all kinds of squash and stretch.</p>
<p>The approach Aaron shared was to build simple skeletal structures that drive an intermediate deformation level whose controls can be torn off the skeletal structure thus achieving any exaggerated pose required.</p>
<p>Aaron, who studied philosophy before swerving into the 3D realm actually invoked <a href="http://en.wikipedia.org/wiki/Occam''s_Razor">Occam&#8217;s razor</a> as being an underlying philosophy to his approach to 3D rigging. Occam&#8217;s razor states that, given two valid solutions to a problem, the simplest solution is invariably the best. Nice words to work by.</p>
<p>Another issue that Aaron talked about is linking stuff (secondary shape animation for example) to the rotation of a ball joint in a rig. A ball joint will usually have rotation on all three axes while you will typically want only two values to link your stuff to: a top/bottom rotation as well as a forward/backward. The approach showed was to project the end of the joint onto a plane at the root of the joint. The position on this 2D plane vis-a-vis the root of the joint thus represents in 2D space the amount of rotation applied to the bone. Interesting. I&#8217;m sure a custom operator for XSI can be written that would compute this in a flash. This to-do list of mine is getting way too long!</p>
<p><span id="more-114"></span><br />
<strong>Mark Lefitz</strong></p>
<p>Mark was showing a typical digital environment workflow. A lot of interesting stuff was shown, Mark&#8217;s production experience really shows.</p>
<p>Tips and tricks for easing the workflow such as working in half rez or 1K and then scaling up renders for final out.</p>
<p>All in all a neat talk. Mark has often worked in Maya and Renderman and mentioned some pass workflows that were interesting. XSI&#8217;s passes and partitions still seem to dwarf anything else I&#8217;ve seen though.</p>
<p><strong>Chris Williams<br />
<a href="http://www.lucasarts.com/">Lucasarts</a></strong></p>
<p>Having never worked in a games development house I never really realized how much the two industries of games and film have come together.</p>
<p>Chris of Lucasarts spoke a lot of convergence. We all know the Lucas empire is huge and as technologies have been moving to a common nodal point a lot of effort has been put into unifying pipelines and processes over at George&#8217;s place. Slick stuff.</p>
<p>We&#8217;ve all heard a bit about Zeno, ILM&#8217;s new development framework for custom tools. Well, it seems to be a much larger endeavor than I thought. The guys at ILM R&#038;D seem to have almost come up with a full content creation system. Integrating game technologies to create film previs tools, moving editing tools from a film background to a cutscene blocking environment as well as providing a unified environment for the artists. It&#8217;s all proprietary so we can only fathom all the things Zeno can do.</p>
<p>Lastly, we were able to see a tech demo of euphoria technology jointly developed with UK-based <a href="http://www.naturalmotion.com/">Natural Motion</a> who market a character simulation software called Endorphin. Seamless blending from animation to ragdoll to animation as well as simulated character motion reacting to environmental factors. Imagine a simulated character latching on to a second story railing after having been projected sky high by an explosion. Check out the Endorphin demo to get an idea of the technology.</p>
<p>Consumer technology is always pushed forward by a few R&#038;D brainiacks going &#8220;I bet I can do this.&#8221; when everyone else is saying &#8220;Wouldn&#8217;t it be cool if&#8230;&#8221; or even &#8220;It can&#8217;t be done&#8221;. Looking at Stanford, UCLA, ILM, Disney, Sony Picture Imageworks and other large players as well as a host of smaller ones makes me say it&#8217;s a good time for digital content creation.</p>
<p><strong>Jeremy Birn<br />
<a href="http://www.pixar.com">Pixar</a></strong></p>
<p>It was refreshing to see someone approach digital compositing from a more technical point of view. Most people, when they talk about compositing concentrate on the finished product and its artistic and aesthetic value but knowing what happens under the hood IMHO is a prerequisite to getting that extra edge.</p>
<p>Jeremy managed to explain some of the mathematics involved in very clear and simple terms. It was nice to have representatives of both the artistic comper (Mark Lefitz) as well as the technical comper (Jeremy) in the same conference.</p>
<p>Jeremy also covered the creation and management of passes/render layers in Maya and how these different outputs can then be recombined in Shake to produce final output. XSI&#8217;s implementation of this stuff rocks. The use of XSI in that last phrase wasn&#8217;t a typo.</p>
<p>&#8230; And Jeremy was the first speaker of the weekend I heard mention XSI. Is Maya really so pervasive and have so many people not yet discovered the strong points of Softimage&#8217;s product portfolio? You do know they&#8217;ve evolved quite a bit since Softimage|3D!</p>
<p><strong>Emile Ghorayeb<br />
<a href="http://www.ubisoft.com">Ubisoft</a></strong></p>
<p>Emile is obviously a great animator with a lot of experience. His demo of the squash and stretch style of cartoon animation as applied to 3D characters was very enlightening. Emile often stressed that, as an animator, it is very important for him to be as close to the character as possible. For the riggers out there he is saying that the rigs you produce should keep the animator on the character and avoid as much clutter as possible. For the animators out there he is saying that you are as much an actor as an animator and you should live and breathe through your character while you are working. Anything in your 3D environment that could tare you away from the performance should be avoided. Even if Emile seems to be the strong silent type, or maybe he was just really nervous, he is obviously passionate about his work and it shows through his results.</p>
<p><strong>Eddie Pasquarello<br />
<a href="http://www.ilm.com">ILM</a></strong></p>
<p>Pirates of the Caribbean 2: Dead Man&#8217;s Chest<br />
What an impressive show.</p>
<p>If a lot of movie critics talked about digital makeup or flesh extensions for Davey Jones, ILM is working hard to debunk that myth. Davey Jones and his crew are 100% digital, eyeballs and all.</p>
<p>The talk was pretty much a usual show and tell and when ILM does a show and tell you can be sure a lot of you questions will be replied with either:<br />
<em>- &#8220;It was proprietary software.&#8221;</em><br />
or<br />
<em>- &#8220;We did it with Zeno&#8221;</em><br />
which is proprietary software. I guess you can do that when you have one third as many coders and TDs as artists.</p>
<p>One thing that really blew me away is a proprietary tool ILM developed for this show called iMocap (taking a page from Apple&#8217;s marketing handbook are we?). This thing could pick up actor performance from a set with the main film camera and two witness cameras. The kick is that the iMocap system doesn&#8217;t care about lighting conditions and can pick up performance from many actors at once in an almost unrestricted set space.</p>
<p>&#8230; Say what?</p>
<p>Yep they built an uber flawless mocap system. I would love to get to the guts of this thing and see how it works but I guess I&#8217;ll have to get my own gears turning and figure it out on my own.</p>
<p>No matter how you did it, kudos to ILM. You did great work.</p>
<p><strong>Arnaud Lamorlette<br />
<a href="http://www.pdi.com/">PDI/Dreamworks </a></strong></p>
<p>Arnaud started with an overview of the production process over at PDI and he mentioned something called PDI pipeline. Yeah, don&#8217;t you love these large studios and all their proprietary tools.</p>
<p>Most of the talk was a show and tell about Shrek 2&#8217;s effects work and, refreshingly, a few details were given. One effect example that was dissected was the fireballs. Surprisingly few passes and rather simple solution of growing isosurfaces with fractal noise displacement and a normal-based color shader accounted for 90% of the effect. Neat.</p>
<p>All in all I had a great time because content was king at ADAPT 2006. For a first time conference it could have been otherwise but the organizers really did their homework.</p>
<p>I hope next year I&#8217;ll get to meet you all at the 2007 edition.<br />
Cheers.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=114&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/114/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>New website for Buzz</title>
		<link>http://www.softimageblog.com/archives/112#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-website-for-buzz</link>
		<comments>http://www.softimageblog.com/archives/112#comments</comments>
		<pubDate>Thu, 07 Sep 2006 19:32:36 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=112</guid>
		<description><![CDATA[Buzz, the Montreal-based visual effects studio, has a new web site up. They&#8217;ve got some nice content to view, but of course, I&#8217;m biased.
Cheers.
]]></description>
			<content:encoded><![CDATA[<p>Buzz, the Montreal-based visual effects studio, has a <a href="http://www.buzzimage.com">new web site</a> up. They&#8217;ve got some nice content to view, but of course, I&#8217;m biased.</p>
<p>Cheers.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=112&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/112/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Python, the text editor, and encoding</title>
		<link>http://www.softimageblog.com/archives/111#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=python-the-text-editor-and-encoding</link>
		<comments>http://www.softimageblog.com/archives/111#comments</comments>
		<pubDate>Sat, 26 Aug 2006 16:17:55 +0000</pubDate>
		<dc:creator>Bernard Lebel</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=111</guid>
		<description><![CDATA[Recently I ran into a severe problem. Whenever I would try to import modules in the Python command line shell, I''d get syntax error pointing to the first line. In fact, trying to import the module in XSI from a custom command gave a syntax error at line... zero! What the?]]></description>
			<content:encoded><![CDATA[<p>Recently I ran into a severe problem. Whenever I would try to import modules in the Python command line shell, I&#8217;d get syntax error pointing to the first line. In fact, trying to import the module in XSI from a custom command gave a syntax error at line&#8230; zero! What the?</p>
<p><span id="more-111"></span>So I started trouble-shooting, and it finally came down to &#8220;as soon as there was a single character in the file, I would get these errors&#8221;. No matter what I would write in the file, either a &#8220;pass&#8221; statement or a # character, I would get the error. Also, while Python was reporting an error, it also gave me &#8220;no encoding declared&#8221; messages.</p>
<pre>>>> from lighting.LightTools.modify import LT_ReorientInfiniteLight2
__main__:1: DeprecationWarning: Non-ASCII character ''\xff'' in file E:\workgroup\Data\Scripts\lighting\LightTools\modify\LT_ReorientInfiniteLight2.py o
n line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in ?
  File "E:\workgroup\Data\Scripts\lighting\LightTools\modify\LT_ReorientInfiniteLight2.py", line 1
     ?p
    ^
SyntaxError: invalid syntax</pre>
<p>Notice the black square before the p. That made no sense, as the p was the first character (a &#8220;pass&#8221; statement).</p>
<p>I tried every possible thing, like ovewriting the file with a new one, etc. Basically I spent few hours to try to solve an impossible syntax error.</p>
<p>However I tried another text editor (UltraEdit), and I no longer had the error. So it became clear that my first text editor, SciTE (Scintilla Text Editor), was at fault.</p>
<p>So in SciTE, I went to File &gt; Encoding, and I notice it is set to one of the two UCS encodings. I set it to Default.</p>
<p>Problem gone.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=111&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/111/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Softimage Releases FaceRobot&#8230;</title>
		<link>http://www.softimageblog.com/archives/92#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=softimage-releases-facerobot</link>
		<comments>http://www.softimageblog.com/archives/92#comments</comments>
		<pubDate>Fri, 10 Mar 2006 14:38:26 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=92</guid>
		<description><![CDATA[And everybody except the targeted audience gasps at the price of 95K for Face Robot Designer and 15K for Face Robot Animator.
People in the OSS and free software world like to talk about free speach vs. free beer. Well, it seems to me like the ever widening 3D application userbase likes to have its free [...]]]></description>
			<content:encoded><![CDATA[<p>And everybody except the targeted audience gasps at the price of 95K for Face Robot Designer and 15K for Face Robot Animator.</p>
<p>People in the <a href="http://www.dwheeler.com/oss_fs_why.html">OSS and free software</a> world like to talk about free speach vs. free beer. Well, it seems to me like the ever widening 3D application userbase likes to have its free lunch.</p>
<p>Thursday, March 28, 2002 Alias Wavefront <a href="http://www.aliaswavefront.com/glb/eng/press/press_release_details.jsp?itemId=1300024">cuts the price of Maya</a> down to $1,999 and $6,999 for their Complete and Unlimited versions respectively. To me, this was the start of a democratization process to bring inexpensive professional quality 3D content creation software to the masses. Then came out the learning editions, the tiered pricings and since <a href="http://www.avid.com/company/releases/2004/040809_siggraph.html">August 2004</a> you can even get an XSI version for $495.</p>
<p>Then comes along Face Robot and people are aghast. They&#8217;ve quickly gotten used to their free lunch. They clamor for innovation yet they aren&#8217;t ready to back-up the company that provides such leading edge innovation.</p>
<p>I can&#8217;t even start to imagine the amount of research that was poured into Face Robot and that R&amp;D cost needs to be offset by Softimage. They aren&#8217;t, after all, a non profit buisness. And if a product can help you achieve the same quality output in less time, or a better output in as much time, considering the size of animation teams involved in photoreal character animation projects, 95K isn&#8217;t that much a big deal.</p>
<p>And let&#8217;s not forget that Face Robot is a highly specialized tool.</p>
<p>If memory serves, Behavior was initially around 15K-20K. I don&#8217;t really have to remember, I wasn&#8217;t the one who coughed up the dough. The Buzz team I worked with at the time was among the first to use Behavior in a commercial advertisment context. As an early adopter of the technology we were one of the customers that helped Softimage offset R&amp;D costs. This brings me to two points.</p>
<p>1 &#8211; Behavior is still not being used all that much. Face Robot, like Behavior is a very specialized tool and for most studios, would be nothing more than an experiment. After toying around a bit that studio would go back to their bread and butter shot that doesn&#8217;t include a human face or a crowd. Face Robot is aimed at projects, not studios and the studio that has a project to warrant the use of Face Robot should have the budgetary envelope for it as well.</p>
<p>2 &#8211; Look at what has happened since Behavior hit market. It is now included with every purchase of XSI Advanced. Behavior has been democratized fairly well by now so who knows where we&#8217;ll be later on down the road with Face Robot. For now the people that have already done their bean counting know if this technology is what they need.</p>
<p>The rest of us can wait for the R&amp;D investments to be offset and the competition to heat up in, what is for now, a Softimage only arena.</p>
<p>After all this is what this all boils down to: how much are you willing to pay for exclusivity, new products and most of all: innovation.</p>
<p>Check out the <a href="http://www.softimage.com/about_us/press_room/2006/060309.aspx">press release</a> and <a href="http://www.softimage.com/products/face_robot/default.aspx">product pages</a> for FaceRobot<br />
If you think I woke up in a pissy mood and am way off track or if you think likewise on this issue, please feel free to comment!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=92&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/92/feed</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Render Passes in Behavior</title>
		<link>http://www.softimageblog.com/archives/71#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=render-passes-in-behavior</link>
		<comments>http://www.softimageblog.com/archives/71#comments</comments>
		<pubDate>Wed, 07 Dec 2005 01:14:12 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>
		<category><![CDATA[Behavior]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=71</guid>
		<description><![CDATA[I&#8217;m currently winding down on this Behavior project that has been making me loose sleep. I&#8217;m at the stage where I need to create my data for my multiple render passes&#8230;.
Warning: If you&#8217;ve never used Behavior before or don&#8217;t care for crowd sim, skip this one. If you care for a stupid Behavior trick&#8230; Read [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently winding down on this Behavior project that has been making me loose sleep. I&#8217;m at the stage where I need to create my data for my multiple render passes&#8230;.</p>
<p><strong>Warning</strong>: If you&#8217;ve never used Behavior before or don&#8217;t care for crowd sim, skip this one. If you care for a stupid Behavior trick&#8230; Read on&#8230;</p>
<p>Behavior has a rendering pipeline that involves spewing a bunch of files into a directory and rendering them out with a nifty geometry shader and Mental Ray. Thing is, you have to run a simulation for every render pass you have. This means, you don&#8217;t have a choice but to cache your actor&#8217;s motion data in a first pass and then simulate all your other passes using the cache to output your .mi2 files.</p>
<p>When I did all this I wound up with characters that wouldn&#8217;t render at <em>exactly</em> the same spot from pass to pass even if I had used a caching mechanism. We&#8217;re talking pixels here but it was enough to show&#8230;</p>
<p>Ever notice all those .mrd files Behavior creates along with your .mi2 files? They contain your actor positions for every frame of your simulation. To get my passes properly aligned I just copied all the .mrd files from the output directory of one simulation into the output directory of another and voila!</p>
<p>I&#8217;m wondering if this is just a cosmic fluke that should be chaulked up to planetary alignment or if it&#8217;s a legal Behavior move but&#8230; It just saved my butt!</p>
<p>Carry on!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=71&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/71/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Parameters Units Missing.</title>
		<link>http://www.softimageblog.com/archives/66#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=parameters-units-missing</link>
		<comments>http://www.softimageblog.com/archives/66#comments</comments>
		<pubDate>Tue, 29 Nov 2005 15:30:10 +0000</pubDate>
		<dc:creator>Francois Lord</dc:creator>
				<category><![CDATA[Bablings and Ramblings]]></category>
		<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Simulation]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=66</guid>
		<description><![CDATA[A whole lot of time can be wasted by tweeking a parameter in XSI when you don&#8217;t know the units it&#8217;s expressed in. This is especially true in simulation.
Simulations
You can deduce the units of a parameter rapidly with only a few tries. The Age of a particle is expressed in seconds, not frames. The Size [...]]]></description>
			<content:encoded><![CDATA[<p>A whole lot of time can be wasted by tweeking a parameter in XSI when you don&#8217;t know the units it&#8217;s expressed in. This is especially true in simulation.</p>
<p><strong>Simulations</strong></p>
<p>You can deduce the units of a parameter rapidly with only a few tries. The Age of a particle is expressed in seconds, not frames. The Size of  a particle is in scene units, not pixels. Starting from that, we can assume that the Rotation Velocity is in degrees per seconds, not degrees per frame, and that the Allowed Linear Velocity is expressed in units per seconds.</p>
<p>Things get a little more tricky when you want to animate a parameter according to the age of a particle. The key you set at frame 50 doesn&#8217;t mean 50 seconds, but 50 frames. This is not consistent with the other examples stated above, but it&#8217;&#8217;s a lot easier to figure by yourself as it&#8217;s more intuitive.</p>
<p>For a rigid body object, the help file says the Linear Velocity Limit is in units. Of course, experimentation shows it&#8217;s in units per seconds. Setting the Angular Velocity Limit is awkward. The help file says the value is expressed in radians. Experimentation suggests it&#8217;s in degrees per 2 seconds!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">CreatePrim <span style="color: #800000;">&quot;Cube&quot;</span>, <span style="color: #800000;">&quot;MeshSurface&quot;</span>
CreateActiveRigidBody <span style="color: #800000;">&quot;cube&quot;</span>
SetValue <span style="color: #800000;">&quot;cube.DynamicsInitState.angvelz&quot;</span>, 90
SetValue <span style="color: #800000;">&quot;cube.RigidBodyProp.VelLimitsActive&quot;</span>, <span style="color: #000080;">True</span>
SetValue <span style="color: #800000;">&quot;cube.RigidBodyProp.AngVelLimit&quot;</span>, 60
SetValue <span style="color: #800000;">&quot;PlayControl.Format&quot;</span>, 7
SetValue <span style="color: #800000;">&quot;PlayControl.Out&quot;</span>, 25
PlayForwardsFromStart</pre></td></tr></table></div>

<p>After one second of simulation, the rotation is roughly half of the Angular Velocity Limit. </p>
<p><span id="more-66"></span><strong>Displacement</strong></p>
<p>Rendering parameters can also cause a considerable amount of confusion. Displacement and Final Gathering both have parameters that can be switched between absolute and camera view reference. In the Displacement tab of the GeoApprox PPG of an object, when set to Fine, there is a parameter called Length. This parameter is expressed in scene units. Mental ray will try to keep the triangles no bigger than Length. You must adjust this parameter to the scale of your object or scene. The render time can go through the roof if you activate View Dependent without modifying the value of Length because its units have changed. It&#8217;s now expressed in pixels, making the size of the triangles dependent on the distance to the camera, and in this case, smaller than half a pixel by default. </p>
<p><strong>Final Gathering</strong></p>
<p>The same goes for the Min and Max Radius in the Final Gathering tab of the Render Options PPG. Their values are normally expressed in scene units. When you click on the Automatic Compute button, XSI calculates the average bounding box size of all the objects in the scene in scene units and sets the two parameters accordingly. However, when you activate the View Dependent check box, the values of the radius are now in pixels. If you click on the Automatic Compute button, it will still calculate the values in scene units, and set the wrong values in the parameters, possibly increasing render time considerably and unnecessarily. </p>
<p><strong>Volume Effects</strong></p>
<p>I&#8217;ve seen many artists having problems with the Volume Effects shader. This is a fine shader even if it hasn&#8217;t evolved a lot since its early days in Soft|3D. It has a parameter called Step Size, which controls the spatial resolution of the marching algorithm. It&#8217;s expressed in scene units so it is very dependent on the scene scale. Applying this shader on a pass in a very big scene can lead to nightmares in terms of rendering time. It&#8217;s important to understand this parameter when using the Volume Effects shader, and the fact that its units are in scene units scaled by the size of the object it&#8217;s applied on. If you apply it to a scaled up cube (scaling = 100, 100, 100), the Step Size will be expressed in scene units * 100. </p>
<p><strong>Depth of Field</strong></p>
<p>The Depth of Field Shader is particular. Many of its parameters names say they are in inches, when in fact they are in scene units. I suppose the developer wanted us to use a scene scale of 1 unit = 1 inch to make sure the result would match reality. I don&#8217;t think this was a very good idea. It confuses more than anything. </p>
<p>I wish Softimage could add some space or some tooltips in PPGs to display the units. It would help the users determine the best values for certain parameters without having to go in the documentation all the time. In the mean time, experimentation is still our best resource. </p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=66&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/66/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
