<?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; Thoughts</title>
	<atom:link href="http://www.softimageblog.com/archives/category/thoughts/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>Geometry + Rig / RefModels in 6.0</title>
		<link>http://www.softimageblog.com/archives/169#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=geometry-rig-refmodels-in-60</link>
		<comments>http://www.softimageblog.com/archives/169#comments</comments>
		<pubDate>Thu, 01 Feb 2007 16:43:44 +0000</pubDate>
		<dc:creator>Helge Mathee</dc:creator>
				<category><![CDATA[JScript]]></category>
		<category><![CDATA[Rigging]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/archives/169</guid>
		<description><![CDATA[After a couple of chit chats about referenced models in 6.0, I would take to take a few minutes to explain how you can use the delta referencing system to separate rig and geometry into two different files, which can be edited independently from one another.


Okay so here&#8217;s how it works:

Create your geometry and rig
Put [...]]]></description>
			<content:encoded><![CDATA[<p>After a couple of chit chats about referenced models in 6.0, I would take to take a few minutes to explain how you can use the delta referencing system to separate rig and geometry into two different files, which can be edited <strong>independently</strong> from one another.</p>
<p><img src="http://www.xsi-blog.com/userContent/upload/2007/02/geo_rig_ref.jpg" alt="geo_rig_ref.jpg" /></p>
<p><span id="more-169"></span><br />
Okay so here&#8217;s how it works:</p>
<ol>
<li>Create your geometry and rig</li>
<li>Put rig and geometry into two different models</li>
<li>Create the connection (envelope, constraints etc)</li>
<li>Export <strong>FIRST</strong> the geometry, and <strong>SECOND</strong> the rig.</li>
<li>Go to a new scene and import <strong>FIRST</strong> the rig and <strong>SECOND</strong> the geometry as referenced models.</li>
<li>To ensure the models are loaded in the right order in the future, also name them alphabetically in that order. (in my example I am using numbers to set that order)</li>
<li>Put both ref models into a new one and export it as the &#8220;fullmodel&#8221;.</li>
</ol>
<p>You end up with three files. The first one includes just the geometry + envelope operator and weightmaps, the second one includes just the rig, and the third one, the &#8220;fullmodel&#8221;, includes just two file pointers to the previous two.</p>
<p>If you want to go ahead and make changes to the rig, you can externally, while just loading the rig up and modify it. If you are about to change the geometry, and you don&#8217;t want to loose the envelope, just open up the fullmodel, localize the submodels and do your edits, afterwards convert the geometry back to referenced, and reload the &#8220;fullmodel&#8221;.</p>
<p>Below you can see a working example in the explorer, and a repro script to generate this setup. All steps (also changes on the geometry after the connection has been established) are part of that script.</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> project <span style="color: #339933;">=</span> ActiveProject.<span style="color: #660066;">path</span><span style="color: #339933;">;</span>
NewScene<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// create objects</span>
CreatePrim<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Cylinder&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;MeshSurface&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Create2DSkeleton<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
AppendBone<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;eff&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">3</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// create models</span>
CreateModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;root&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;_0rig&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
CreateModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;cylinder&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;_1geo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// reset the transform of the models so</span>
<span style="color: #006600; font-style: italic;">// they are in the center of the world</span>
SetUserPref<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;SI3D_NODETRANSFORM_CHILD_COMPENSATE&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ResetTransform<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_0rig&quot;</span><span style="color: #339933;">,</span> siObj<span style="color: #339933;">,</span> siSRT<span style="color: #339933;">,</span> siXYZ<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
SetUserPref<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;SI3D_NODETRANSFORM_CHILD_COMPENSATE&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// create the envelope (connect the rig)</span>
ApplyFlexEnv<span style="color: #009900;">&#40;</span>
<span style="color: #3366CC;">&quot;_1geo.cylinder;&quot;</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">&quot;_0rig.bone,_0rig.bone1&quot;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// export to files</span>
ExportModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_1geo&quot;</span><span style="color: #339933;">,</span> project<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>Models<span style="color: #000099; font-weight: bold;">\\</span>geo.emdl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ExportModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_0rig&quot;</span><span style="color: #339933;">,</span> project<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>Models<span style="color: #000099; font-weight: bold;">\\</span>rig.emdl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// new scene</span>
NewScene<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// import both as referenced</span>
SICreateRefModel<span style="color: #009900;">&#40;</span>project<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>Models<span style="color: #000099; font-weight: bold;">\\</span>rig.emdl&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;_0rig&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
SICreateRefModel<span style="color: #009900;">&#40;</span>project<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>Models<span style="color: #000099; font-weight: bold;">\\</span>geo.emdl&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;_1geo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// create a new model including both</span>
CreateModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_0rig,_1geo&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;fullmodel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// export this model again</span>
ExportModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fullmodel&quot;</span><span style="color: #339933;">,</span> project<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>Models<span style="color: #000099; font-weight: bold;">\\</span>fullmodel.emdl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// new scene</span>
NewScene<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// import the fully rigged, separated model as referenced</span>
SICreateRefModel<span style="color: #009900;">&#40;</span>project<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>Models<span style="color: #000099; font-weight: bold;">\\</span>fullmodel.emdl&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;fullmodel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// change the geometry while maintaining the connection</span>
MakeModelLocal<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_0rig&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
MakeModelLocal<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_1geo&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Translate<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_1geo.cylinder.edge[67]&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ConvertToRefModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_1geo&quot;</span><span style="color: #339933;">,</span> project <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>Models<span style="color: #000099; font-weight: bold;">\\</span>geo.emdl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// reload the full model</span>
UpdateReferencedModel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fullmodel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Here&#8217;s a <a href="http://www.xsi-blog.com/userContent/upload/2007/02/geo_rig_referenced.js" title="geo_rig_referenced.js">link</a> to the script file so you can download it and try it out.</p>
<p>I hope this helps!<br />
Helge</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=169&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/169/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Now you see it, now you don&#8217;t. Digital assets in XSI.</title>
		<link>http://www.softimageblog.com/archives/100#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=now-you-see-it-now-you-dont-digital-assets-in-xsi</link>
		<comments>http://www.softimageblog.com/archives/100#comments</comments>
		<pubDate>Thu, 15 Jun 2006 17:20:12 +0000</pubDate>
		<dc:creator>Andy Nicholas</dc:creator>
				<category><![CDATA[JScript]]></category>
		<category><![CDATA[Rigging]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=100</guid>
		<description><![CDATA[Sometimes when you&#8217;re trying your hardest to put together a rig that the animators won&#8217;t break, you wish that XSI had something like Houdini&#8217;s digital assets. In case you haven&#8217;t come across Houdini yet, &#8220;Digital Assets&#8221; are a way of encapsulating a group of objects and hiding everything except for certain items that you choose. [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you&#8217;re trying your hardest to put together a rig that the animators won&#8217;t break, you wish that XSI had something like Houdini&#8217;s digital assets. In case you haven&#8217;t come across Houdini yet, &#8220;Digital Assets&#8221; are a way of encapsulating a group of objects and hiding everything except for certain items that you choose. </p>
<p>So as an example, you could create a Digital Asset of an apple. In the interface that you create, you would maybe expose a control to change the color of the apple. In fact, to make it even easier, it might just be a slider that controls the color to go from green to red. You could call that control &#8220;Ripeness&#8221; if you want. You could also add a slider for controlling the size. </p>
<p><span id="more-100"></span><br />
If you now give this asset to another artist, the only way they can change the apple is for them to use the controls you have provided. This means that they won&#8217;t be able to make the apple turn blue (accidentally or otherwise). </p>
<p>In a large pipeline, this can prove to be extremely useful. It means that if the TD knows what they&#8217;re doing, they can deploy assets in production which won&#8217;t get broken or changed in an unexpected way later on. Obviously, care must be taken not to take this paradigm too far and to over encapsulate the object making that asset inflexible. So research and planning for an asset&#8217;s role in the pipeline is vital to make sure that the right level of control is applied.</p>
<p>So how can we create Digital Assets in XSI? Natively, they aren&#8217;t supported. What do we need? We just need a way to store our asset, a method of presenting certain parameters of our choice to the user, and a way of hiding objects from various XSI editors (Explorer, etc.). </p>
<p>The obvious choice for storing our asset is to use an XSI model. Each model represents a unique namespace for objects and they are XSI&#8217;s current method of asset encapsulation (albeit limited).</p>
<p>The second one is also easy. Proxy parameters enable us to provide another location to change any parameter we want. We can also use conventional parameters and then link to them using expressions. While this method might not be quite as nice as a fully customized interface, it will do for this article. Other options might include using an HTML page to display controls to drive parameters, or an ActiveX control, etc.</p>
<p>So that just leaves us with hiding objects from the various XSI editors. To do that we use this:</p>
<p><code>obj.SetCapabilityFlag( siNotInspectable, true);</code></p>
<p>The <em>SetCapabilityFlag()</em> method can be found on the ProjectItem object, which occurs near the top of the class hierarchy of the SDK. This means that a large number of objects support this method, including mesh objects, operators, clips, materials, properties, clusters, and many others. In addition, the parameter object also has this method, despite not inheriting from the ProjectItem object.</p>
<p>So here&#8217;s an example implementation of the apple Digital Asset. </p>
<p><img src="/userContent/anicholas/digitalAssets/tut05_01.jpg" alt="The apple asset" /> </p>
<p>In the end, I put in four controls.</p>
<p><img src="/userContent/anicholas/digitalAssets/tut05_02.jpg" alt="Asset PPG Controls" /> </p>
<p>The Deform parameter drives the amplitude of a push operator connected to a weight map to add variation to the shape of the apple. Since I didn&#8217;t lock the weightmap, you can still modify it using the weight paint brush to change the shape.</p>
<p>The Ripeness parameter drives an expression to control the color in the render tree (you need to render the apple to see the color change). Note that I had to use a &#8220;Vector Share&#8221; via a &#8220;Vector To Color&#8221; to drive the diffuse color, as XSI doesn&#8217;t let you put expressions on color parameters. </p>
<p>The Size parameter uses some basic rigging to change the size of the apple without changing the size of the stalk.</p>
<p>And finally, the Resolution parameter directly drives the Geometry Approximation to alter the subdivision level.</p>
<p>After hiding all the properties that I didn&#8217;t want the user to see, it looks like this in Explorer:</p>
<p><img src="/userContent/anicholas/digitalAssets/tut05_03.jpg" alt="View of asset in explorer" /> </p>
<p>Note that I&#8217;ve set the Explorer view to show &#8220;Local Properties&#8221; so that we don&#8217;t see any inherited properties that would otherwise appear there in italics.</p>
<p>To hide the various properties that I didn&#8217;t want to see, I used a simple script that can be run from &#8220;<em>Model->Get Property->Digital Asset Tools->Pick Objects to Not Inspect</em>&#8220;. You can download this script below. When you run the tool, you pick items in Explorer that you want to hide with the left mouse button. Right click to finish and see them disappear. Note that I haven&#8217;t supplied a tool to make things re-appear again, so make sure you know what you&#8217;re doing!</p>
<p>Okay, so this all seems great. However there are a few gotchas that you have to be aware of:</p>
<ul>
<li>Once you&#8217;ve hidden something, you&#8217;ll have to use scripting to get it back again. There&#8217;s no other way.</li>
<li>Don&#8217;t try to hide shared properties (e.g. ambient, the Scene_Root&#8217;s material, etc.) as it will hide all instances of that property. For example, if you hide the shared ambient property, you&#8217;ll find that the &#8220;Ambient&#8221; button in the Render toolbar won&#8217;t show the PPG to let you edit it.</li>
<li>Only hide an actual object when you&#8217;re certain it&#8217;s not needed. In my example, if the user selects the Apple mesh and presses H, they can always unhide it by selecting it in Explorer and pressing H again. If you&#8217;ve hidden the actual object from the Explorer too, then the only way to get it back is to use the &#8220;Unhide All Objects&#8221; from the Display menu.</li>
<li>Hiding individual parameters can be great for hiding them from editors such as the graph editor. <strong>BUT</strong>, be very aware that you&#8217;ll no longer be able to access that parameter from scripting using many of the conventional methods. <strong>This may well break numerous common operations in XSI, so make sure you research the implications of what you&#8217;re doing. You have been warned!</strong><br />
<em>(In fact, you can still access the parameter to unhide it again, but you have to do it by pushing it&#8217;s name into the Items property of an XSICollection)</em></li>
<li>Duplicating the DigitalAsset model with Ctrl-D will lose any expressions that you&#8217;ve set up, unless you&#8217;ve enabled &#8220;Copy Animation&#8221; in the Duplicate Options. This can cripple your Digital Asset if it relies on expressions to do some of the work.</li>
</ul>
<p>The most important thing to note, is that (to my knowledge) this technique has not been production tested inside XSI yet. This is a fairly non-standard way of working in XSI, and it isn&#8217;t something that Softimage would be expecting you to do. Hence there may be other gotchas that I&#8217;ve not found yet that could invalidate this way of working. </p>
<p>Having said that, it&#8217;s definitely a cool technique, and I hope that this or a similar type of workflow will be acknowledged or supported by XSI in the future.</p>
<p>I&#8217;ve uploaded the asset as an XSI 5.0 model (both the unhidden and the final versions of the asset), as well as the script for making your objects and properties hidden. To install it, you need to copy the script to your user/application/plugins folder.</p>
<p><a href="/userContent/anicholas/digitalAssets/DigitalAsset.zip" title="DigitalAsset.zip">DigitalAsset.zip</a> </p>
<p><em>(Disclaimer: I&#8217;ve given fair warning during this article about the dangers of hiding things, so I accept no responsibility for any losses you may incur! Please take care.)</em></p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=100&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/100/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tired of LogMessage?</title>
		<link>http://www.softimageblog.com/archives/12#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=tired-of-logmessage</link>
		<comments>http://www.softimageblog.com/archives/12#comments</comments>
		<pubDate>Fri, 04 Mar 2005 23:14:11 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Programming / Scripting]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=12</guid>
		<description><![CDATA[OK&#8230;

1
Application.LogMessage&#40;&#34;Whatever&#34;&#41;

Am I tired of writing this in my XSI Python scripts you think? In Python, variables are basically pointers to the actual object and everything in Python is an object, functions included&#8230; Hmmm&#8230;
Try using this at the top of your python scripts:

1
2
xsi = Application
pr = xsi.__getattr__&#40;&#34;LogMessage&#34;&#41;

Now you can do:

1
2
xsi.Whatever&#40;attrib&#41;
pr&#40;whatever.Property&#41;

instead of

1
2
Application.Whatever&#40;attrib&#41;
Application.LogMessage&#40;whatever.Property&#41;

All of this with absolute minimal [...]]]></description>
			<content:encoded><![CDATA[<p>OK&#8230;</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;">Application.<span style="color: black;">LogMessage</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Whatever&quot;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Am I tired of writing this in my XSI Python scripts you think? In Python, variables are basically pointers to the actual object and everything in Python is an object, functions included&#8230; Hmmm&#8230;</p>
<p>Try using this at the top of your python scripts:</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;">xsi = Application
pr = xsi.<span style="color: #0000cd;">__getattr__</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;LogMessage&quot;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Now you can do:</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;">xsi.<span style="color: black;">Whatever</span><span style="color: black;">&#40;</span>attrib<span style="color: black;">&#41;</span>
pr<span style="color: black;">&#40;</span>whatever.<span style="color: black;">Property</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>instead of</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;">Application.<span style="color: black;">Whatever</span><span style="color: black;">&#40;</span>attrib<span style="color: black;">&#41;</span>
Application.<span style="color: black;">LogMessage</span><span style="color: black;">&#40;</span>whatever.<span style="color: black;">Property</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>All of this with absolute minimal overhead! My wrists will be thanking my little brain fart in twenty years!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=12&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/12/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Am I a programmer?</title>
		<link>http://www.softimageblog.com/archives/9#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=am-i-a-programmer</link>
		<comments>http://www.softimageblog.com/archives/9#comments</comments>
		<pubDate>Wed, 09 Feb 2005 13:36:57 +0000</pubDate>
		<dc:creator>Patrick Boucher</dc:creator>
				<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=9</guid>
		<description><![CDATA[One of my friends has fun telling me that I&#8221;m not really a programmer because my code isn&#8221;t compiled. I mostly use scripting languages so I can&#8221;t be a programmer, can I?
To which I reply: are you really a programmer if your ubber-complex program fits in twenty lines and the heavy lifting is done by [...]]]></description>
			<content:encoded><![CDATA[<p>One of my friends has fun telling me that I&#8221;m not really a programmer because my code isn&#8221;t compiled. I mostly use scripting languages so I can&#8221;t be a programmer, can I?</p>
<p>To which I reply: are you really a programmer if your ubber-complex program fits in twenty lines and the heavy lifting is done by a library / framework? This friend of mine is a very qualified and efficient <a href="http://www.microsoft.com/net/" rel="nofollow">.Net</a> programmer.</p>
<p>&#8212; &#8212; &#8212; &#8212; &#8212;</p>
<p>I was having a drink with a couple of buddies last night and told this story. One of the guys spontaneously provided a heartfelt answer to the debate. He had obviously thought about this before&#8230;</p>
<blockquote><p>The purpose of a programmer is to have the buisness logic of a client be executed by a computer. By client this can be a paying client of a software company or it can be the guy next to you in a department who needs a tool. In this context, no one cares &#8211; especially not the client, how this execution is acheived. As long as the buisness logic is executed by a computer within the prescribed development timeframe and the alloted budget the client should be satisfied. The debate on which tools to use, because this is essentially what this boils down to, is purely academic and is in the greater scheme of things worthless &#8212; nobody cares, as long as the buisness logic is taken out of their hands.</p></blockquote>
<p>Hmmm&#8230; Score: 5, Insightful.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=9&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/9/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
