<?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; General</title>
	<atom:link href="http://www.softimageblog.com/archives/category/general/feed" rel="self" type="application/rss+xml" />
	<link>http://www.softimageblog.com</link>
	<description>People and thoughts behind Softimage in production...</description>
	<lastBuildDate>Wed, 23 Nov 2011 18:48:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Disconnecting Shaders</title>
		<link>http://www.softimageblog.com/archives/590</link>
		<comments>http://www.softimageblog.com/archives/590#comments</comments>
		<pubDate>Thu, 24 Mar 2011 20:03:23 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.softimageblog.com/?p=590</guid>
		<description><![CDATA[I rarely talk about short lived timely issues such as this one but it was a bit too pervasive to pass up and the facility here has just been bitten by it. I&#8217;m talking about spontaneously disconnecting shaders. Background info (read these): The issue as described in a thread on the mailing list. A workaround [...]]]></description>
			<content:encoded><![CDATA[<p>I rarely talk about short lived timely issues such as this one but it was a bit too pervasive to pass up and the facility here has just been bitten by it.</p>
<p>I&#8217;m talking about spontaneously disconnecting shaders.</p>
<p>Background info (read these):</p>
<ul>
<li>The issue as described in a <a href="https://groups.google.com/d/topic/xsi_list/zTYf8JvQfhk/discussion">thread on the mailing list</a>.</li>
<li>A workaround as described by <a href="http://xsisupport.wordpress.com/2011/03/12/using-dotxsi-to-clean-up-a-material-library/">eX-SI Support</a></li>
</ul>
<p>The following script partly automates the solution described by eX-SI Support so if you have many libs it almost eliminates human error. It seems to have worked for us so far as a preemptive measure before scenes break or after having spent too much time fixing a scene. Import an asset, material preset or fix a broken scene, go through the hoops. This is <em>not</em> fun but until there is an official fix, we&#8217;re kinda stuck.</p>
<p>Run <code>Application.MatLibFixStep1()</code> which will convert material libraries to external references, prompt you to save the scene and quit Softimage.</p>
<p>Restart Softimage, open the scene you saved previously and run <code>Application.MatLibFixStep2()</code> which will reconvert the material libraries to internal storage.</p>
<p><script src="https://gist.github.com/885737.js?file=MatLibFix.py"></script></p>
<p>Jean-Sebastien&#8217;s workaround is also worth investigating if the above doesn&#8217;t work for you (see the Softimage mailing list thread linked above).</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=590&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/590/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simulated Shapes in Momentum 2.0</title>
		<link>http://www.softimageblog.com/archives/564</link>
		<comments>http://www.softimageblog.com/archives/564#comments</comments>
		<pubDate>Mon, 21 Mar 2011 18:18:26 +0000</pubDate>
		<dc:creator>Helge Mathee</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ICE]]></category>
		<category><![CDATA[Simulation]]></category>

		<guid isPermaLink="false">http://www.softimageblog.com/?p=564</guid>
		<description><![CDATA[Driving rigid bodies' shapes with simulated deformation opens up a whole new set of possibilities!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.exocortex.com/simulation/momentum" target="_blank">Momentum 2.0</a>,  Exocortex&#8217;s new multi-physics system, an integration of the well-known Bullet physics engine for Autodesk&#8217;s Softimage, provides a bunch of features that are not totally obvious at first.</p>
<p><a href="http://www.softimageblog.com/userContent/upload/2011/03/capture096.jpg"><img class="aligncenter size-medium wp-image-587" src="http://www.softimageblog.com/userContent/upload/2011/03/capture096-300x200.jpg" alt="" width="300" height="200" /></a></p>
<p>One of the clients showed me a pretty cool use of the geometry stack in conjunction with Momentum&#8217;s DeformRigidBody operator. This operator is able to treat every polygon-island inside a polygonmesh as a separate rigid body, and, since it is connected to the geometry stack, is able to keep the shape of the rigid bodies in sync with the deformation happening below. This way you can create animated shapes, and have them influence the rigid body simulation in Bullet.</p>
<p><span id="more-564"></span></p>
<p>While I implemented this feature, I was not aware of all of the possible uses, of course. Since the interactive creative environment has been introduced into Softimage, the possibilities are endless, and it is very hard to imagine what users will come up with once additions to ICE are released into the community.</p>
<p>The client, who had to deal with a very complex effect for a commercial, used Momentum just for the rigid body simulation, while the deformation was done through ICE. What&#8217;s interesting here is that he is simulating the deformation using a turbulence method, and driving the rigid body engine with this deform.</p>
<p><a href="http://www.softimageblog.com/userContent/upload/2011/03/icetree.jpg"><img class="alignnone size-large wp-image-567" src="http://www.softimageblog.com/userContent/upload/2011/03/icetree-1024x339.jpg" alt="" width="819" height="271" /></a></p>
<p>By offering small building blocks that work well together with ICE, or even integrate into ICE as compounds, Momentum 2.0 opens a whole new world of possibilities for simulation. Goal-based simulation and user driven results are in reach. What thrills me the most though, is to see unexpected setups like this one. The community&#8217;s amount of creativity really produces so much inspiration for developers like myself.</p>
<p>I will continue to talk about techniques and tricks with Momentum on this blog, and try to contribute users&#8217; experiences and solutions.</p>
<p>Here&#8217;s a capture of the effect:</p>
<p><a href="http://www.softimageblog.com/archives/564"><em>Click here to view the embedded video.</em></a></p>
<p>Here&#8217;s a link to Momentum 2.0 product page:</p>
<p><a href="http://www.exocortex.com/simulation/momentum">http://www.exocortex.com/simulation/momentum</a></p>
<p>We have posted a series of other videos, including tutorials, trailers etc on vimeo, you can find them in our Momentum group:</p>
<p><a href="http://vimeo.com/groups/exocortexmomentum">http://vimeo.com/groups/exocortexmomentum</a></p>
<p>This is a good place to stay up to date on new releases and latest information.</p>
<p>Please let me know what you think, I like to be intrigued for other topics and solutions for complex effects.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=564&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/564/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Work-Around to Problems with Tablets and Softimage</title>
		<link>http://www.softimageblog.com/archives/546</link>
		<comments>http://www.softimageblog.com/archives/546#comments</comments>
		<pubDate>Fri, 11 Mar 2011 21:35:09 +0000</pubDate>
		<dc:creator>Luc-Eric</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.softimageblog.com/?p=546</guid>
		<description><![CDATA[[Note: this problem no longer applies to Softimage 2011 SP1 and later version] There is a strange user interface lag that affects Softimage XSI when you use a Wacom tablet. With heavy scenes or simulation, you may never be able to stop playback. Other users have reported problems with the render region. The best work-around [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em>[Note: this problem no longer applies to Softimage 2011 SP1 and later version]</em></strong></p>
<p>There is a strange user interface lag that affects Softimage XSI when you use a Wacom tablet. With heavy scenes or simulation, you may never be able to stop playback. Other users have reported problems with the render region.</p>
<p>The best work-around is to disable tablet support in Softimage (any version).   This will not affect any other program.</p>
<p>To do this, start a  &#8220;Command Prompt&#8221; using the link in the Autodesk Softimage Start menu group.  If you are running under Vista or Windows 7, it&#8217;s best to run it as an administrator.</p>
<p>A command prompt will will start in the &#8216;bin&#8217; directory of the application.  Type this command:</p>
<pre>C:\Program Files\Autodesk\Softimage 2011\Application\bin&gt; <span style="color: #0000ff">copy xsi.bat wintab32.dll</span></pre>
<p>And re-launch the Softimage.  You should now be fine.</p>
<p>The only place Softimage uses the tablet is for pen pressure in Weight Painting and in the compositor, and it doesn&#8217;t work very well anyway. To restore tablet support, simply delete wintab32.dll from the bin directory from that command prompt.</p>
<p><strong>Softimage 2011 SP1 and Later</strong></p>
<p>Table pressure support is now disabled by default in new versions of Softimage, eliminating this problem.  If you want to renable it, you need to set the environment variable</p>
<p>XSI_ENABLE_WINTAB_SUPPORT=1</p>
<p>There are few  benefits to doing this; the pen pressure is only used in Weight Painting (where it is a bit  hard to control) and painting in the paint node compositor. You pen tablet will probably work better if you don&#8217;t mess around with this.</p>
<p><strong>Linux</strong></p>
<p>There is no support in Softimage for pen tablet on Linux and therefore no known problems with it.</p>
<p>&nbsp;</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=546&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/546/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sixbirds PixelParticles 1.0</title>
		<link>http://www.softimageblog.com/archives/492</link>
		<comments>http://www.softimageblog.com/archives/492#comments</comments>
		<pubDate>Wed, 03 Mar 2010 19:36:35 +0000</pubDate>
		<dc:creator>Helge Mathee</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=492</guid>
		<description><![CDATA[Hey folks, time to release another plugin under the flag of Sixbirds Barcelona! As already shown in a teaser video on vimeo.com, we worked on a plugin to use particles as pixels to unleash the power of ICE to textures. This plugin requires Autodesk Softimage 2010 SP1, Windows 32, 64 or Linux 64 bit. Provided [...]]]></description>
			<content:encoded><![CDATA[<p>Hey folks,</p>
<p>time to release another plugin under the flag of Sixbirds Barcelona!</p>
<p>As already shown in a teaser video on vimeo.com, we worked on a plugin to use particles as pixels to unleash the power of ICE to textures.</p>
<p><span id="more-492"></span>This plugin requires Autodesk Softimage 2010 SP1, Windows 32, 64 or Linux 64 bit.</p>
<p>Provided in the plugin is a C++ operator, a custom ICE-Node, some compounds to drive the pixels as well as a sample project.</p>
<p>So what does it do? Let&#8217;s have a look:</p>
[There is a video that cannot be displayed in this feed. <a href="http://www.softimageblog.com/archives/492">Visit the blog entry to see the video.]</a>
<p>Thanks to Steven Caron for food for thoughts, thanks to all of the beta-testers!</p>
<p>Once again I am proud and happy that the company I work for is enabling me to publish these tools under GPL, so source-code is included!</p>
<p>Please comment, let me know what you think.</p>
<p>Here&#8217;s the download link:</p>
<p><a title="http://www.sixbirds.com/development/sixbirds_pixelparticles.2010_SP1_1.0.xsiaddon.zip" href="http://www.sixbirds.com/development/sixbirds_pixelparticles.2010_SP1_1.0.xsiaddon.zip">http://www.sixbirds.com/development/sixbirds_pixelparticles.2010_SP1_1.0.xsiaddon.zip</a></p>
<p>Later!</p>
<p>Helge @ Sixbirds Barcelona</p>
<p>PS: I noticed during the beta-phase of the plugin that is it fairly easy to create a basic feather system with this setup, I demonstrate this in the vimeo video also. How ironic! :)</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=492&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/492/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Sixbirds Rigging Solvers (UPDATE V1.3)</title>
		<link>http://www.softimageblog.com/archives/426</link>
		<comments>http://www.softimageblog.com/archives/426#comments</comments>
		<pubDate>Tue, 19 Jan 2010 14:58:41 +0000</pubDate>
		<dc:creator>Helge Mathee</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=426</guid>
		<description><![CDATA[Hey folks! Edit: I upgraded the addon to version 1.3, see the 13th solver for new description of the Nulls 2 Nurbssurface. Additionally I fixed two bugs and removed some nasty logmessages from the Null 2 Curve solver. Some solvers are NOT compatible with the version 1.3, so I will keep the link to the [...]]]></description>
			<content:encoded><![CDATA[<p>Hey folks!</p>
<p>Edit: I upgraded the addon to version 1.3, see the 13th solver for new description of the Nulls 2 Nurbssurface. Additionally I fixed two bugs and removed some nasty logmessages from the Null 2 Curve solver. Some solvers are NOT compatible with the version 1.3, so I will keep the link to the previous versions around.</p>
<p>So finally after a good first round here at Sixbirds in Spain we decided to release some of the tools we are using for production to the community. At this point we are sharing our rigging solvers, a collection of custom operators for &#8220;solving&#8221; certain equations, like IK, Bezier projection, curve lookup etc. The collection includes 12 different solvers. Please have a look at this video, which gives you a quick runover of the technology&#8230;</p>
<p><span id="more-426"></span><br />
[There is a video that cannot be displayed in this feed. <a href="http://www.softimageblog.com/archives/426">Visit the blog entry to see the video.]</a></p>
<p>Requirements: Softimage 2010 SP1, Windows 32, 64 or Linux 64 with installed Python 2.52 or higher. For installing python see<br />
<a title="Python Install" href="http://softimage.wiki.softimage.com/index.php/Python#Installation">http://softimage.wiki.softimage.com/index.php/Python#Installation</a></p>
<p>The addon also includes a very handy custom command, called &#8220;sixbirds_rigging_inspect_op&#8221;, which allows you to look at the settings of the solvers without having to dig for them in the explorer. I usually map this command to F4, since I don&#8217;t use the F4 UI Slider feature all that much. Furthermore the addon provides a simple toolbar to apply all of these solvers, and adds a new simple &#8220;bone&#8221; primitive to the Get-&gt;Primitive menu, which is handy when creating custom IK chains. Also the addon will come with a sample project, one scene for each solver demonstrating the features.<br />
The addon is provided under the GPL license, without warranty, and, as we like to say in R&amp;D: As is. Please don&#8217;t ask for fixes or further features at this point, we don&#8217;t have the resources.</p>
<p>All of the solvers are applied by selecting objects in a particular order and creating the solver. I want to quickly summarize these selection orders so you can properly use the addon.</p>
<p>One note: All solvers use X as their main axis. This decision was made since the Softimage Bone primitive uses X as the axis along the bone. So all other solvers use this axis as well. This means, for example, that you will have to rotate controllers or the spline solvers or the squash and stretch for example, if you want the spline to point along Y.</p>
<p>1. SRT Spring<br />
This is a solver which is able to simulate a simple transform based spring. You can select the channels you want to use for simulation (scaling, rotation and/or translation). To apply this solver just select any 3d object and it will create a null as a child of this object with the solver applied.</p>
<p>2. Direction Spring<br />
The direction spring solver simulates a spring which is driven by a global direction, not an orientation. Just select any 3d object and it will create a bone as a child, with the solver applied. To see the difference between the SRT Spring and the Direction Spring just play with it or have a look at the sample scenes.</p>
<p>3. IK 2 Bone<br />
This solver can calculate one of the different outputs of a typical IK chain, but also provides soft stretching and some more features like inverting the solve etc. To use this solver, please select a) the root, b) the effector, c) the upvector and d) the output object. This solver does not create 3d object by itself, so if you want to apply to a bone you will have to create a single bone first (Get-&gt;Primitive-&gt;Bone). The solver also creates a property on the root object to drive all output objects (if you create more than one) in a central place.</p>
<p>4. IK FK 2 Bone<br />
This solver has the most complicated selection order of all solvers provided in the addon. To apply it you nee to select a) The root, b) the IK effector, c) the IK upvector, d) the FK first bone, e) the FK second bone, f) the FK effector (wrist for ex) and g) the output object. This solver, like the IK 2 Bone, does not create output objects itself. This solver also creates a centralized property on the root object.</p>
<p>5. Simple Spline<br />
This solver calculates a transform on a piece-wise-bezier defined by as many 3d objects as you want. The tangent of the bezier are the local X axis of the 3d objects driving the solver. To apply it simply select at least 2 objects (or more) an apply the solver. This solver creates a null as a child object of the first controller. The Simple Spline also creates a property on the first controller, to drive all created output objects in a central place.</p>
<p>6. Rolling Spline<br />
This solver calculates the same bezier transform, but requires a secondary layer of controls to allow for continuous rolling along the spline. For using this solver you need to have a two level hierarchy (like parent_ctrl -&gt; child_ctrl) or at least two controllers. Please select the child controllers ( at least 2 ) and apply the solver. It will create a null as a child of the first selected controller. Please have a look at the sample scene to get a better idea. The rolling spline, as the simple spline, creates a centralized property on the first controller.</p>
<p>7. 4 Point Surface<br />
This solver computes a transform on a iso surface build by 2D bezier curves. These curves are defined by 4 controllers (the corners of the iso surface). To use this solver select 4 objects, it will create a null object as a child of the first corner object.</p>
<p>8. Interpolated Pose<br />
The interpolated pose solver calculates a pose in between two other poses. To use it simply select two 3d objects and apply the solver, it will create a null as a child of the first selected object.</p>
<p>9. Squash and Stretch<br />
This solver can calculate a scaled output transform based on the distance of two objects. The scaling for this effect is done along Y and Z. To apply the solver, select the first object of the distance calculation (hip, for example), the second one (chest) and the parent object for the new null. This can be for example a vertebra on the spine.</p>
<p>10. Null 2 Curve<br />
This solver projects  an object onto a curve. This is useful for facial rigging and for anything that has to travel on a path, while being driver by a visual controller. To use this solver select a) the driver ctrl, b) the upvector ctrl, c) the input curve) and (optionally) d) the output curve. The solver will create a null as a child of the output curve (or the input curve if you just had one curve selected).</p>
<p>11. Curve Sliding<br />
This solver reprojects a curve along itself while maintaining the length. This is useful for keeping the length on a curve, even it is deformed. To use this solver, just select one curve and apply it. If you want to use the sliding on top of enveloping, for example, ensure you have the animation construction mode selected before applying it.</p>
<p>12. Curve Collision<br />
This solver does a simple collision with soft distance of a curve to a nurbs surface. This is useful for having curve being pushed by a teeth proxy in a facial rig, for example. You can use this solver in conjunction with the curve sliding solver. To use it, select a) a curve and b) a nurbs surface. Ensure that the surface is closed, please test with a nurbs sphere first. The collision object is supposed to be really, really simply to give you good feedback.</p>
<p>13. Null 2 Surface<br />
This solver projects  an object onto a nurbssurface. This is useful for facial rigging and for anything that has to travel on a surface, while being driver by a visual controller. To use this solver select a) the driver ctrl, b) the upvector ctrl, c) the input surface) and (optionally) d) the output surface. The solver will create a null as a child of the output surface (or the input surface if you just had one curve selected). The solver uses a relative mapping, similar to a pen table (tablet space to screen space). Feel free to post questions if you need additional assistance.</p>
<p>Ok, after all of this information let&#8217;s have a look at a second video, in which I will go over each solver, reapplying it and test-driving it.</p>
[There is a video that cannot be displayed in this feed. <a href="http://www.softimageblog.com/archives/426">Visit the blog entry to see the video.]</a>
<p>I hope you all enjoy the videos and find something useful in them. We are trying to design more tools in a way that they are easy to share, and we at Sixbirds want to follow that move of being able to publish more production tools.</p>
<p>Please let us know what you think at</p>
<p>development (at) sixbirds.com</p>
<p>Or feel free to post comments here at XSI-BLOG.</p>
<p>Last but not least: Thanks to all of the other providers of free software / plugins and the helpful Softimage Community!</p>
<p>There you go!</p>
<p><a title="sixbirds_rigging_solvers.2010.SP1_1.3.xsiaddon.zip" href="http://www.sixbirds.com/development/sixbirds_rigging_solvers.2010.SP1_1.3.xsiaddon.zip">http://www.sixbirds.com/development/sixbirds_rigging_solvers.2010.SP1_1.3.xsiaddon.zip</a></p>
<p>(older versions:)</p>
<p><a title="sixbirds_rigging_solvers.2010.SP1_1.1.xsiaddon.zip" href="http://www.sixbirds.com/development/sixbirds_rigging_solvers.2010.SP1_1.1.xsiaddon.zip">http://www.sixbirds.com/development/sixbirds_rigging_solvers.2010.SP1_1.1.xsiaddon.zip</a></p>
<p>Best!</p>
<p>Miquel &amp; Helge @ Sixbirds</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=426&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/426/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Decorating your Python code</title>
		<link>http://www.softimageblog.com/archives/357</link>
		<comments>http://www.softimageblog.com/archives/357#comments</comments>
		<pubDate>Sat, 11 Oct 2008 03:16:25 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=357</guid>
		<description><![CDATA[I have touched on Python decorators in the past in this article (although that decorator was a bit convoluted). Decorators can be extremely useful in many situations and here are a few that I propose may help streamline script development. Note: For those of you who would like a bit of background information on decorators [...]]]></description>
			<content:encoded><![CDATA[<p>I have touched on Python decorators in the past in <a href="http://www.xsi-blog.com/archives/265">this article</a> (although that decorator was a bit convoluted). Decorators can be extremely useful in many situations and here are a few that I propose may help streamline script development.</p>
<p>Note: For those of you who would like a bit of background information on decorators you can <a href="http://www.python.org/dev/peps/pep-0318/">check out this page</a>.</p>
<p><b>Keeping things quiet</b></p>
<p>Let&#8217;s look at the code and we&#8217;ll go for a few explanations afterward.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> suspendXSILogging<span style="color: black;">&#40;</span>func<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> closure<span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
        logPrefs = getXSILoggingPrefs<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            ret = func<span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>, e:
            setXSILoggingPrefs<span style="color: black;">&#40;</span>logPrefs<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">raise</span>
        setXSILoggingPrefs<span style="color: black;">&#40;</span>logPrefs<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> ret
    <span style="color: #ff7700;font-weight:bold;">return</span> closure</pre></td></tr></table></div>

<p>The first function <code>suspendXSILogging</code> can be used as a decorator and will disable all logging features of XSI. This has the advantage of making large scripts that may be command dependent a bit quicker.</p>
<p>You could always implement a plugin with a custom command but sometimes a script is simpler. Even in the command context this decorator could be useful if you wanted part of the command to log to the script editor while keeping other parts silent.</p>
<p>Another advantage of this decorator is that it puts your original function in a large trap that, if an error should occur, will make sure that logging is reset to the users original preferences.</p>
<p><b>Time for decorating</b></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;">def</span> timeExecution<span style="color: black;">&#40;</span>func<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> closure<span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
        startTime = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            ret = func<span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>, e:
            delta = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - startTime
            log.<span style="color: black;">error</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Failed in %f seconds'</span> <span style="color: #66cc66;">%</span> delta<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">raise</span>
        delta = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - startTime
        log.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Finished in %f seconds'</span> <span style="color: #66cc66;">%</span> delta<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> ret
    <span style="color: #ff7700;font-weight:bold;">return</span> closure</pre></td></tr></table></div>

<p>This second function, timeExecution, can decorate almost any function and will print to the script editor the amount of time the decorated function took to execute. This can be used as a debugging or performance tracking tool or as a way to provide feedback to your users. Again, a trap is implemented that will log execution time even if an error occurs.</p>
<p>Please not that this decorator uses a <a href="http://www.xsi-blog.com/archives/348">logging system described here</a>. If you would rather use simple logging you should replace <code>log.info(</code> instances by <code>log(</code>, <code>xsi.LogMessage(</code> or <code>Application.LogMessage(</code> depending on your scripting habits.</p>
<p><b>Usage example</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">@timeExecution
@suspendXSILogging
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;"># Do some fun useful stuff - well... more useful than this!</span>
    xsi.<span style="color: black;">CreatePrim</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Cube&quot;</span>, <span style="color: #483d8b;">&quot;MeshSurface&quot;</span>, <span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>You can chain decorators without hesitation like in this example, one thing to note in this particular case is that you&#8217;ll want <code>timeExecution</code> higher in the decorator chain than <code>suspendXSILogging</code> otherwise the time information will never make it to the script editor. Duh!</p>
<p><b>Support code</b></p>
<p>Before I sign off on this latest article, here are two functions that, if useful on their own, are essential to the functioning of the suspendXSILogging decorator.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> getXSILoggingPrefs<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    prefs = xsi.<span style="color: black;">Preferences</span>
    vals = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> n <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'scripting.cmdlog'</span>, <span style="color: #483d8b;">'scripting.msglog'</span>, <span style="color: #483d8b;">'scripting.msglogverbose'</span><span style="color: black;">&#93;</span>:
        vals<span style="color: black;">&#91;</span>n<span style="color: black;">&#93;</span> = prefs.<span style="color: black;">GetPreferenceValue</span><span style="color: black;">&#40;</span>n<span style="color: black;">&#41;</span>
        prefs.<span style="color: black;">SetPreferenceValue</span><span style="color: black;">&#40;</span>n, <span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> vals
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> setXSILoggingPrefs<span style="color: black;">&#40;</span>vals<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">for</span> key, val <span style="color: #ff7700;font-weight:bold;">in</span> vals.<span style="color: black;">iteritems</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
        xsi.<span style="color: black;">Preferences</span>.<span style="color: black;">SetPreferenceValue</span><span style="color: black;">&#40;</span>key, val<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Cheers!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=357&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/357/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Logging and being proactive</title>
		<link>http://www.softimageblog.com/archives/348</link>
		<comments>http://www.softimageblog.com/archives/348#comments</comments>
		<pubDate>Sun, 05 Oct 2008 04:37:57 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=348</guid>
		<description><![CDATA[You write tools for artists under a deadline (yours and theirs). You live in a production oriented world. Unit testing, beta testing and anticipating can only go so far, and that is only if you have time to properly test. You have to accept that eventually, your code will break. How it breaks and how [...]]]></description>
			<content:encoded><![CDATA[<p>You write tools for artists under a deadline (yours and theirs). You live in a production oriented world. Unit testing, beta testing and anticipating can only go so far, and that is only if you have time to properly test. You have to accept that eventually, your code will break. How it breaks and how you react to such a break becomes as important as your capacity to create the tool in the first place.</p>
<p>You&#8217;ve probably seen the following idiom used many times on this website and in other places that do XSI scripting in Python:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><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 = Application
log = xsi.<span style="color: black;">LogMessage</span></pre></td></tr></table></div>

<p>It is a shortcut that allows you to use log as if it was the native LogMessage call:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">log<span style="color: black;">&#40;</span><span style="color: #483d8b;">'This is an info message.'</span>, c.<span style="color: black;">siInfo</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Here is a way to extend this by using the standard logging module in a way that can help you be more proactive. I suggest you get familiar with the <a href="http://docs.python.org/library/logging.html">logging module</a> from the standard <a href="http://docs.python.org">Python docs</a>, it&#8217;s bound to eventually be helpful.</p>
<p><strong>Logging in XSI</strong></p>
<p>Here is a construct I&#8217;ve started using lately that I am starting to enjoy, its advantages are:</p>
<ul>
<li>Concise and self documenting</li>
<li>It has a trap to catch any unexpected error and log it</li>
<li>Logs both to the script editor and to file</li>
<li>Easily extensible to other logging mechanisms (email, event viewer)</li>
<li>You can pass non string messages and it will convert to string for you (Yay!)</li>
<li>Easily useable in scripts and other modules</li>
</ul>

<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;">from</span> hookolo.<span style="color: black;">xsi</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	log.<span style="color: black;">comment</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'comment'</span><span style="color: black;">&#41;</span>
	log.<span style="color: black;">debug</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'debug'</span><span style="color: black;">&#41;</span>
	log.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'info'</span><span style="color: black;">&#41;</span>
	log.<span style="color: black;">warning</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'warning'</span><span style="color: black;">&#41;</span>
	log.<span style="color: black;">error</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'error'</span><span style="color: black;">&#41;</span>
	log.<span style="color: black;">fatal</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'fatal'</span><span style="color: black;">&#41;</span>
	log.<span style="color: black;">critical</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'critical'</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">Exception</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Totally unexpected exception!'</span><span style="color: black;">&#41;</span>
&nbsp;
run<span style="color: black;">&#40;</span><span style="color: #483d8b;">'demoScript'</span>, main<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>The code above would produce the following output in XSI&#8217;s script editor.</p>
<pre># comment
# VERBOSE : debug
# INFO : info
# WARNING : warning
# ERROR : error
# ERROR : fatal
# FATAL : critical
# ERROR : Trap reached in demoScript
# Traceback (most recent call last):
#   File "C:\hookolo\libs\hookolo\xsi\__init__.py", line 18, in run
#     func(*args, **kwargs)
#   File "&lt;script Block &gt;", line 11, in main
# Exception: Totally unexpected exception!
# ERROR : Traceback (most recent call last):
#   File "&lt;script Block &gt;", line 13, in &lt;module&gt;
#     run('demoScript', main)
#   File "C:\hookolo\libs\hookolo\xsi\__init__.py", line 21, in run
#     raise StopScriptError('Check the logs!')
# StopScriptError: Check the logs!
#  - [line 13]</pre>
<p>The calls to log.comment, log.debug, log.info, log.warning, log.error and log.critical are all self explanatory as they are all equivalent to LogMessage calls with the appropriate severity argument. The call log.fatal is an addition of my own who&#8217;s severity is equivalent or just a tiny bit lower than critical. Fatal errors will not pop a dialog box.</p>
<p>In the setup I have here, both fatal and critical, will be logged to a file in the users&#8217; XSI_HOME directory that looks like follows.</p>
<pre>2008-10-04 23:46:13,720 - hookolo.xsi - FATAL - fatal
2008-10-04 23:46:13,720 - hookolo.xsi - CRITICAL - critical
2008-10-04 23:46:13,720 - hookolo.xsi - FATAL - Trap reached in demoScript
Traceback (most recent call last):
  File "C:\hookolo\libs\hookolo\xsi\__init__.py", line 18, in run
    func(*args, **kwargs)
  File "&lt;script Block &gt;", line 11, in main
Exception: Totally unexpected exception!</pre>
<p>By having a file like this, I don&#8217;t have to wade through XSI&#8217;s scripting log as I have a file that only includes important script errors. I also don&#8217;t have to worry about a user coming to me and saying: &#8220;Your script exploded.&#8221; Followed by the inevitable: &#8220;No, I don&#8217;t remember the error and I don&#8217;t have it in my scripting window anymore.&#8221; Now I can just open up this file from their XSI_HOME directory and look for myself.</p>
<p>The usage of a main() function and a run() function allows to build a trap for any unexpected errors that might occur and allow for logging. By putting the runner in a library we can benefit from it with very little hassle in even the tiniest of scripts.</p>
<p><strong>Pushing the envelope</strong></p>
<p>A system such as this one could even easily be extended to allow for sending of fatal and critical errors via email. You would know that a script failed even before the artist had walked the corridor to your office to tell you about the failure. This extension wouldn&#8217;t even be that hard as the logging module includes an SMTPHandler for just this purpose.</p>
<p><strong>Support code</strong></p>
<p>Here is the library that makes this all possible.</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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
</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;">logging</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">types</span>
&nbsp;
<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
<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> Dispatch
&nbsp;
__all__ = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'xsi'</span>, <span style="color: #483d8b;">'log'</span>, <span style="color: #483d8b;">'c'</span>, <span style="color: #483d8b;">'run'</span>, <span style="color: #483d8b;">'XSIError'</span><span style="color: black;">&#93;</span>
&nbsp;
COMPANY_NAME = <span style="color: #483d8b;">'Hookolo'</span>
COMPANY_PREFIX = <span style="color: #483d8b;">'hookolo'</span>
&nbsp;
xsi = Dispatch<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>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> run<span style="color: black;">&#40;</span>scriptName, func, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">try</span>:
		func<span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">except</span>:
		log.<span style="color: black;">log</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">45</span>, <span style="color: #483d8b;">'Trap reached in %s'</span> <span style="color: #66cc66;">%</span> scriptName, exc_info=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
		<span style="color: #ff7700;font-weight:bold;">raise</span> StopScriptError<span style="color: black;">&#40;</span><span style="color: #483d8b;">'Check the logs!'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> XSILogger<span style="color: black;">&#40;</span><span style="color: #dc143c;">logging</span>.<span style="color: black;">Logger</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">def</span> fatal<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, msg, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
		<span style="color: #008000;">self</span>.<span style="color: black;">log</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">45</span>, msg, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">def</span> comment<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, msg, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
		<span style="color: #008000;">self</span>.<span style="color: black;">log</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">5</span>, msg, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> XSIHandler<span style="color: black;">&#40;</span><span style="color: #dc143c;">logging</span>.<span style="color: black;">Handler</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">def</span> emit<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, record<span style="color: black;">&#41;</span>:
		<span style="color: #ff7700;font-weight:bold;">if</span> record.<span style="color: black;">levelno</span> == <span style="color: #dc143c;">logging</span>.<span style="color: black;">CRITICAL</span>:
			xsiLvl = c.<span style="color: black;">siFatal</span>
		<span style="color: #ff7700;font-weight:bold;">elif</span> record.<span style="color: black;">levelno</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#91;</span><span style="color: #dc143c;">logging</span>.<span style="color: black;">ERROR</span>, <span style="color: #ff4500;">45</span><span style="color: black;">&#93;</span>:
			xsiLvl = c.<span style="color: black;">siError</span>
		<span style="color: #ff7700;font-weight:bold;">elif</span> record.<span style="color: black;">levelno</span> == <span style="color: #dc143c;">logging</span>.<span style="color: black;">WARNING</span>:
			xsiLvl = c.<span style="color: black;">siWarning</span>
		<span style="color: #ff7700;font-weight:bold;">elif</span> record.<span style="color: black;">levelno</span> == <span style="color: #dc143c;">logging</span>.<span style="color: black;">INFO</span>:
			xsiLvl = c.<span style="color: black;">siInfo</span>
		<span style="color: #ff7700;font-weight:bold;">elif</span> record.<span style="color: black;">levelno</span> == <span style="color: #dc143c;">logging</span>.<span style="color: black;">DEBUG</span>:
			xsiLvl = c.<span style="color: black;">siVerbose</span>
		<span style="color: #ff7700;font-weight:bold;">else</span>:
			xsiLvl = c.<span style="color: black;">siComment</span>
&nbsp;
		<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>record.<span style="color: black;">msg</span>, <span style="color: #dc143c;">types</span>.<span style="color: black;">StringTypes</span><span style="color: black;">&#41;</span>:
			msg = <span style="color: #008000;">self</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span>record<span style="color: black;">&#41;</span>
		<span style="color: #ff7700;font-weight:bold;">else</span>:
			record.<span style="color: black;">msg</span> = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>record.<span style="color: black;">msg</span><span style="color: black;">&#41;</span>
			msg = <span style="color: #008000;">self</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span>record<span style="color: black;">&#41;</span>
&nbsp;
		xsi.<span style="color: black;">LogMessage</span><span style="color: black;">&#40;</span>msg, xsiLvl<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> getLogger<span style="color: black;">&#40;</span>name=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> name <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span>:
		<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span>COMPANY_PREFIX + <span style="color: #483d8b;">'.xsi'</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">else</span>:
		<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span>COMPANY_PREFIX + <span style="color: #483d8b;">'.xsi.'</span> + name<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>, <span style="color: #483d8b;">'XSI_LOGGING_CONFIGURED'</span><span style="color: black;">&#41;</span>:
	<span style="color: #dc143c;">logging</span>.<span style="color: black;">setLoggerClass</span><span style="color: black;">&#40;</span>XSILogger<span style="color: black;">&#41;</span>
	<span style="color: #dc143c;">logging</span>.<span style="color: black;">addLevelName</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">45</span>, <span style="color: #483d8b;">'FATAL'</span><span style="color: black;">&#41;</span>
	<span style="color: #dc143c;">logging</span>.<span style="color: black;">addLevelName</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">5</span>, <span style="color: #483d8b;">'COMMENT'</span><span style="color: black;">&#41;</span>
	log = <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	xsiHandler = XSIHandler<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	xsiHandler.<span style="color: black;">setLevel</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
	fileHandler = <span style="color: #dc143c;">logging</span>.<span style="color: black;">FileHandler</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">environ</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'XSI_USERHOME'</span><span style="color: black;">&#93;</span>, <span style="color: #483d8b;">'xsiScriptLog.txt'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
	fileHandler.<span style="color: black;">setFormatter</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">logging</span>.<span style="color: black;">Formatter</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%(asctime)s - %(name)s - %(levelname)s - %(message)s&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
	fileHandler.<span style="color: black;">setLevel</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">45</span><span style="color: black;">&#41;</span>
	log.<span style="color: black;">addHandler</span><span style="color: black;">&#40;</span>xsiHandler<span style="color: black;">&#41;</span>
	log.<span style="color: black;">addHandler</span><span style="color: black;">&#40;</span>fileHandler<span style="color: black;">&#41;</span>
	log.<span style="color: black;">setLevel</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
	<span style="color: #dc143c;">sys</span>.<span style="color: black;">XSI_LOGGING_CONFIGURED</span> = <span style="color: #008000;">True</span>
&nbsp;
log = getLogger<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> XSIError<span style="color: black;">&#40;</span><span style="color: #008000;">Exception</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">pass</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> StopScriptError<span style="color: black;">&#40;</span>XSIError<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">pass</span></pre></td></tr></table></div>

<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=348&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/348/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gerstner Waves 102</title>
		<link>http://www.softimageblog.com/archives/342</link>
		<comments>http://www.softimageblog.com/archives/342#comments</comments>
		<pubDate>Wed, 01 Oct 2008 04:57:23 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=342</guid>
		<description><![CDATA[During the Gerstner Wave 101 video I alluded to stacking multiple waves together to create more complex surfaces. The idea is that for each successive wave or octave that is added onto the effect, the number of waves be greater, the amplitude be smaller and the speed be slower. Note: To see your full effect, [...]]]></description>
			<content:encoded><![CDATA[<p>During the <a title="Gerstner Waves 101" href="http://www.xsi-blog.com/archives/336" target="_self">Gerstner Wave 101</a> video I alluded to stacking multiple waves together to create more complex surfaces. The idea is that for each successive wave or octave that is added onto the effect, the number of waves be greater, the amplitude be smaller and the speed be slower.</p>
<p><strong>Note</strong>: To see your full effect, make sure when you stack multiple waves onto each other, that the mute and solo checkboxes be clear and that the &#8220;last wave&#8221; checkbox be only active on the Gerstner Wave compound plugged lowest into the terminal node or your ICE tree.</p>
<p style="text-align: center;">[There is a video that cannot be displayed in this feed. <a href="http://www.softimageblog.com/archives/342">Visit the blog entry to see the video.]</a></p>
<p style="text-align: left;">If you wish to purchase this set of wave tools, you can <a title="Purchase Gerstner Waves" href="http://www.softimageblog.com/0001-purchase" target="_self">go here</a>.</p>
<p style="text-align: left;">Have fun!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=342&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/342/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gerstner Waves 101</title>
		<link>http://www.softimageblog.com/archives/336</link>
		<comments>http://www.softimageblog.com/archives/336#comments</comments>
		<pubDate>Tue, 30 Sep 2008 14:04:35 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=336</guid>
		<description><![CDATA[With the set of Gerstner Waves available for purchase it was obvious that there should be some usage videos posted here so here is the first one describing how to install it and the basic parameters. Of course the compound installation methodology applies to any compound you might download off the Softimage Community Site or [...]]]></description>
			<content:encoded><![CDATA[<p>With the set of <a href="http://www.softimageblog.com/0001-purchase">Gerstner Waves available for purchase</a> it was obvious that there should be some usage videos posted here so here is the first one describing how to install it and the basic parameters. Of course the compound installation methodology applies to any compound you might download off the <a href="http://community.softimage.com/index.php">Softimage Community Site</a> or from anywhere else.</p>
<p style="text-align: center;">[There is a video that cannot be displayed in this feed. <a href="http://www.softimageblog.com/archives/336">Visit the blog entry to see the video.]</a></p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=336&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/336/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gerstner Waves for sale</title>
		<link>http://www.softimageblog.com/archives/330</link>
		<comments>http://www.softimageblog.com/archives/330#comments</comments>
		<pubDate>Tue, 30 Sep 2008 13:25:04 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=330</guid>
		<description><![CDATA[After some hard work and some great feedback from a few people I&#8217;ve decided to put my Gerstner wave compounds up for sale. At their current price of 40$ they&#8217;re a steal, as far as I&#8217;m concerned. If you want to get your mitts on your own copy, check out the purchase page where you [...]]]></description>
			<content:encoded><![CDATA[<p>After some hard work and some great feedback from a few people I&#8217;ve decided to put my Gerstner wave compounds up for sale.</p>
<p>At their current price of 40$ they&#8217;re a steal, as far as I&#8217;m concerned.</p>
<p>If you want to get your mitts on your own copy, check out the <a href="http://www.softimageblog.com/0001-purchase">purchase page</a> where you can securely buy via credit card or PayPal.</p>
<p>For those of you who don&#8217;t care about waves but would still like to show your appreciation for XSIBlog you can still <a href="http://www.xsi-blog.com/?page_id=98">donate</a>.</p>
<p>Cheers,<br />
Patrick</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=330&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/330/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

