<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title> mel wiki</title>
<link>http://mayamel.tiddlyspot.com</link>
<description>- Your Maya mel resource on the web -</description>
<language>en-us</language>
<copyright>Copyright 2010 WarpCat</copyright>
<pubDate>Fri, 12 Mar 2010 22:18:49 GMT</pubDate>
<lastBuildDate>Fri, 12 Mar 2010 22:18:49 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>TiddlyWiki 2.4.0</generator>
<item>
<title>How can I build a file browser dialog, to select a file that dosn't yet exist? Or to select a directory only?</title>
<description>&lt;code&gt;fileBrowserDialog&lt;/code&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt;Notes: The docs on this suck, so this is what you need to do:&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;Example with Python, for picking directories.  Since you can nest functions in Python, it makes it easier to wrapper the functionality of this command together into one cohesive unit.&lt;br&gt;&lt;pre&gt;import maya.cmds as mc
def fbd():
    def fileCommand(directory, ignore):
        # This is called by the fileBrowserDialog command after a dir is picked.
        print directory
    mc.fileBrowserDialog(mode=4, fileCommand=fileCommand, fileType='directory',
                         actionName='Choose a directory:')
fbd()   
&lt;/pre&gt;&lt;hr&gt;&lt;ul&gt;&lt;li&gt;Mel Examples:&lt;ul&gt;&lt;li&gt;First, built the file brower dialog: -mode is telling it what to do:&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;fileBrowserDialog -mode 2 -fileCommand &quot;procName&quot; 
    -actionName &quot;whatYouAreDoing&quot;;
&lt;/pre&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;-mode 0 is for reading files, so if you type in a name that dosn't exist, the browers will give an error&lt;/li&gt;&lt;li&gt;-mode 1 &amp;amp; 2 are pretty much the same and are for for writing to file, so you can speficy your own filename in the browers.&lt;/li&gt;&lt;li&gt;-mode 4 is for selecting directories only.&lt;/li&gt;&lt;li&gt;-fileCommand is the name of the below proc, that the fileBrowserDialog? passes its info to.&lt;/li&gt;&lt;li&gt;-actionName is simply what is printed in the UI, telling the user what is going on&lt;/li&gt;&lt;li&gt;If you're using mode 1 or 2, and you want to specify your own &quot;file types&quot; for filtering, you can use the below code snippet (thanks to Mason Sheffield).  &lt;ul&gt;&lt;li&gt;The &lt;code&gt;-filterList&lt;/code&gt; can be called to multiple times to define different file types.  The &lt;code&gt;-filterType&lt;/code&gt; is simply the default UI filterList choice.  Also, you &lt;em&gt;must&lt;/em&gt; set &lt;code&gt;-dialogStyle 1&lt;/code&gt; for some reason, or the filtering won't work :(&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;pre&gt;-filterList &quot;My file type(*.mft),*.mft&quot; 
-filterList &quot;otherFileType(*.oft),*.oft&quot;
-fileType &quot;My file type(*.mft)&quot; 
-dialogStyle 1
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Next, you need to build a proc, that can take the return from the FBD, and then do something with it. It needs to be in the below format, but the proc name, and var names can change.&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;global proc procName(string $result, string $type){
    textFieldButtonGrp -e -tx $result controlName;} 
&lt;/pre&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;So, the &lt;code&gt;fileBrowserDialog&lt;/code&gt; passes its info, via the &lt;code&gt;$result&lt;/code&gt; argument, into the &quot;procName&quot; proc.  Then procName will update controlName with $result.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Another issue: By default you can't specify WHERE the dialog will open too. It appears that it bases where it opens on where Maya's current workspace is. SO, to tell it where to go, you'd need to do something like this:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;// query Maya's current workspace:  
string $mayaWorkspace = `workspace -q -dir`;
// set the workspace to where you want the dialog to open:
workspace -dir $myCustomPath;
// run the dialog code:
fileBrowserDialog ....
// and set the workspace back again:
workspace -dir $mayaWorkspace;
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Annoying!&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;hr&gt;&lt;br&gt;I got an emailed suggestion from Nicolas Combecave.  Thanks Nicolas!&lt;br&gt;&lt;ul&gt;&lt;li&gt;After scrutining into the fileBrowser mel &lt;em&gt;command&lt;/em&gt;, I found that the &lt;em&gt;script&lt;/em&gt; &lt;code&gt;fileBrowserWithFilter&lt;/code&gt;, does both in one single command, plus adds an items filtering mechanism. Here is its syntax from the procedure declaration:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;global proc int fileBrowserWithFilter(
    string $callBack, 
    string $action, 
    string $title, 
    string $type, 
    int $mode, 
    string $filters[], 
    string $dir)
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;We can translate it into a mode understandable text:&lt;ul&gt;&lt;li&gt;&lt;code&gt;string $callBack&lt;/code&gt; &amp;gt; your procedure to launch upon validation&lt;/li&gt;&lt;li&gt;&lt;code&gt;string $action&lt;/code&gt; &amp;gt; text label on the validation button&lt;/li&gt;&lt;li&gt;&lt;code&gt;string $title&lt;/code&gt; &amp;gt; browser title&lt;/li&gt;&lt;li&gt;&lt;code&gt;string $type&lt;/code&gt; &amp;gt; a filetype to select in the dropdown list. Even custom ones (see below).&lt;/li&gt;&lt;li&gt;&lt;code&gt;int $mode&lt;/code&gt; &amp;gt; choose for read/write/listDirs... (see description above)&lt;/li&gt;&lt;li&gt;&lt;code&gt;string $filters[]&lt;/code&gt; &amp;gt; fileTypes in the dropdown menu. You can define yours here: {&quot;myFileType,*.mft&quot;:&quot;yourFileType,*.yft&quot;:&quot;theirFileType,*.tft&quot;:etc...}&lt;/li&gt;&lt;li&gt;&lt;code&gt;string $dir&lt;/code&gt;  &amp;gt; the starting directory&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;So you can use it when you want to specify a file that doesn't exists, into a specified destination, filtering only special file types, even custom ones:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;string $startDir  =&quot;c:/tmp/&quot;;
fileBrowserWithFilter(
    &quot;procName&quot;,
    &quot;myLabel&quot;,
    &quot;myTitle&quot;,
    &quot;afileType&quot;,
    1,
    {&quot;aFileType,*.aft&quot;,&quot;anotherFileType,*.anft&quot;},
    $startDir);
&lt;/pre&gt;</description>
<category>UI</category>
<category>FILE OPERATION</category>
<category>python</category>
<category>fileBrowserDialog</category>
<category>fileBrowserWithFilter</category>
<category>workspace</category>
<category>directory</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20build%20a%20file%20browser%20dialog%2C%20to%20select%20a%20file%20that%20dosn't%20yet%20exist%3F%20Or%20to%20select%20a%20directory%20only%3F%5D%5D</link>
<pubDate>Fri, 12 Mar 2010 22:18:39 GMT</pubDate>
</item>
<item>
<title>Qt UI Authoring</title>
<description>Starting in Maya 2011, Autodesk changed the UI system to &lt;a target=&quot;_blank&quot; title=&quot;External link to http://qt.nokia.com/&quot; href=&quot;http://qt.nokia.com/&quot; class=&quot;externalLink&quot;&gt;Qt&lt;/a&gt; (made by Nokia).  I'm not 2011 yet... but I found this snazzy video blog discussing some of the high level features:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://area.autodesk.com/blogs/stevenr/maya_2011_highlight_qt_user_interface&quot; href=&quot;http://area.autodesk.com/blogs/stevenr/maya_2011_highlight_qt_user_interface&quot; class=&quot;externalLink&quot;&gt;http://area.autodesk.com/blogs/stevenr/maya_2011_highlight_qt_user_interface&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
<category>UI</category>
<category>qt</category>
<category>qt designer</category>
<category>nokia</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BQt%20UI%20Authoring%5D%5D</link>
<pubDate>Fri, 12 Mar 2010 21:30:00 GMT</pubDate>
</item>
<item>
<title>How can I set the range slider to match the keyframe range of all nodes in the scene?</title>
<description>&lt;pre&gt;# Python code
import maya.cmds as mc
animCurves = mc.ls(type='animCurve')
first = mc.findKeyframe(animCurves, which='first')
last = mc.findKeyframe(animCurves, which='last')
mc.playbackOptions(min=first, max=last)
&lt;/pre&gt;</description>
<category>ANIMATION</category>
<category>python</category>
<category>findKeyframe</category>
<category>playbackOptions</category>
<category>min</category>
<category>max</category>
<category>first</category>
<category>last</category>
<category>range</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20set%20the%20range%20slider%20to%20match%20the%20keyframe%20range%20of%20all%20nodes%20in%20the%20scene%3F%5D%5D</link>
<pubDate>Mon, 08 Mar 2010 17:42:00 GMT</pubDate>
</item>
<item>
<title>How can I set the range slider to match the keyframe range on the selected object(s)?</title>
<description>&lt;pre&gt;selectKey -time &quot;:&quot;;
float $allKeys[] = sort(`keyframe -q -sl`);
playbackOptions -min $allKeys[0] -max $allKeys[(size($allKeys) -1)];
&lt;/pre&gt;&lt;hr&gt;Also see:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I find the min and max keyframe values for all objects in the scene?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I find the min and max keyframe values for all objects in the scene?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20find%20the%20min%20and%20max%20keyframe%20values%20for%20all%20objects%20in%20the%20scene?&quot; class=&quot;externalLink&quot;&gt;How can I find the min and max keyframe values for all objects in the scene?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I find the min and max keyframe range for the provided objects?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I find the min and max keyframe range for the provided objects?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20find%20the%20min%20and%20max%20keyframe%20range%20for%20the%20provided%20objects?&quot; class=&quot;externalLink&quot;&gt;How can I find the min and max keyframe range for the provided objects?&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
<category>ANIMATION</category>
<category>selectKey</category>
<category>sort</category>
<category>keyframe</category>
<category>playbackOptions</category>
<category>range</category>
<category>min</category>
<category>max</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20set%20the%20range%20slider%20to%20match%20the%20keyframe%20range%20on%20the%20selected%20object(s)%3F%5D%5D</link>
<pubDate>Mon, 08 Mar 2010 17:20:00 GMT</pubDate>
</item>
<item>
<title>How can I parent the instance of a shape node from one object to another?</title>
<description>New way my buddy Te pointed out to me:&lt;br&gt;&lt;pre&gt;# Python code:
import maya.cmds as mc
mc.parent('someShapeNode', 'someTransform', shape=True, add=True)
&lt;/pre&gt;I thought the code would &lt;em&gt;re-parent&lt;/em&gt; the shape node.  But it doesn't, it makes it an instance.&lt;br&gt;&lt;hr&gt;Older method:&lt;br&gt;&lt;ul&gt;&lt;li&gt;First, you &quot;instance&quot; your shape node, which will give you a new transform as well.&lt;/li&gt;&lt;li&gt;Second, you parent your new instanced shape node to it's new parental transform.&lt;/li&gt;&lt;li&gt;Third, remove the 'no-longer-needed' transform&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;string $shapeNode = &quot;myShape&quot;;
string $newParent = &quot;someTransform&quot;;
string $instancedShape[] = `instance $shapeNode`;
parent -s -r ($instancedShape[0] + &quot;|&quot; + $shapeNode) $newParent;
delete $instancedShape[0];
&lt;/pre&gt;Also see:&lt;br&gt;&lt;a tiddlylink=&quot;How can I reparent the shape node of one object to another.  OR, how can I have a single transform with multiple shapes?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I reparent the shape node of one object to another.  OR, how can I have a single transform with multiple shapes?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20reparent%20the%20shape%20node%20of%20one%20object%20to%20another.%20%20OR,%20how%20can%20I%20have%20a%20single%20transform%20with%20multiple%20shapes?&quot; class=&quot;externalLink&quot;&gt;How can I reparent the shape node of one object to another.  OR, how can I have a single transform with multiple shapes?&lt;/a&gt;</description>
<category>TRANSFORMATION</category>
<category>python</category>
<category>parent</category>
<category>instance</category>
<category>shape</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20parent%20the%20instance%20of%20a%20shape%20node%20from%20one%20object%20to%20another%3F%5D%5D</link>
<pubDate>Wed, 03 Mar 2010 18:23:00 GMT</pubDate>
</item>
<item>
<title>Matrix info</title>
<description>When I first authored this subject I didn't use matrices very often.  But I've found the more I learn about them, the more I end up using them...&lt;br&gt;Also see my other subject: &lt;a tiddlylink=&quot;Working with matrices with Python&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#Working with matrices with Python&quot; href=&quot;http://mayamel.tiddlyspot.com#Working%20with%20matrices%20with%20Python&quot; class=&quot;externalLink&quot;&gt;Working with matrices with Python&lt;/a&gt;&lt;br&gt;&lt;hr&gt;Launch help for the root &lt;code&gt;dagNode&lt;/code&gt; type node, which has the base matrix attrs:&lt;br&gt;&lt;pre&gt;showHelp -d &quot;Nodes/dagNode.html
&lt;/pre&gt;Launch help for the &lt;code&gt;transform&lt;/code&gt; node (lots of matrix info):&lt;br&gt;&lt;pre&gt;showHelp -d &quot;Nodes/transform.html&quot;;
&lt;/pre&gt;Web:&lt;br&gt;&lt;ul&gt;&lt;li&gt;I made an image describing how 4x4 matrix multiplication works.  You can find it on my &lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.akeric.com/blog/?p=693&quot; href=&quot;http://www.akeric.com/blog/?p=693&quot; class=&quot;externalLink&quot;&gt;blog here&lt;/a&gt;, or on &lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.flickr.com/photos/warpcat/3956108191/&quot; href=&quot;http://www.flickr.com/photos/warpcat/3956108191/&quot; class=&quot;externalLink&quot;&gt;flickr here&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://books.google.com/books?id=_ztrTBEDK28C&amp;amp;lpg=PA191&amp;amp;ots=r56b7bLPzY&amp;amp;dq=python%20transformation%20matrix&amp;amp;pg=PA181#v=onepage&amp;amp;q=python%20transformation%20matrix&amp;amp;f=false&quot; href=&quot;http://books.google.com/books?id=_ztrTBEDK28C&amp;amp;lpg=PA191&amp;amp;ots=r56b7bLPzY&amp;amp;dq=python%20transformation%20matrix&amp;amp;pg=PA181#v=onepage&amp;amp;q=python%20transformation%20matrix&amp;amp;f=false&quot; class=&quot;externalLink&quot;&gt;chapter 9&lt;/a&gt; from the book &lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.apress.com/book/view/9781590598726&quot; href=&quot;http://www.apress.com/book/view/9781590598726&quot; class=&quot;externalLink&quot;&gt;Beginning Game Development with Python and PyGame: From Novice to Professional&lt;/a&gt; has a really well described overview.&lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://eddieoffermann.com/blog/tag/matrix-multiplication/&quot; href=&quot;http://eddieoffermann.com/blog/tag/matrix-multiplication/&quot; class=&quot;externalLink&quot;&gt;http://eddieoffermann.com/blog/tag/matrix-multiplication/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.185vfx.com/2003/03/convert-a-3d-point-to-2d-screen-space-in-maya/&quot; href=&quot;http://www.185vfx.com/2003/03/convert-a-3d-point-to-2d-screen-space-in-maya/&quot; class=&quot;externalLink&quot;&gt;http://www.185vfx.com/2003/03/convert-a-3d-point-to-2d-screen-space-in-maya/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Online video lectures from &lt;a target=&quot;_blank&quot; title=&quot;External link to http://ocw.mit.edu/OcwWeb/Mathematics/18-06Spring-2005/VideoLectures/&quot; href=&quot;http://ocw.mit.edu/OcwWeb/Mathematics/18-06Spring-2005/VideoLectures/&quot; class=&quot;externalLink&quot;&gt;MIT&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://knol.google.com/k/koen-samyn/matrices-for-3d-applications/2lijysgth48w1/3&quot; href=&quot;http://knol.google.com/k/koen-samyn/matrices-for-3d-applications/2lijysgth48w1/3&quot; class=&quot;externalLink&quot;&gt;http://knol.google.com/k/koen-samyn/matrices-for-3d-applications/2lijysgth48w1/3&lt;/a&gt;#&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;strong&gt;Quick 4x4 matrix review of an identity matrix&lt;/strong&gt; (presuming +X is 'left', +Y is 'up', and +Z is 'forward').  To visualize the x, y, and z-axes, use your hand:  Hold your right hand in front of you, pointer straight ahead, thumb up, and middle-finger left:  Middle-finger = +X-axis, thumb = +Y-axis, pointer = +Z-axis.&lt;br&gt;&lt;ul&gt;&lt;li&gt;The fourth &lt;em&gt;column&lt;/em&gt; '&lt;code&gt;W&lt;/code&gt;' is for the most part unused, it is always &lt;code&gt;(0, 0, 0, 1)&lt;/code&gt;:  This is called the 'homogeneous row'.  W =  A scalar value (also known as the 'homogeneous coordinate') used for conversion from Euclidean to Cartesian coordinates.&lt;/li&gt;&lt;li&gt;The first three &lt;em&gt;rows&lt;/em&gt; represent the vectors that point in the x, y, and z directions of the transformation, which represent the &lt;em&gt;axis&lt;/em&gt; in 3D space.  Effectively the orientation/heading of the 'local axis' of a transform in Maya.  They also calculate &lt;em&gt;scale&lt;/em&gt;.&lt;/li&gt;&lt;li&gt;The fourth &lt;em&gt;row&lt;/em&gt; (&lt;code&gt;w&lt;/code&gt;) represents the translation, or point in space when transformed by this matrix.  This is the 'homogeneous row':&lt;/li&gt;&lt;/ul&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;X&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Y&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Z&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;W&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;notes&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;x-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;'left', mag=scaleX&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;y-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;'up', mag=scaleY&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;z-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;'forward', mag=scaleZ&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;(w) translate&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;(remember, the right column is ignored)&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;translation&lt;/strong&gt;:  Derived from the bottom row.&lt;ul&gt;&lt;li&gt;translateX, translateY, translateZ =  &lt;code&gt;(0 ,0 ,0)&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;orientation&lt;/strong&gt;:  Vectors that point in the x, y, and z directions of the transformation.&lt;ul&gt;&lt;li&gt;&lt;code&gt;x-axis&lt;/code&gt; : defines the current heading of the  'left' vector = &lt;code&gt;(1, 0, 0)&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;y-axis&lt;/code&gt; : defines the current heading of the 'up' vector = &lt;code&gt;(0, 1, 0)&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;z-axis&lt;/code&gt; : defines the current heading of the 'forward' vector = &lt;code&gt;(0, 0, 1)&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;scale&lt;/strong&gt; : The magnitude of each x, y, and z-axis defines the scale = &lt;code&gt;(1, 1, 1)&lt;/code&gt;&lt;ul&gt;&lt;li&gt;scaleX = &lt;code&gt;mag(x-axis)&lt;/code&gt; = &lt;code&gt;mag(1, 0, 0)&lt;/code&gt; = 1.0&lt;/li&gt;&lt;li&gt;scaleY = &lt;code&gt;mag(y-axis)&lt;/code&gt; = &lt;code&gt;mag(0, 1, 0)&lt;/code&gt; = 1.0&lt;/li&gt;&lt;li&gt;scaleZ = &lt;code&gt;mag(z-axis)&lt;/code&gt; = &lt;code&gt;mag(0, 0, 1)&lt;/code&gt; = 1.0&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;shear&lt;/strong&gt; : still working on that one ;)&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Some examples, based on that info:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;Where individual rotation axis data is stored in the matrix:&lt;br&gt;&lt;u&gt;X-axis&lt;/u&gt;:&lt;br&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;X&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Y&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Z&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;W&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;x-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;y-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;z-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;(w) translate&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;u&gt;Y-axis&lt;/u&gt;:&lt;br&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;X&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Y&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Z&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;W&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;x-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;y-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;left&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;z-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;(w) translate&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;u&gt;Z-axis&lt;/u&gt;:&lt;br&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;X&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Y&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Z&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;W&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;x-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;y-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;left&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;z-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;(w) translate&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;u&gt;Translate XYZ&lt;/u&gt;:&lt;br&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;X&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Y&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;Z&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;W&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;x-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;y-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;left&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;z-axis&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;left&quot;&gt;(w) translate&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;0&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;Identity matrix rotated 45 degrees along the Z axis.  Compare this to the above chart that shows where those values will be stored.  Note how the z-axis remains the same &lt;code&gt;(0, 0, 1, 0)&lt;/code&gt; since it hasn't changed orientation.  But both the x-axis and y-axis now have a new heading? (since they were transformed by the z-axis rotation)  And notice how all their magnitudes still equals &lt;code&gt;1.0&lt;/code&gt;?  Scale remains at &lt;code&gt;(1,1,1&lt;/code&gt;).&lt;ul&gt;&lt;li&gt;Visualize this using the 'left hand rule' described above:  Start with your left hand at identity.  Imagine there is a point on the tip of each finger corresponding to each identity vector.  Now rotate your hand along the z-axis (pointer) &lt;em&gt;clockwise&lt;/em&gt; 45 degrees.  Your pointer is still pointing the exact same direction &lt;code&gt;(0, 0, 1)&lt;/code&gt;, but the points defined by your thumb (+y) and middle finger (+x) have moved in space.  But they're all still the same distance away from the middle of the transform, so their magnitudes still each equal &lt;code&gt;1.0&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;.707107&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;-.707107&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;.707107&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span class=&quot;marked&quot;&gt;.707107&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;Identity matrix scaled to be half as wide, and twice as high:&lt;/li&gt;&lt;/ul&gt;scaleX = &lt;code&gt;mag(x-axis)&lt;/code&gt; = &lt;code&gt;mag(.5, 0, 0)&lt;/code&gt; = .5&lt;br&gt;scaleY = &lt;code&gt;mag(y-axis)&lt;/code&gt; = &lt;code&gt;mag(0, 2, 0)&lt;/code&gt; = 2&lt;br&gt;scaleZ = &lt;code&gt;mag(z-axis)&lt;/code&gt; = &lt;code&gt;mag(0, 0, 1)&lt;/code&gt; = 1&lt;br&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;.5&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;2&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr&gt;&lt;strong&gt;Maya transformation matrix:&lt;/strong&gt;&lt;br&gt;Simple version:&lt;br&gt;&lt;ul&gt;&lt;li&gt; Scale Matrix * Rotate Matrix * Translate Matrix = final matrix&lt;/li&gt;&lt;/ul&gt;Long version:&lt;br&gt;&lt;code&gt;matrix = SP *(-1) S * SH * SP * ST * RP *(-1) RA * R * RP * RT * T&lt;/code&gt;&lt;br&gt;&lt;code&gt;*&lt;/code&gt; = matrix multiplication, (-1) = matrix inversion&lt;br&gt;&lt;ul&gt;&lt;li&gt;SP = scale pivot&lt;/li&gt;&lt;li&gt;S = scale&lt;/li&gt;&lt;li&gt;SH = shear&lt;/li&gt;&lt;li&gt;ST = scale (pivot) translate&lt;/li&gt;&lt;li&gt;RP = rotate pivot&lt;/li&gt;&lt;li&gt;RA = rotate axis = &lt;ul&gt;&lt;li&gt;AX * AY * AZ &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;R = rotate = &lt;ul&gt;&lt;li&gt;RX * RY * RZ (Defined by rotate order)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;RP = rotate pivot&lt;/li&gt;&lt;li&gt;RT = rotate (pivot) translate&lt;/li&gt;&lt;li&gt;T = translate&lt;/li&gt;&lt;/ul&gt;Matrix multiplication happens in order, from left to right.  It can be thought of exactly like a transform hierarchy, with child nodes on the left, and parental nodes on the right.  The matrix to the right will effect the matrix to the left.  So in effect, the root of the hierarchy is '&lt;code&gt;T&lt;/code&gt;' (translate), while the leaf-most child would be '&lt;code&gt;S&lt;/code&gt;' (scale).  This is why the translation of a node effects where it is rotated and scaled, the rotation of a node effects the orientation of scale but has no effect on translation, and the scale of a node has no effect over rotation or translation.&lt;br&gt;&lt;blockquote&gt;It's important to note that Maya internally doesn't store its animation data as matrices.  It stores them on nodes, as keyframe data (scalar values), expression data, dynamic sim, etc.  The matrix is simply a state value that can be queried based on the end result of the incoming anim data for a given transform.&lt;br&gt;&lt;/blockquote&gt;&lt;hr&gt;Matrices are &lt;em&gt;multiplied&lt;/em&gt; together to get new matrices.  For example, if you wanted to assign the position of objectC as the position of objectA + objectB:&lt;br&gt;&lt;pre&gt;matrixC = matrixB * matrixA
&lt;/pre&gt;So when you think of 'adding' values, convert that to 'multiplying' matrices.&lt;br&gt;But what if you want to 'subtract' values?  For example, you want the position of objectC to be the difference between objectA and objectB?  In this case you add (multiply) by the &lt;em&gt;inverseMatrix&lt;/em&gt;.&lt;br&gt;&lt;pre&gt;matrixC = matrixB * inverseMatrixA
&lt;/pre&gt;&lt;hr&gt;&lt;code&gt;dagNode&lt;/code&gt; node's matrix related attrs (all of these are available through any &lt;code&gt;transform&lt;/code&gt; based node):&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;u&gt;Local&lt;/u&gt; matrix data, relative to the nodes &lt;em&gt;parent&lt;/em&gt;:&lt;ul&gt;&lt;li&gt;&lt;code&gt;.matrix&lt;/code&gt; : Local transformation matrix for the dagNode. &lt;/li&gt;&lt;li&gt;&lt;code&gt;.inverseMatrix&lt;/code&gt;  :  Inverse of matrix attribute.  Multiplying by this value will place it at its parent.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Matrix data for the nodes &lt;u&gt;&lt;em&gt;parent&lt;/em&gt;&lt;/u&gt;:&lt;ul&gt;&lt;li&gt;&lt;code&gt;.parentMatrix&lt;/code&gt; : The parentMatrix instanced attribute represents the world-space transformation matrix for the parents of this dagNode. If the dagNode is a transform node and its inheritTransform attribute is false, then the parentMatrix is identity. &lt;/li&gt;&lt;li&gt;&lt;code&gt;.parentInverseMatrix&lt;/code&gt; : Inverse of parentMatrix instanced attribute.  Multiply the parent by this value to return it to origin.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Matrix data relative to the &lt;u&gt;&lt;em&gt;world&lt;/em&gt;&lt;/u&gt;:&lt;ul&gt;&lt;li&gt;&lt;code&gt;.worldMatrix&lt;/code&gt; :  The worldMatrix instanced attribute is the 4x4 transformation matrix that transforms the object to world-space. There is a world-space matrix for each unique path to the object. Eg. 'ball.worldMatrix[0]' identifies the world-space transformation matrix for the first instance of the object 'ball'. Each world-space transformation matrix is the result of post multiplying the 'matrix' attribute by corresponding 'parentMatrix' instanced attribute (i.e. worldMatrix[i] == matrix x parentMatrix[i]). Thus, the worldMatrix is the concatenation of the 'matrix' attribute of all the dagNodes along the path from the node up to the root of the dag hierarchy.&lt;ul&gt;&lt;li&gt;Basically:  &lt;code&gt;dagNode.worldMatrix = dagNode.matrix * dagNode.parentMatrix&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;.worldInverseMatrix&lt;/code&gt; : Inverse of worldMatrix instanced attribute.  Multiplying by this will place it at the world origin.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;code&gt;transform&lt;/code&gt; node's matrix related attrs:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;.xformMatrix&lt;/code&gt; :  Local transformation matrix. From the docs:  &quot;Contains the same information as the matrix attribute on dagNode but it is stored in a format that can be interpolated easily.&quot;.  Personally, I'm not sure what makes it more easy to interpolate.&lt;/li&gt;&lt;/ul&gt;It should be noted that on all these attrs you &lt;em&gt;can&lt;/em&gt; connect to or query their &lt;em&gt;outputs&lt;/em&gt;, but they &lt;em&gt;don't&lt;/em&gt; allow for input connections or modifications via &lt;code&gt;setAttr&lt;/code&gt;.&lt;br&gt;&lt;hr&gt;Notes on getting Matrix attr data:&lt;br&gt;&lt;blockquote&gt;Some attributes represent transformation matrices. Although these attributes are represented internally as 4x4 matrices, unfortunately, matrix attributes are not returned as MEL 4x4 matrix types. Instead, they are returned as an array of floats where the elements of the matrix are listed in row major order. For instance, &quot;matrix $m[4][4] = `getAttr ball.worldMatrix`;&quot; will not work. To obtain the value of a matrix attribute, you need something like &quot;float $m[16] = `getAttr ball.worldMatrix`;&quot;. &lt;br&gt;&lt;/blockquote&gt;These float arrays (for a 4x4 matrix) are indexed like this:&lt;br&gt;&lt;table class=&quot;twtable&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;0&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;2&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;4&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;5&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;6&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;7&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;evenRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;8&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;9&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;10&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;11&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;oddRow&quot;&gt;&lt;td align=&quot;center&quot;&gt;12&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;13&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;14&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;15&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr&gt;&lt;code&gt;xform&lt;/code&gt; command:&lt;br&gt;&lt;pre&gt;// Copy the worldspace matrix from pCube1 to pCube2:
// Using 'getAttr' on the .worldspaceMatrix, it calculates all
// scale operations based on all parental nodes as well.
// This can cause the target .shear attrs to be effected.
float $m[16] = `getAttr pCube1.worldMatrix`;
xform  -matrix $m[0] $m[1] $m[2] $m[3] 
		$m[4] $m[5] $m[6] $m[7] 
		$m[8] $m[9] $m[10] $m[11] 
		$m[12]$m[13] $m[14] $m[15] pCube2;

// you could optionally use this to get the matrix, via xform:
float $m[16] = `xform -query -matrix pCube1`;
// Which queries the .xformMatrix attr (see above), but this only 
// tracks the local scale values, not any extra parental scale
// values:  .shear attrs are not effected.
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Sets/returns the composite transformation matrix. *Note* the matrix is represented by 16 double arguments that are specified in row order. &lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;strong&gt;Matrix Nodes&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;decomposeMatrix&lt;/code&gt; (standard Maya plugin):&lt;ul&gt;&lt;li&gt;See Mel Wiki notes &lt;a tiddlylink=&quot;How can I have a node return the worldspace position of my object, offset in time?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I have a node return the worldspace position of my object, offset in time?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20have%20a%20node%20return%20the%20worldspace%20position%20of%20my%20object,%20offset%20in%20time?&quot; class=&quot;externalLink&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;addMatrix&lt;/code&gt;&lt;ul&gt;&lt;li&gt;Add a list of matrices together.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;fourByFourMatrix&lt;/code&gt;&lt;ul&gt;&lt;li&gt;This node outputs a 4x4 matrix based on 16 input values. This output matrix attribute can be connected to any attribute that is type &quot;matrix&quot;.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;holdMatrix&lt;/code&gt;&lt;ul&gt;&lt;li&gt;Cache a matrix.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;multMatrix&lt;/code&gt;&lt;ul&gt;&lt;li&gt;Multiply a list of matrices together.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;passMatrix&lt;/code&gt;&lt;ul&gt;&lt;li&gt;Multiply a matrix by a constant without caching anything&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;pointMatrixMult&lt;/code&gt;&lt;ul&gt;&lt;li&gt;The dependency graph node to multiply a point by a matrix.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;wtAddMatrix&lt;/code&gt;&lt;ul&gt;&lt;li&gt;Add a weighted list of matrices together.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Matrix Commands&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;pointMatrixMult&lt;/code&gt;   (mel)&lt;ul&gt;&lt;li&gt;This script returns the multiplication of a point and a matrix as an array of 3 doubles.  It is a wrapper around the &lt;code&gt;pointMatrixMult&lt;/code&gt; node, which the script actually creates, modifies, gathers the return value, and then deletes.&lt;/li&gt;&lt;li&gt;Located: &lt;code&gt;C:/Program Files/Autodesk/Maya&amp;lt;version&amp;gt;&amp;gt;/scripts/others/pointMatrixMult.mel&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;For &lt;em&gt;Python&lt;/em&gt; related matrix commands see:  &lt;a tiddlylink=&quot;Working with matrices with Python&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#Working with matrices with Python&quot; href=&quot;http://mayamel.tiddlyspot.com#Working%20with%20matrices%20with%20Python&quot; class=&quot;externalLink&quot;&gt;Working with matrices with Python&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;Syntax for authoring an identity transformation matrix:&lt;br&gt;&lt;pre&gt;matrix $m[4][4] = &amp;lt;&amp;lt;1, 0, 0, 0;
                    0, 1, 0, 0;
                    0, 0, 1, 0;
                    0, 0, 0, 1&amp;gt;&amp;gt;;
&lt;/pre&gt;&lt;hr&gt;Printing 4x4 matrix data:&lt;br&gt;&lt;pre&gt;float $goo[] = `getAttr myNode.worldMatrix`;

for($i=1;$i&amp;lt;size($goo)+1;$i++)
	{
	print ($goo[$i-1] + &quot; &quot;);
	if($i%4==0)
		print(&quot;\n&quot;);
	}
1 0 0 0 
0 1 0 0 
0 0 1 0 
0 0 0 1
&lt;/pre&gt;Using &lt;code&gt;getAttr&lt;/code&gt; on a matrix attr will return back a float array.  But when you want to do matrix math, you have to use the &lt;code&gt;matrix&lt;/code&gt; variable type.  These funtions will convert back and forth between the two:&lt;br&gt;&lt;pre&gt;global proc matrix floatArrayToMatrix(float $m[]){
	if(size($m) != 16)
		error(&quot;Please pass in a float array with exactly 16 elements&quot;);
	matrix $mat[4][4] = &amp;lt;&amp;lt;$m[0], $m[1], $m[2], $m[3];
					$m[4], $m[5], $m[6], $m[7];
					$m[8], $m[9], $m[10], $m[11];  
					$m[12], $m[13], $m[14], $m[15]&amp;gt;&amp;gt;; 
	return $mat;
	}
&lt;/pre&gt;&lt;pre&gt;global proc float[] matrixToFloatArray(matrix $m){
	float $return[] = {};
	for($row=0; $row&amp;lt;4; $row++){
		for($column=0; $column&amp;lt;4; $column++)
			$return[size($return)] = $m[$row][$column];
		}
	return $return;
	}
&lt;/pre&gt;&lt;hr&gt;Match the worldspaceMatrix of objectB to objectA:&lt;br&gt;&lt;pre&gt;string $source = &quot;pCube1&quot;;
string $destination = &quot;pCube2&quot;;

float $m[16] = `getAttr ($source+&quot;.worldMatrix&quot;)`;
xform -worldSpace  -matrix $m[0] $m[1] $m[2] $m[3] 
		$m[4] $m[5] $m[6] $m[7] 
		$m[8] $m[9] $m[10] $m[11] 
		$m[12]$m[13] $m[14] $m[15] $destination;
&lt;/pre&gt;This will work, no matter what any parental groups have done to the nodes.  Sweet.&lt;br&gt;&lt;hr&gt;Another snippet:&lt;br&gt;Have a destination node match the position of a hierarchy of source nodes.  In this scene, &quot;pCube1&quot; is parented to &quot;group1&quot;.  The below code will match the worldspace matrix of &quot;pCube2&quot; to the postion of &quot;pCube1&quot; by multiplying the local matrices of &quot;group1&quot; and &quot;pCube1&quot; together.&lt;br&gt;&lt;pre&gt;string $sourceParent = &quot;group1&quot;;
string $sourceChild= &quot;pCube1&quot;;
string $destination = &quot;pCube2&quot;;

// query the local matrix of the parent and child
matrix $matrixSP[4][4] = floatArrayToMatrix(`getAttr ($sourceParent+&quot;.matrix&quot;)`);
matrix $matrixSC[4][4] = floatArrayToMatrix(`getAttr ($sourceChild+&quot;.matrix&quot;)`);
// Generate our new  destination matrix, order is important!
matrix $dPos[4][4] = $matrixSC * $matrixSP;

float $m[16] = matrixToFloatArray($dPos);

xform -worldSpace  -matrix $m[0] $m[1] $m[2] $m[3] 
		$m[4] $m[5] $m[6] $m[7] 
		$m[8] $m[9] $m[10] $m[11] 
		$m[12]$m[13] $m[14] $m[15] $destination;
// it worked.  Trust me.
&lt;/pre&gt;</description>
<category>TRANSFORMATION</category>
<category>VARIABLES</category>
<category>matrix</category>
<category>inverseMatrix</category>
<category>worldMatrix</category>
<category>worldInverseMatrix</category>
<category>parentMatrix</category>
<category>parentInverseMatrix</category>
<category>xformMatrix</category>
<category>xform</category>
<category>decomposeMatrix</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BMatrix%20info%5D%5D</link>
<pubDate>Wed, 24 Feb 2010 02:36:00 GMT</pubDate>
</item>
<item>
<title>How can I create a RMB popup menu?</title>
<description>&lt;code&gt;popupMenu&lt;/code&gt;</description>
<category>UI</category>
<category>mouse</category>
<category>RMB</category>
<category>right mouse button</category>
<category>menu</category>
<category>popupMenu</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20create%20a%20RMB%20popup%20menu%3F%5D%5D</link>
<pubDate>Tue, 16 Feb 2010 19:22:00 GMT</pubDate>
</item>
<item>
<title>How can I find the min and max keyframe values for all objects in the scene?</title>
<description>Will return back a float array with two items, the [start, end] frames:&lt;br&gt;&lt;pre&gt;global proc float[] returnFrameRange(){
	select -r `ls -type &quot;animCurve&quot;`;
	return {float(`findKeyframe -which first`), float(`findKeyframe -which last`)};
}

float $frameRange[] = returnFrameRange();
// Result: 1 22 // 
&lt;/pre&gt;&lt;hr&gt;Also see:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I set the range slider to match the keyframe range on the selected object(s)?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I set the range slider to match the keyframe range on the selected object(s)?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20set%20the%20range%20slider%20to%20match%20the%20keyframe%20range%20on%20the%20selected%20object%28s%29?&quot; class=&quot;externalLink&quot;&gt;How can I set the range slider to match the keyframe range on the selected object(s)?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I find the min and max keyframe range for the provided objects?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I find the min and max keyframe range for the provided objects?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20find%20the%20min%20and%20max%20keyframe%20range%20for%20the%20provided%20objects?&quot; class=&quot;externalLink&quot;&gt;How can I find the min and max keyframe range for the provided objects?&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
<category>ANIMATION</category>
<category>animCurve</category>
<category>findKeyframe</category>
<category>keyframe</category>
<category>min</category>
<category>max</category>
<category>first</category>
<category>last</category>
<category>frame range</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20find%20the%20min%20and%20max%20keyframe%20values%20for%20all%20objects%20in%20the%20scene%3F%5D%5D</link>
<pubDate>Wed, 10 Feb 2010 01:44:00 GMT</pubDate>
</item>
<item>
<title>How can I find the min and max keyframe range for the provided objects?</title>
<description>I seem to do this just not quite often enough to remember how to do it, so I'll make a note here.&lt;br&gt;&lt;br&gt;Func returns a tuple containing the min and max frame range based on the list of nodes passed in.&lt;br&gt;&lt;pre&gt;# Python code
import maya.cmds as mc

def getMinMaxAnimRange(nodes):
    first = 0
    last = 0
    curves = mc.listConnections(nodes, source=True, destination=False, type='animCurve')
    if curves is not None:
        first = mc.findKeyframe(curves, which='first')
        last = mc.findKeyframe(curves, which='last')
    return (first, last)
&lt;/pre&gt;&lt;hr&gt;Also see:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I find the min and max keyframe values for all objects in the scene?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I find the min and max keyframe values for all objects in the scene?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20find%20the%20min%20and%20max%20keyframe%20values%20for%20all%20objects%20in%20the%20scene?&quot; class=&quot;externalLink&quot;&gt;How can I find the min and max keyframe values for all objects in the scene?&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
<category>ANIMATION</category>
<category>python</category>
<category>listConnections</category>
<category>findKeyframe</category>
<category>keyframe</category>
<category>min</category>
<category>max</category>
<category>first</category>
<category>last</category>
<category>frame range</category>
<category>animCurve</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20find%20the%20min%20and%20max%20keyframe%20range%20for%20the%20provided%20objects%3F%5D%5D</link>
<pubDate>Wed, 10 Feb 2010 01:43:00 GMT</pubDate>
</item>
<item>
<title>How can I pickle Python data to attributes?</title>
<description>I blogged about it here:&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.akeric.com/blog/?p=1049&quot; href=&quot;http://www.akeric.com/blog/?p=1049&quot; class=&quot;externalLink&quot;&gt;http://www.akeric.com/blog/?p=1049&lt;/a&gt;&lt;br&gt;&lt;hr&gt;And notes on the Python functions:&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://docs.python.org/library/pickle.html&quot; href=&quot;http://docs.python.org/library/pickle.html&quot; class=&quot;externalLink&quot;&gt;http://docs.python.org/library/pickle.html&lt;/a&gt;&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://docs.python.org/library/pickle.html#module-cPickle&quot; href=&quot;http://docs.python.org/library/pickle.html#module-cPickle&quot; class=&quot;externalLink&quot;&gt;http://docs.python.org/library/pickle.html#module-cPickle&lt;/a&gt;&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://docs.python.org/library/stringio.html#module-StringIO&quot; href=&quot;http://docs.python.org/library/stringio.html#module-StringIO&quot; class=&quot;externalLink&quot;&gt;http://docs.python.org/library/stringio.html#module-StringIO&lt;/a&gt;</description>
<category>PYTHON</category>
<category>ATTRIBUTES</category>
<category>pickle</category>
<category>cPickle</category>
<category>StringIO</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20pickle%20Python%20data%20to%20attributes%3F%5D%5D</link>
<pubDate>Tue, 09 Feb 2010 02:46:00 GMT</pubDate>
</item>
<item>
<title>GuestBook</title>
<description>&lt;strong&gt;The Mel Wiki Guest Book&lt;/strong&gt;&lt;br&gt;Since this wiki isn't opening to public editing (got too much spam), please email me your guest book entry, and I'll post it!  &lt;span&gt;&#8212;&lt;/span&gt; &lt;code&gt;warpcat&lt;/code&gt; (at) &lt;code&gt;sbcglobal&lt;/code&gt; (dot) &lt;code&gt;net&lt;/code&gt; &lt;span&gt;&#8212;&lt;/span&gt;&lt;br&gt;Please use this format in your mail:&lt;br&gt;&lt;pre&gt;Name\Handle:  Joe Bobson
Email (optional): joebob@bob.com
Comment:  Wow, what a great wiki!
&lt;/pre&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;Date: Feb 08, 2010&lt;br&gt;Name: Zhi Min Chen&lt;br&gt;Comment:  Great website.  I use it on a regular basis to help me on most my projects at work.  Your wiki's question format is very well thought out and it makes finding answers extremely quick.  Keep up the great work!&lt;br&gt;&lt;hr&gt;Date: Aug 15, 2008&lt;br&gt;Name: Ben Brac&lt;br&gt;Email: brac@sonic.net&lt;br&gt;Comment: Awesome wiki WarpCat! I use it all the time when the usual documentation leaves much to be desired. Keep the updates coming!&lt;br&gt;&lt;hr&gt;Date:  Aug 06, 2008&lt;br&gt;Name:  Bob Aunum&lt;br&gt;&quot;Thank you sincerely.  The subject says it all. since i decided to teach myself mel,  i've been looking for a good web resource, but i really didn't expect to find anything as elegantly functional as your wiki.  It's great. Really.&quot;&lt;br&gt;&lt;hr&gt;Date:  May 19th, 2008&lt;br&gt;Name:  Fridi K&#252;hn&lt;br&gt;I am a student from Germany and have recently started helping a games developer to automate their process of animating.  Since I am a beginner to MEL I wanted to state that your mel wiki helped me alot to overcome the mysteries of that language.  I just wanted to thank you for your website and hope you will keep it alive! Please know that I will frequently return and see what's new...&lt;br&gt;&lt;hr&gt;</description>
<category>wiki</category>
<link>http://mayamel.tiddlyspot.com#GuestBook</link>
<pubDate>Mon, 08 Feb 2010 23:38:00 GMT</pubDate>
</item>
<item>
<title>How can I get a list of set membership in the proper order every time?</title>
<description>&lt;pre&gt;listConnections -s 1 -d 0 -p 0 -c 0 &quot;setName&quot;;
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Note: Often times, one would think they could simply select the set, and use the &lt;code&gt;ls&lt;/code&gt; command to get an array of membership. The problem is, the &lt;code&gt;ls&lt;/code&gt; command will return them in a different order than the Outliner may show. Furthermore, the order seems to change from time to time (hard to confirm this). When an item is &quot;added&quot; to a set, what's actually happening is the set has a new attribute generated, and that attr is connecting to the object. By using the &quot;listConnections&quot; command, we can get a list, in order, of all the attribute connections. The order still may be different than what's shown in the Outliner, but at least it should be consistant.&lt;/li&gt;&lt;li&gt;There is only one caveat: The listConnections command will return DG objects in a set before it lists DAG objects. If you don't have mixed data types in your sets, then there is no issue. However, if you have both DG and DAG objects in the set, then you still could run into future problems of shifting order in the return value.&lt;/li&gt;&lt;/ul&gt;</description>
<category>SELECTION</category>
<category>set</category>
<category>sets</category>
<category>membership</category>
<category>listConnections</category>
<category>order</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20get%20a%20list%20of%20set%20membership%20in%20the%20proper%20order%20every%20time%3F%5D%5D</link>
<pubDate>Mon, 01 Feb 2010 22:10:00 GMT</pubDate>
</item>
<item>
<title>How can I have Wing send Python or mel code to Maya?</title>
<description>I using &lt;a tiddlylink=&quot;For Python: Maya 'Script Editor' style IDE&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#For Python: Maya 'Script Editor' style IDE&quot; href=&quot;http://mayamel.tiddlyspot.com#For%20Python:%20Maya%20%27Script%20Editor%27%20style%20IDE&quot; class=&quot;externalLink&quot;&gt;Wing IDE&lt;/a&gt; for authoring Python and mel code for Maya, and have come up with a solution (presuming you have the 'Professional' version of Wing) to have the code you &lt;span class=&quot;marked&quot;&gt;highlight in Wing&lt;/span&gt; &lt;em&gt;execute in Maya&lt;/em&gt; (aka 'evaluate selection').  This lets me completely replace the Script Editor when authoring Python or mel, which we all know doesn't have the best Python integration... :-S&lt;br&gt;&lt;blockquote&gt;I've added some updated code below that now allows you to publish &lt;strong&gt;mel&lt;/strong&gt; code from Wing to Maya as well.&lt;br&gt;&lt;blockquote&gt;Note that you can also have Wing recognize &lt;code&gt;.mel&lt;/code&gt; files, with &lt;em&gt;some&lt;/em&gt; (not full) context sensitive highlighting, correct indentation, scope hilighting, etc:  Under Wing 'Prefs -&amp;gt; Files -&amp;gt; File Types', 'insert' a new file type as &lt;code&gt;mel&lt;/code&gt; and set its 'Mime Type' to be &lt;code&gt;C++ Source&lt;/code&gt;.  &lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;There are a few steps involved to get this working.  I should point out again this only works with the 'Professional' version of Wing, and you'll need Maya v8.5 or &lt;em&gt;newer&lt;/em&gt;: when Maya started supporting Python (below this section I list some old code, for version of Maya8.5 and earlier.)&lt;br&gt;&lt;hr&gt;&lt;strong&gt;1.&lt;/strong&gt;  In Maya's &lt;code&gt;userSetup.mel&lt;/code&gt; file, add this line to open a network socket.  This will later let Wing talk with Maya.&lt;br&gt;&lt;pre&gt;// userSetup.mel
commandPort -name &quot;:6000&quot; -echoOutput;
&lt;/pre&gt;It appears, if you're running Maya on Vista \ 64bit, or maybe it's a Maya2010 thing, you need to call to &lt;code&gt;commandPort&lt;/code&gt; twice to get this working, otherwise your socket will later be refused:&lt;br&gt;&lt;pre&gt;// userSetup.mel
commandPort -name &quot;127.0.0.1:6000&quot; -echoOutput;
commandPort -name &quot;:6000&quot; -echoOutput;
&lt;/pre&gt;For whatever reason, having your &lt;code&gt;userSetup.py&lt;/code&gt; execute these commands instead won't let the below process work.  This really confuses me, since Maya claims the port is open.  But Wing says the port is refused.... &lt;br&gt;&lt;hr&gt;&lt;strong&gt;2.&lt;/strong&gt;  This Wing Python module (&lt;code&gt;wingHotkeys.py&lt;/code&gt;) and functions inside are authored to do a few things:  &lt;br&gt;&lt;ul&gt;&lt;li&gt; A.  Save the text selected in Wing as a temp file on disk.  &lt;/li&gt;&lt;li&gt; B.  Ping Maya through the opened command port, and tell Maya to execute the contents of that file.  Depending on the type of data sent, either Python or mel, the tool will tell Maya how to intercept it, and execute it.&lt;/li&gt;&lt;/ul&gt;Again, this code is tailored to Wing IDE's API, and saved as part of that program's own &quot;scripts&quot; directory.  Default location (on winXP) of that dir is here:&lt;br&gt;&lt;pre&gt;C:\Documents and Settings\&amp;lt;userName&amp;gt;\Application Data\Wing IDE 3\scripts
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;send_to_maya()&lt;/code&gt; :  Function that does the heavy lifting&lt;/li&gt;&lt;li&gt;&lt;code&gt;python_to_maya()&lt;/code&gt; :  Wrapper to send the code as Python to Maya.  I have this mapped to &lt;code&gt;ctrl+p&lt;/code&gt;.  (Wing hotkeys don't allow args, so you need to author wrapper functions)&lt;/li&gt;&lt;li&gt;&lt;code&gt;mel_to_maya()&lt;/code&gt; :  Wrapper to send the code as mel to Maya.  I have this mapped to &lt;code&gt;ctrl+m&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;If you already have a &lt;code&gt;wingHotkeys.py&lt;/code&gt; module for Wing, you can just add the below code to it:&lt;br&gt;&lt;pre&gt;# wingHotkeys.py
# Author:  Eric Pavey - warpcat@sbcglobal.net

import wingapi
import socket
import os

def getWingText():
   &quot;&quot;&quot;
   Based on the Wing API, get the selected text, and return it
   &quot;&quot;&quot;
   editor = wingapi.gApplication.GetActiveEditor()
   if editor is None:
      return
   doc = editor.GetDocument()
   start, end = editor.GetSelection()
   txt = doc.GetCharRange(start, end)
   return txt

def send_to_maya(language):
   &quot;&quot;&quot;
   Send the selected code to be executed in Maya

   language : string : either 'mel' or 'python'
   &quot;&quot;&quot;
   if language != &quot;mel&quot; and language != &quot;python&quot;:
      raise ValueError(&quot;Expecting either 'mel' or 'python'&quot;)

   # Save the text to a temp file.  If we're dealing with mel, make sure it
   # ends with a semicolon, or Maya could become angered!
   txt = getWingText()
   if language == 'mel':
      if not txt.endswith(';'):
         txt += ';'
   tempFile = os.path.join(os.environ['TMP'], 'wingData.txt')
   f = open(tempFile, &quot;w&quot;)
   f.write(txt)
   f.close()

   # Tell Maya to execute the temp file:
   maya = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   #Optional way of doing it, if using Vista:
   #maya = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
   try:
      # Sometimes connect likes to complain, not sure why
      maya.connect((&quot;127.0.0.1&quot;, 6000))
      # Optional way of doing it, if using Vista:
      # maya.connect((&quot;::1&quot;,6000))
      if language == &quot;mel&quot;:
         maya.send('execMelCode();')
      if language == &quot;python&quot;:
         maya.send('python(&quot;import execPythonCode; execPythonCode.main()&quot;)')
   except:
      maya.close()
   maya.close()

def python_to_maya():
   &quot;&quot;&quot;Send the selected Python code to Maya&quot;&quot;&quot;
   send_to_maya('python')

def mel_to_maya():
   &quot;&quot;&quot;Send the selected code to Maya as mel&quot;&quot;&quot;
   send_to_maya('mel')
&lt;/pre&gt;&lt;hr&gt;&lt;strong&gt;3.&lt;/strong&gt;  This Python module &lt;code&gt;execPythonCode.py&lt;/code&gt; is the one Wing's &lt;code&gt;send_to_maya('python')&lt;/code&gt; function (above, step 2) triggers:  In &lt;em&gt;Maya&lt;/em&gt;, it uses the Python &lt;code&gt;exec&lt;/code&gt; command to execute the code in the file saved on disk.  &lt;br&gt;Be sure to save this in a location seen by &lt;em&gt;Maya's&lt;/em&gt; Python path.&lt;br&gt;&lt;pre&gt;# execPythonCode.py
# Author:  Eric Pavey - warpcat@sbcglobal.net

import __main__
import os

def main():
    &quot;&quot;&quot;
    exec the temp file on disk, in Maya
    &quot;&quot;&quot;
    tempFile = os.path.join(os.environ['TEMP'], 'wingData.txt')
    if os.access(tempFile , os.F_OK):
        # open and print the file in Maya:
        f =  open(tempFile , &quot;r&quot;)
        lines = f.readlines()
        for line in lines:
            print line.rstrip()
        f.close()
        print &quot;\n&quot;,
        # execute the file contents in Maya:
        f = open(tempFile , &quot;r&quot;)
        exec(f, __main__.__dict__, __main__.__dict__)
        f.close()
    else:
        print &quot;No temp file exists: &quot; + tempFile
&lt;/pre&gt;The key here, is the &lt;code&gt;exec&lt;/code&gt; command updating the &lt;code&gt;__main__.__dict__&lt;/code&gt; dictionary with any defined variable names passed in from Wing.  It is effectively adding them to the 'main', or 'builtin' scope of Python.  If this &lt;em&gt;doesn't&lt;/em&gt; happen, after the code is executed, you won't be able to access any variables created\changed from within Maya.&lt;br&gt;&lt;hr&gt;&lt;strong&gt;4.&lt;/strong&gt; This &lt;em&gt;mel script&lt;/em&gt; allows for the temp file saved by Wing to be executed as &lt;strong&gt;mel&lt;/strong&gt; in Maya.  It to is triggered via the Wing &lt;code&gt;send_to_maya('mel')&lt;/code&gt; Python function.&lt;br&gt;Be sure it is saved as part of Maya's script path.&lt;br&gt;&lt;pre&gt;// execMelCode.mel
// Author:  Eric Pavey - warpcat@sbcglobal.net

global proc execMelCode(){
    string $tempFile = (`getenv &quot;TMP&quot;`+&quot;/wingData.txt&quot;);
    if (`filetest -f $tempFile`){
        // open and print the file in Maya:
        int $fid = `fopen $tempFile &quot;r&quot;`;
        string $line = `fgetline $fid`;
        string $printer = strip($line);
        if(size($printer) &amp;gt; 0){
            print $line;
        }
        while ( size($line) &amp;gt; 0){
            $line = `fgetline $fid`;
            $printer = strip($line);
            if(size($printer) &amp;gt; 0){
                print $line;
            }
        }
        fclose $fid;
        print &quot;\n&quot;;
        eval(&quot;source \&quot;&quot;+$tempFile+&quot;\&quot;&quot;);
    }
    else{
        print (&quot;No temp file exists: &quot; + $tempFile + &quot;\n&quot;);
    }
}
&lt;/pre&gt;We jump through some hoops to get it printed correctly, and at the end, we simply &lt;code&gt;source&lt;/code&gt; the script to execute its contents.&lt;br&gt;&lt;hr&gt;&lt;strong&gt;5.&lt;/strong&gt;  That's it:  You can now highlight code in Wing (either Python or mel), and via a wing hotkey, have it execute directly in Maya.  I use it &lt;u&gt;every day&lt;/u&gt;...&lt;br&gt;&lt;hr&gt;&lt;strong&gt;Older methods:&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt;For Maya versions 8 and &lt;em&gt;earlier&lt;/em&gt; (Maya 8.5 has Python embedded, yah!)&lt;/li&gt;&lt;li&gt;Thanks to Hamish McKenzie &quot;&lt;em&gt;macaroniKazoo&lt;/em&gt;&quot; on highend3d.com&lt;/li&gt;&lt;li&gt;First, in Maya, create an INET domain on the local host at the command port: &lt;ul&gt;&lt;li&gt;Win2000 syntax is &quot;&lt;code&gt;computerName:portNumber&lt;/code&gt;&quot;, I've wondered why you don't have to specify the computerName here?&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;commandPort -n &quot;:5055&quot;;
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Second, in Python:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;import socket
maya = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
maya.connect((&quot;127.0.0.1&quot;, 5055))
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Then, to actually have Python talk to Maya:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;maya.send('print &quot;I am typing in Python, but I see it in Maya!\\n&quot;;')
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Of course, you have to embed your &lt;em&gt;mel commands&lt;/em&gt; in the Python syntax. &lt;/li&gt;&lt;li&gt;Python library docs on 'socket' &lt;a target=&quot;_blank&quot; title=&quot;External link to http://docs.python.org/lib/module-socket.html&quot; href=&quot;http://docs.python.org/lib/module-socket.html&quot; class=&quot;externalLink&quot;&gt;HERE&lt;/a&gt;&lt;/li&gt;&lt;li&gt;What's so special about '127.0.0.1'? Check Wikipedia &lt;a target=&quot;_blank&quot; title=&quot;External link to http://en.wikipedia.org/wiki/127.0.0.1&quot; href=&quot;http://en.wikipedia.org/wiki/127.0.0.1&quot; class=&quot;externalLink&quot;&gt;HERE&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
<category>PYTHON</category>
<category>NETWORKING</category>
<category>python</category>
<category>userSetup.py</category>
<category>commandPort</category>
<category>socket</category>
<category>socket.socket</category>
<category>socket.connect</category>
<category>socket.send</category>
<category>os</category>
<category>os.access</category>
<category>open</category>
<category>open.readlines</category>
<category>open.close</category>
<category>exec</category>
<category>__main__</category>
<category>wing</category>
<category>network</category>
<category>evaluate selection</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20have%20Wing%20send%20Python%20or%20mel%20code%20to%20Maya%3F%5D%5D</link>
<pubDate>Mon, 01 Feb 2010 21:52:00 GMT</pubDate>
</item>
<item>
<title>For Python: Maya 'Script Editor' style IDE</title>
<description>I've been looking for a LONG time, trying to find an IDE for Python that mirrored &lt;em&gt;one&lt;/em&gt; important feature from Maya's Script Editor:  &lt;strong&gt;Evaluate Selection&lt;/strong&gt;, which is the ability to highlight blocks of code, and execute just that block interactively.  &lt;br&gt;&lt;br&gt;&lt;em&gt;Maya's&lt;/em&gt; implementation of Python in the Script Editor can do this (since version 8.5), but what if you want to author Python &lt;em&gt;outside&lt;/em&gt; of Maya, but still have this functionality?&lt;br&gt;&lt;br&gt;After asking a lot of people, and doing a lot of searching, I finally found Wing:&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.wingware.com/&quot; href=&quot;http://www.wingware.com/&quot; class=&quot;externalLink&quot;&gt;http://www.wingware.com/&lt;/a&gt;&lt;br&gt;&lt;img src=&quot;https://wingware.com/images/wingide2-personal-screenshot-qtr.png&quot;&gt;&lt;br&gt;&lt;strong&gt;Wings docs on integrating with Maya&lt;/strong&gt; &lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.wingware.com/doc/howtos/maya&quot; href=&quot;http://www.wingware.com/doc/howtos/maya&quot; class=&quot;externalLink&quot;&gt;here&lt;/a&gt; (which actually links back to this page :-) )&lt;br&gt;It has three versions:&lt;br&gt;&lt;ul&gt;&lt;li&gt;Wing IDE 101 (free, but &lt;em&gt;doesn't&lt;/em&gt; have 'Evaluate Selection')&lt;ul&gt;&lt;li&gt;Update:  It appears you can hack it:  I saw this post in a forum, from Wingware itself:&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;It looks like the keyboard config pref is omitted in 101.  You could&lt;br&gt;hack it by editing the keyboard.normal file in the Wing installation&lt;br&gt;and adding:&lt;br&gt;&lt;code&gt;'Ctrl-F5': 'evaluate-file-in-shell'&lt;/code&gt;&lt;br&gt;Or to evaluate the current selection:&lt;br&gt;&lt;code&gt;'Ctrl-Shift-F5': 'evaluate-sel-in-shell'&lt;/code&gt;&lt;br&gt;You'll need to restart Wing to read those and you can of course alter&lt;br&gt;the bindings.  Also, if you're using one of the other keyboard&lt;br&gt;personalities you should edit the associated keyboard.* file instead.&lt;br&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Wing IDE Personal ($35)&lt;/li&gt;&lt;li&gt;Wing IDE Professional ($179 - Lets you access the Wing API via Python, to write your own plugins for the tool + other features)&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;Compare version features:&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.wingware.com/wingide/features&quot; href=&quot;http://www.wingware.com/wingide/features&quot; class=&quot;externalLink&quot;&gt;http://www.wingware.com/wingide/features&lt;/a&gt;&lt;br&gt;&lt;hr&gt;More Wing Goodness:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I have Wing send Python or mel code to Maya?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I have Wing send Python or mel code to Maya?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20have%20Wing%20send%20Python%20or%20mel%20code%20to%20Maya?&quot; class=&quot;externalLink&quot;&gt;How can I have Wing send Python or mel code to Maya?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;Remote Python debugging in Wing&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#Remote Python debugging in Wing&quot; href=&quot;http://mayamel.tiddlyspot.com#Remote%20Python%20debugging%20in%20Wing&quot; class=&quot;externalLink&quot;&gt;Remote Python debugging in Wing&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;Notes:&lt;br&gt;&lt;ul&gt;&lt;li&gt;Wing itself runs a different version of Python than you may have installed.  The current version of Wing (as of this update) runs Python 2.5.4.  This is only really important if you get the &quot;Pro&quot; version, and start making your own 'plugin scripts':  The plugins you author will be running Wings version of Python, not your installed version of Python.  Furthermore, the Wing distribution isn't the full install of Python, so not all modules are available.  This isn't a huge deal, but it's important to be aware of if your plugins don't work.  For example, I had one that called to the &lt;code&gt;webbrowser&lt;/code&gt; module:  That module isn't distributed with Wing.  Luckily, they have their own function (&lt;code&gt;wingapi.gApplication.OpenURL(url)&lt;/code&gt;) that could be used in its place.&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;Also see:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I execute Maya's version of Python outside of Maya?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I execute Maya's version of Python outside of Maya?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20execute%20Maya%27s%20version%20of%20Python%20outside%20of%20Maya?&quot; class=&quot;externalLink&quot;&gt;How can I execute Maya's version of Python outside of Maya?&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Also&lt;/strong&gt;, as of v1.7 of the 'jEdit Maya Editor Plugin' (see:  &lt;a tiddlylink=&quot;Script Editor Replacements&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#Script Editor Replacements&quot; href=&quot;http://mayamel.tiddlyspot.com#Script%20Editor%20Replacements&quot; class=&quot;externalLink&quot;&gt;Script Editor Replacements&lt;/a&gt;), this 'evaluate selection' functionality has been implemented (as informed by its author).&lt;br&gt;</description>
<category>PYTHON</category>
<category>ide</category>
<category>script editor</category>
<category>wing</category>
<category>evaluate selection</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BFor%20Python%3A%20Maya%20'Script%20Editor'%20style%20IDE%5D%5D</link>
<pubDate>Fri, 22 Jan 2010 18:28:00 GMT</pubDate>
</item>
<item>
<title>Source Analysis in Wing</title>
<description>&lt;span class=&quot;marked&quot;&gt;NOTE:&lt;/span&gt;  Wing has been updating their own tutorials on this, take a look at them here:&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.wingware.com/doc/howtos/maya&quot; href=&quot;http://www.wingware.com/doc/howtos/maya&quot; class=&quot;externalLink&quot;&gt;http://www.wingware.com/doc/howtos/maya&lt;/a&gt;&lt;br&gt;A some of &lt;em&gt;their&lt;/em&gt; tutorial came from my troubleshooting with their support team (which is great by the way), and actually links back to this wiki :-)&lt;br&gt;The tutorial below were steps I was taking to get this working.  &lt;br&gt;&lt;br&gt;&lt;hr&gt;Tutorial done on Windows Vista.&lt;br&gt;This will get 'source analysis' of the Maya API working in Wing.  Will allow for such nice things as auto-completion.  Here are some links I found on the subject, but none of them got me exactly to where I needed to be.  But they all helped ;)&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://wingide.com/doc/edit/helping-wing-analyze-code&quot; href=&quot;http://wingide.com/doc/edit/helping-wing-analyze-code&quot; class=&quot;externalLink&quot;&gt;http://wingide.com/doc/edit/helping-wing-analyze-code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://wingware.com/pipermail/wingide-users/2008-May/005398.html&quot; href=&quot;http://wingware.com/pipermail/wingide-users/2008-May/005398.html&quot; class=&quot;externalLink&quot;&gt;http://wingware.com/pipermail/wingide-users/2008-May/005398.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://groups.google.com/group/python_inside_maya/browse_thread/thread/8f0923d15747aa8e?pli=1&quot; href=&quot;http://groups.google.com/group/python_inside_maya/browse_thread/thread/8f0923d15747aa8e?pli=1&quot; class=&quot;externalLink&quot;&gt;http://groups.google.com/group/python_inside_maya/browse_thread/thread/8f0923d15747aa8e?pli=1&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h1&gt;Get the API OpenMaya calls working:&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;Make 'pi file' dir here:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;C:\Users\epavey\AppData\Roaming\Wing IDE 3\pi-files\maya
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Copy the Wing-made .pi files to that dir from here:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;C:\Users\epavey\AppData\Local\Wing IDE 3\pi-cache\2.6\C\Program Files\Autodesk\Maya2010\Python\Lib\site-packages\maya
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Remove all the underscores from the front of the .pi files:&lt;ul&gt;&lt;li&gt;&lt;code&gt;_OpenMaya.pi&lt;/code&gt; rename to &lt;code&gt;OpenMaya.pi&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;In Wing's prefs, go : Source Analysis -&amp;gt; Advanced -&amp;gt; Interface File Path -&amp;gt; Insert.&lt;ul&gt;&lt;li&gt;And add the directory you made above.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Restart Wing&lt;/li&gt;&lt;li&gt;Now, when you enter the below code, Wing should start to auto-populate the command list:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;import  maya.OpenMaya as om
om. # &amp;lt;-- Wing should now populate that attribute list.
&lt;/pre&gt;Note, it seems like the below &lt;em&gt;won't&lt;/em&gt; work.  You need to use the above example:&lt;br&gt;&lt;pre&gt;import maya.OpenMaya
maya.OpenMaya. # &amp;lt;-- no auto-complete :(
&lt;/pre&gt;&lt;h1&gt;Get the mel.cmds calls working:&lt;/h1&gt;At the time of this authoring, it appears that it's a 'bug' in Wing that doesn't let it see the maya.cmds pacakge.  However, after working with Wing they made a patch, that should be available in future versions.  So the below data really doesn't have any effect... yet...&lt;br&gt;&lt;ul&gt;&lt;li&gt;You'll need to make your own .pi file for the &lt;code&gt;maya.cmds&lt;/code&gt; package.  To do that, first you'll have to get Maya running &lt;em&gt;inside&lt;/em&gt; of wing.  See this wiki post: &lt;a tiddlylink=&quot;How can I execute Maya's version of Python outside of Maya?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I execute Maya's version of Python outside of Maya?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20execute%20Maya%27s%20version%20of%20Python%20outside%20of%20Maya?&quot; class=&quot;externalLink&quot;&gt;How can I execute Maya's version of Python outside of Maya?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Use this code to auto-generate the .pi file.  You can see my blog post &lt;a target=&quot;_blank&quot; title=&quot;External link to http://www.akeric.com/blog/?p=828&quot; href=&quot;http://www.akeric.com/blog/?p=828&quot; class=&quot;externalLink&quot;&gt;here&lt;/a&gt; on more of the specifics.&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;import maya.cmds as mc

filepath = 'c:/temp/cmds.pi'
f = open(filepath, mode='w')

for k in sorted(mc.__dict__.keys()):
    f.write('def %s():\n'%k)
    f.write('    pass\n')
    f.write('\n')
f.close()
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Copy the &lt;code&gt;cmds.pi&lt;/code&gt; file to the directory you made above under 'Get the API OpenMaya calls working'.&lt;/li&gt;&lt;li&gt;And then.... (currently not working.... )&lt;/li&gt;&lt;/ul&gt;</description>
<category>UI</category>
<category>API</category>
<category>pi</category>
<category>OpenMaya</category>
<category>ide</category>
<category>wing</category>
<category>source analysis</category>
<category>maya.cmds</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BSource%20Analysis%20in%20Wing%5D%5D</link>
<pubDate>Fri, 22 Jan 2010 18:26:00 GMT</pubDate>
</item>
<item>
<title>How can I specify 'all keys' when cutting or pasting in Python?</title>
<description>In mel, when copying or pasting all keframes, the syntax is pretty simple (replace &lt;code&gt;...&lt;/code&gt; with the rest of the command code):&lt;br&gt;&lt;pre&gt;cutKey -time &quot;:&quot; ... ;
&lt;/pre&gt;And even the Python command docs say this:&lt;br&gt;&lt;blockquote&gt;&lt;code&gt;-time &quot;:&quot;&lt;/code&gt; is a short form to specify all keys.&lt;br&gt;&lt;/blockquote&gt;But that's not how the Python formatting actually works.&lt;br&gt;Per Maya Docs -&amp;gt; User Guide -&amp;gt; General -&amp;gt; Python -&amp;gt; Using Python -&amp;gt; Ranges -&amp;gt;&lt;br&gt;You need to specify the time settings in this format:&lt;br&gt;&lt;pre&gt;mc.cutKey(time=(&quot;:&quot;,), ...)
&lt;/pre&gt;</description>
<category>PYTHON</category>
<category>TROUBLESHOOTING</category>
<category>ANIMATION</category>
<category>cutKey</category>
<category>pasteKey</category>
<category>keyframe</category>
<category>:</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20specify%20'all%20keys'%20when%20cutting%20or%20pasting%20in%20Python%3F%5D%5D</link>
<pubDate>Wed, 20 Jan 2010 21:42:00 GMT</pubDate>
</item>
<item>
<title>2010 01 20</title>
<description>Added the &lt;a tiddlylink=&quot;HARDWARE&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#HARDWARE&quot; href=&quot;http://mayamel.tiddlyspot.com#HARDWARE&quot; class=&quot;externalLink&quot;&gt;HARDWARE&lt;/a&gt; category.  Currently only has one item.  But it's a cool item.  I'm not sure how I'd use it, but I think it deserves its own category ;)</description>
<category>blog</category>
<link>http://mayamel.tiddlyspot.com#%5B%5B2010%2001%2020%5D%5D</link>
<pubDate>Wed, 20 Jan 2010 21:37:00 GMT</pubDate>
</item>
<item>
<title>Blog</title>
<description>&lt;div style=&quot;overflow: hidden; position: relative; z-index: 0;&quot; class=&quot;gradient&quot;&gt;&lt;div style=&quot;position: absolute; left: 0%; top: 0pt; width: 101%; height: 100%; z-index: -1; background-color: rgb(255, 255, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 2%; top: 0pt; width: 99%; height: 100%; z-index: -1; background-color: rgb(253, 253, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 4%; top: 0pt; width: 97%; height: 100%; z-index: -1; background-color: rgb(252, 252, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 6%; top: 0pt; width: 95%; height: 100%; z-index: -1; background-color: rgb(250, 250, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 8%; top: 0pt; width: 93%; height: 100%; z-index: -1; background-color: rgb(249, 249, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 10%; top: 0pt; width: 91%; height: 100%; z-index: -1; background-color: rgb(248, 248, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 12%; top: 0pt; width: 89%; height: 100%; z-index: -1; background-color: rgb(246, 246, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 14%; top: 0pt; width: 87%; height: 100%; z-index: -1; background-color: rgb(245, 245, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 16%; top: 0pt; width: 85%; height: 100%; z-index: -1; background-color: rgb(244, 244, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 18%; top: 0pt; width: 83%; height: 100%; z-index: -1; background-color: rgb(242, 242, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 20%; top: 0pt; width: 81%; height: 100%; z-index: -1; background-color: rgb(241, 241, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 22%; top: 0pt; width: 79%; height: 100%; z-index: -1; background-color: rgb(240, 240, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 24%; top: 0pt; width: 77%; height: 100%; z-index: -1; background-color: rgb(238, 238, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 26%; top: 0pt; width: 75%; height: 100%; z-index: -1; background-color: rgb(237, 237, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 28%; top: 0pt; width: 73%; height: 100%; z-index: -1; background-color: rgb(235, 235, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 30%; top: 0pt; width: 71%; height: 100%; z-index: -1; background-color: rgb(234, 234, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 32%; top: 0pt; width: 69%; height: 100%; z-index: -1; background-color: rgb(233, 233, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 34%; top: 0pt; width: 67%; height: 100%; z-index: -1; background-color: rgb(231, 231, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 36%; top: 0pt; width: 65%; height: 100%; z-index: -1; background-color: rgb(230, 230, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 38%; top: 0pt; width: 63%; height: 100%; z-index: -1; background-color: rgb(229, 229, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 40%; top: 0pt; width: 61%; height: 100%; z-index: -1; background-color: rgb(227, 227, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 42%; top: 0pt; width: 59%; height: 100%; z-index: -1; background-color: rgb(226, 226, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 44%; top: 0pt; width: 57%; height: 100%; z-index: -1; background-color: rgb(225, 225, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 46%; top: 0pt; width: 55%; height: 100%; z-index: -1; background-color: rgb(223, 223, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 48%; top: 0pt; width: 53%; height: 100%; z-index: -1; background-color: rgb(222, 222, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 50%; top: 0pt; width: 51%; height: 100%; z-index: -1; background-color: rgb(221, 221, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 52%; top: 0pt; width: 49%; height: 100%; z-index: -1; background-color: rgb(217, 217, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 54%; top: 0pt; width: 47%; height: 100%; z-index: -1; background-color: rgb(214, 214, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 56%; top: 0pt; width: 45%; height: 100%; z-index: -1; background-color: rgb(210, 210, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 58%; top: 0pt; width: 43%; height: 100%; z-index: -1; background-color: rgb(207, 207, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 60%; top: 0pt; width: 41%; height: 100%; z-index: -1; background-color: rgb(204, 204, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 62%; top: 0pt; width: 39%; height: 100%; z-index: -1; background-color: rgb(200, 200, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 64%; top: 0pt; width: 37%; height: 100%; z-index: -1; background-color: rgb(197, 197, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 66%; top: 0pt; width: 35%; height: 100%; z-index: -1; background-color: rgb(193, 193, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 68%; top: 0pt; width: 33%; height: 100%; z-index: -1; background-color: rgb(190, 190, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 70%; top: 0pt; width: 31%; height: 100%; z-index: -1; background-color: rgb(187, 187, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 72%; top: 0pt; width: 29%; height: 100%; z-index: -1; background-color: rgb(183, 183, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 74%; top: 0pt; width: 27%; height: 100%; z-index: -1; background-color: rgb(180, 180, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 76%; top: 0pt; width: 25%; height: 100%; z-index: -1; background-color: rgb(176, 176, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 78%; top: 0pt; width: 23%; height: 100%; z-index: -1; background-color: rgb(173, 173, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 80%; top: 0pt; width: 21%; height: 100%; z-index: -1; background-color: rgb(170, 170, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 82%; top: 0pt; width: 19%; height: 100%; z-index: -1; background-color: rgb(166, 166, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 84%; top: 0pt; width: 17%; height: 100%; z-index: -1; background-color: rgb(163, 163, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 86%; top: 0pt; width: 15%; height: 100%; z-index: -1; background-color: rgb(159, 159, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 88%; top: 0pt; width: 13%; height: 100%; z-index: -1; background-color: rgb(156, 156, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 90%; top: 0pt; width: 11%; height: 100%; z-index: -1; background-color: rgb(153, 153, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 92%; top: 0pt; width: 9%; height: 100%; z-index: -1; background-color: rgb(149, 149, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 94%; top: 0pt; width: 7%; height: 100%; z-index: -1; background-color: rgb(146, 146, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 96%; top: 0pt; width: 5%; height: 100%; z-index: -1; background-color: rgb(142, 142, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 98%; top: 0pt; width: 3%; height: 100%; z-index: -1; background-color: rgb(139, 139, 255);&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; left: 100%; top: 0pt; width: 1%; height: 100%; z-index: -1; background-color: rgb(136, 136, 255);&quot;&gt;&lt;/div&gt;&lt;br&gt;The mel wiki blog.&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2010 01 20&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2010 01 20&quot; href=&quot;http://mayamel.tiddlyspot.com#2010%2001%2020&quot; class=&quot;externalLink&quot;&gt;2010 01 20&lt;/a&gt; - Added the HARDWARE category.&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2010 01 13&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2010 01 13&quot; href=&quot;http://mayamel.tiddlyspot.com#2010%2001%2013&quot; class=&quot;externalLink&quot;&gt;2010 01 13&lt;/a&gt; - Added the INFO category.&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2009 05 13&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2009 05 13&quot; href=&quot;http://mayamel.tiddlyspot.com#2009%2005%2013&quot; class=&quot;externalLink&quot;&gt;2009 05 13&lt;/a&gt; - Added API category&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 11 19&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 11 19&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2011%2019&quot; class=&quot;externalLink&quot;&gt;2008 11 19&lt;/a&gt; - Updated Python tagging&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 08 14&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 08 14&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2008%2014&quot; class=&quot;externalLink&quot;&gt;2008 08 14&lt;/a&gt; - Created the Mel Wiki Guest Book&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 07 05&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 07 05&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2007%2005&quot; class=&quot;externalLink&quot;&gt;2008 07 05&lt;/a&gt; - A new mel tiddlywiki online!&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 06 08&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 06 08&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2006%2008&quot; class=&quot;externalLink&quot;&gt;2008 06 08&lt;/a&gt; - Blog about my new blog (blog blog blog)&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 05 21&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 05 21&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2005%2021&quot; class=&quot;externalLink&quot;&gt;2008 05 21&lt;/a&gt; - tiddlywiki upgraded&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 05 20&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 05 20&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2005%2020&quot; class=&quot;externalLink&quot;&gt;2008 05 20&lt;/a&gt; - Python Wiki!&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 03 31&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 03 31&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2003%2031&quot; class=&quot;externalLink&quot;&gt;2008 03 31&lt;/a&gt; - More Processing.&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 03 11&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 03 11&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2003%2011&quot; class=&quot;externalLink&quot;&gt;2008 03 11&lt;/a&gt; - Added 'Other Links'&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 03 07&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 03 07&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2003%2007&quot; class=&quot;externalLink&quot;&gt;2008 03 07&lt;/a&gt; - Added the TROUBLESHOOTING category.&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 02 18&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 02 18&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2002%2018&quot; class=&quot;externalLink&quot;&gt;2008 02 18&lt;/a&gt; - Processing!&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 01 29&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 01 29&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2001%2029&quot; class=&quot;externalLink&quot;&gt;2008 01 29&lt;/a&gt; - Added &lt;a tiddlylink=&quot;All Subjects&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#All Subjects&quot; href=&quot;http://mayamel.tiddlyspot.com#All%20Subjects&quot; class=&quot;externalLink&quot;&gt;All Subjects&lt;/a&gt; tiddler.&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 01 08&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 01 08&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2001%2008&quot; class=&quot;externalLink&quot;&gt;2008 01 08&lt;/a&gt; - New feature: &lt;a tiddlylink=&quot;Visual Guide of UI Controls&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#Visual Guide of UI Controls&quot; href=&quot;http://mayamel.tiddlyspot.com#Visual%20Guide%20of%20UI%20Controls&quot; class=&quot;externalLink&quot;&gt;Visual Guide of UI Controls&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 01 07&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 01 07&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2001%2007&quot; class=&quot;externalLink&quot;&gt;2008 01 07&lt;/a&gt; - Tiddlyspot back up.  And... robots!&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 01 04&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 01 04&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2001%2004&quot; class=&quot;externalLink&quot;&gt;2008 01 04&lt;/a&gt; - rain!  Tiddlyspot down...&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2008 01 02&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2008 01 02&quot; href=&quot;http://mayamel.tiddlyspot.com#2008%2001%2002&quot; class=&quot;externalLink&quot;&gt;2008 01 02&lt;/a&gt; - New &lt;a tiddlylink=&quot;PYTHON&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#PYTHON&quot; href=&quot;http://mayamel.tiddlyspot.com#PYTHON&quot; class=&quot;externalLink&quot;&gt;PYTHON&lt;/a&gt; category, update wiki UI formatting.&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;2007 04 27&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#2007 04 27&quot; href=&quot;http://mayamel.tiddlyspot.com#2007%2004%2027&quot; class=&quot;externalLink&quot;&gt;2007 04 27&lt;/a&gt; - mel wiki is born&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</description>
<category>wiki</category>
<category>blog</category>
<link>http://mayamel.tiddlyspot.com#Blog</link>
<pubDate>Wed, 20 Jan 2010 21:37:00 GMT</pubDate>
</item>
<item>
<title>How can I have a node return the worldspace position of my object, offset in time?</title>
<description>&lt;h1&gt;Worldspace Matrix&lt;/h1&gt;If you're only interested in translation values, you can query a nodes &lt;code&gt;worldMatrix&lt;/code&gt; attr to get this info directly from the node in question:&lt;br&gt;&lt;pre&gt;string $node = &quot;pSphere1&quot;;
float $offset = 1.0;
float $t = `currentTime -q`;
float $worldMatrix[] = `getAttr -t ($t- $offset) ($node+&quot;.worldMatrix&quot;)`;
vector $offsetTranslate = &amp;lt;&amp;lt;$worldMatrix[12], $worldMatrix[13], $worldMatrix[14] &amp;gt;&amp;gt;;
print $offsetTranslate;
&lt;/pre&gt;&lt;h1&gt;decomposeMatrix node&lt;/h1&gt;Before I had a better understanding of nodes matrix attrs, I used to use this method:&lt;br&gt;&lt;ul&gt;&lt;li&gt;The &lt;code&gt;decomposeMatrix&lt;/code&gt; plugin wil help do the trick (got the info for this tip in a forum by Lutz Paelike)&lt;/li&gt;&lt;li&gt;I'm not a big fan of plugins in development, they can really cause a bottleneck, but since this plugin is distributed with Maya, I find it safer than usual.&lt;/li&gt;&lt;li&gt;What the decomposeMatrix node does, among other things, is let you pass in a source matrix, and it will spit out the worldspace trans, rot, scale, and shear for that matrix.  From there, we can use &lt;code&gt;getAttr -t&lt;/code&gt; to query those values in time.&lt;/li&gt;&lt;li&gt;Given this concept, regardless of your source objects hierarchical transformations, as long as your destination object lives in worldspace, it will follow along happily in time:&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;First, load the &quot;decomposeMatrix.mll&quot; plugin:&lt;br&gt;&lt;pre&gt;int $isLoaded = `pluginInfo -q -l &quot;decomposeMatrix.mll&quot;`;
if (!$isLoaded)
    loadPlugin &quot;decomposeMatrix.mll&quot;;
&lt;/pre&gt;Next create the decomposeMatrix node:&lt;br&gt;&lt;pre&gt;string $dm = `createNode decomposeMatrix`;
&lt;/pre&gt;given you have an object with it's name in ' string $obj = &quot;myObj&quot; ', connect:&lt;br&gt;&lt;pre&gt;connectAttr -f ($obj + &quot;.worldMatrix[0]&quot;) ($dm + &quot;.inputMatrix&quot;);
&lt;/pre&gt;Now you can query the decomposeMatrix's output attrs to find the worldspace transformations.  (or, you could connect them to another node, for a direct connection situation) And if we make an *expression* in like the link below, you can query them in time, to generate lag:&lt;br&gt;&lt;pre&gt;float $t = `currentTime -q`;
followObj.translateX = `getAttr -t ($t - 10) decomposeMatrix1.outputTranslateX`;
&lt;/pre&gt;Also see:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I compute distance traveled in an expression?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I compute distance traveled in an expression?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20compute%20distance%20traveled%20in%20an%20expression?&quot; class=&quot;externalLink&quot;&gt;How can I compute distance traveled in an expression?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a tiddlylink=&quot;How can I make one object &amp;quot;follow&amp;quot; another, offset in time, but without using getAttr or setAttr?&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to http://mayamel.tiddlyspot.com#How can I make one object &amp;quot;follow&amp;quot; another, offset in time, but without using getAttr or setAttr?&quot; href=&quot;http://mayamel.tiddlyspot.com#How%20can%20I%20make%20one%20object%20%22follow%22%20another,%20offset%20in%20time,%20but%20without%20using%20getAttr%20or%20setAttr?&quot; class=&quot;externalLink&quot;&gt;How can I make one object &quot;follow&quot; another, offset in time, but without using getAttr or setAttr?&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
<category>ANIMATION</category>
<category>TRANSFORMATION</category>
<category>decomposeMatrix</category>
<category>plugin</category>
<category>pluginInfo</category>
<category>createNode</category>
<category>connectAttr</category>
<category>expression</category>
<category>matrix</category>
<category>worldMatrix</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20have%20a%20node%20return%20the%20worldspace%20position%20of%20my%20object%2C%20offset%20in%20time%3F%5D%5D</link>
<pubDate>Wed, 20 Jan 2010 21:28:00 GMT</pubDate>
</item>
<item>
<title>How can I compute distance traveled in an expression?</title>
<description>Old example:&lt;br&gt;&lt;pre&gt;// compute current position:
float $posNowX = obj.translateX;
float $posNowY = obj.translateY;
float $posNowZ = obj.translateZ;

// compute previous position:
float $posThenX = `getAttr -t (frame - 1) obj.translateX`;
float $posThenY = `getAttr -t (frame - 1) obj.translateY`;
float $posThenZ = `getAttr -t (frame - 1) obj.translateZ`;

// compute distance traveled per frame:
float $distance = sqrt( pow(($posNowX - $posThenX), 2) +
pow(($posNowY - $posThenY), 2) +
pow(($posNowZ - $posThenZ), 2) );

print ($distance + &quot;\n&quot;);
&lt;/pre&gt;Newer example:  (thanks Jamie McCarter)&lt;br&gt;&lt;pre&gt;float $t = `currentTime -q`;
vector $currentP = `getAttr object.translate`;
vector $previousP = `getAttr -t ($t-1) object.translate`;
float $dist = mag( $currentP - $previousP );
print( &quot;distance travelled &quot; + $dist + &quot;\n&quot;);
&lt;/pre&gt;Newer, with matrices! ;) Probably the most accurate way of doing it?&lt;br&gt;&lt;pre&gt;float $t = `currentTime -q`;

float $curM[] = `getAttr object.worldMatrix`;
float $prevM[] = `getAttr -t ($t-1) object.worldMatrix`;
vector $currentP = &amp;lt;&amp;lt;$curM[12], $curM[13],$curM[14]&amp;gt;&amp;gt;;
vector $previousP = &amp;lt;&amp;lt;$prevM[12], $prevM[13],$prevM[14]&amp;gt;&amp;gt;;
float $dist = mag( $currentP - $previousP );

print( &quot;distance travelled &quot; + $dist + &quot;\n&quot;);
&lt;/pre&gt;</description>
<category>TRANSFORMATION</category>
<category>EXPRESSION</category>
<category>getAttr</category>
<category>sqrt</category>
<category>pow</category>
<category>distance</category>
<category>matrix</category>
<link>http://mayamel.tiddlyspot.com#%5B%5BHow%20can%20I%20compute%20distance%20traveled%20in%20an%20expression%3F%5D%5D</link>
<pubDate>Wed, 20 Jan 2010 21:18:00 GMT</pubDate>
</item>
</channel>
</rss>