<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6704711942008696192</id><updated>2014-07-12T21:15:42.971-07:00</updated><category term="Maya"/><category term="mel"/><category term="line"/><category term="vector"/><category term="camera pan and zoom"/><category term="center"/><category term="dir"/><category term="dragAttrContext"/><category term="file"/><category term="intersection"/><category term="magnitude of vector"/><category term="measure distance"/><category term="multiple return value"/><category term="plane"/><category term="procedure"/><category term="reposition"/><title type='text'>BLOG</title><subtitle type='html'>Personal Blog, VFX, News, Discussion, Tools, Technology, Some Python &amp;amp; Mel Scripting, howto&amp;#39;s and random stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.montu.biz/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://www.montu.biz/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-1971255308491437967</id><published>2013-08-14T18:56:00.004-07:00</published><updated>2013-08-14T18:58:01.551-07:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;281&quot; mozallowfullscreen=&quot;&quot; src=&quot;http://player.vimeo.com/video/72340174&quot; webkitallowfullscreen=&quot;&quot; width=&quot;500&quot;&gt;&lt;/iframe&gt; &lt;br /&gt;&lt;a href=&quot;http://vimeo.com/72340174&quot;&gt;Integration / Tracking Reel 2013&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/user19996025&quot;&gt;Montu Jariwala&lt;/a&gt; on &lt;a href=&quot;https://vimeo.com/&quot;&gt;Vimeo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Show reel of my latest tracking and environments work featuring shots from Real Steel, Tron, Jack The Giant Slayer, G.I.Joe: The Rise of Cobra, The Watch, Transformers and The Seeker: The Dark Is Rising.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Skill set: camera tracking, matchmoving, object tracking, stereoscopic tracking, Environments, HDR prep, python scripting for Maya and Nuke&lt;br /&gt;&lt;br /&gt;Software used: PFTrack, SynthEyes, Maya, Nuke, Image Modeler and proprietary tracking software   &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/1971255308491437967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=1971255308491437967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1971255308491437967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1971255308491437967'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2013/08/integration-tracking-reel-2013-from.html' title=''/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-5372236732500121855</id><published>2011-12-19T22:56:00.000-08:00</published><updated>2011-12-19T22:58:36.002-08:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;color: #f1c232; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Python Looping Techniques&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: small;&quot;&gt;looping thru list&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;li = [&#39;cube&#39;, &#39;sphere&#39;, &#39;reactangle&#39; ]&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;for i, v in enumerate(li):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print i,v&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;0 cube&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;1 sphere&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;2 reactangle&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;b style=&quot;color: black;&quot;&gt;Looping thru Dictionary&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;translate&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;25&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;rotate&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;4&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; a&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;iteritems&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;gp&quot;&gt; &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;translate 25&lt;br /&gt;rotate 4&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;List Comprehensive&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]&lt;/div&gt;&lt;div style=&quot;color: black; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span class=&quot;docutils literal&quot; style=&quot;color: black; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span class=&quot;pre&quot;&gt;squares&lt;/span&gt; &lt;span class=&quot;pre&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pre&quot;&gt;map(lambda&lt;/span&gt; &lt;span class=&quot;pre&quot;&gt;x:&lt;/span&gt; &lt;span class=&quot;pre&quot;&gt;x**2,&lt;/span&gt; &lt;span class=&quot;pre&quot;&gt;range(10))&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Arial,Helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]&lt;/div&gt;&lt;div style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;color: #3d85c6; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/5372236732500121855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=5372236732500121855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/5372236732500121855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/5372236732500121855'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2011/12/python-looping-techniques-looping-thru.html' title=''/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-6913429856614162162</id><published>2011-12-15T22:03:00.000-08:00</published><updated>2011-12-15T22:12:34.287-08:00</updated><title type='text'>Python: list objects to string</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2 style=&quot;color: #f1c232; font-family: Arial,Helvetica,sans-serif;&quot;&gt;  &lt;span style=&quot;font-size: small;&quot;&gt;Python tips - How to easily convert a list to a string for display&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;color: #f1c232; font-family: Arial,Helvetica,sans-serif;&quot;&gt;   &lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;if it is a list of strings, you may simply use join this way:&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; mylist = [&#39;spam&#39;, &#39;ham&#39;, &#39;eggs&#39;]&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&#39;, &#39;.join&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;(mylist)&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;spam, ham, eggs&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #6fa8dc; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Using the same method, you might also do this:&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print &lt;/span&gt;&lt;b style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&#39;\n&#39;.join&lt;/b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;(mylist) spam ham eggs&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;color: #6fa8dc; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;spam&lt;br /&gt;ham&lt;br /&gt;eggs&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;u can store the result in string variable. this time its and empty space between list objects &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;gt;&amp;gt;&amp;gt; c =  &lt;b&gt;&#39; &#39;.join&lt;/b&gt;(mylist)&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;color: #6fa8dc; font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;spam ham eggs&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;for non-string objects, such as integers.&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;If you just want to obtain a comma-separated string, you may use this shortcut:&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; list_of_ints = [820, 547, 8080, 8081]&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print str(list_of_ints)&lt;/span&gt;&lt;b style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;.strip(&#39;[]&#39;)&lt;/b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;820, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;547&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;, 8080, 8081&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Or this one, if your objects contain square brackets:&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print str(list_of_ints)&lt;/span&gt;&lt;b style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;[1:-1]&lt;/b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;820, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;547&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;, 8080, 8081&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Finally, you may use map() to convert each item in the list to a string, and then join them:&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print &lt;/span&gt;&lt;b style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&#39;, &#39;.join(map(str,&lt;/b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt; list_of_ints))&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;820, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;547&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;, 8080, 8081&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print &lt;/span&gt;&lt;b style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&#39;\n&#39;.join(map(str,&lt;/b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt; list_of_ints))&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;820 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;547&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;8080 8081 &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/6913429856614162162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=6913429856614162162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/6913429856614162162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/6913429856614162162'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2011/12/python-concatenate-list-objects-to.html' title='Python: list objects to string'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-1690439155709795227</id><published>2011-07-19T10:15:00.000-07:00</published><updated>2011-07-19T10:15:26.626-07:00</updated><title type='text'>Randomize selected vertex in Maya</title><content type='html'>&lt;br /&gt;def moveRandom(input):&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import random&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import maya.cmds as cmds&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s = cmds.ls(sl=True, fl =True)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; num = len(s)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(num):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cmds.select(s[i])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; r = random.random()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; h =r*input&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cmds.move( h, h, h, s[i], relative=True )</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/1690439155709795227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=1690439155709795227' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1690439155709795227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1690439155709795227'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2011/07/randomize-selected-vertex-in-m.html' title='Randomize selected vertex in Maya'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-2702597893452018656</id><published>2010-12-06T09:55:00.000-08:00</published><updated>2010-12-07T22:27:23.096-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="intersection"/><category scheme="http://www.blogger.com/atom/ns#" term="line"/><category scheme="http://www.blogger.com/atom/ns#" term="plane"/><category scheme="http://www.blogger.com/atom/ns#" term="vector"/><title type='text'>Intersection between Line and the Plane</title><content type='html'>&lt;u&gt;&lt;b style=&quot;color: #ffd966;&quot;&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_AD80Xi9bOkU/TP3Bxhx59eI/AAAAAAAAARg/thaG-RwQoH0/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;223&quot; src=&quot;http://4.bp.blogspot.com/_AD80Xi9bOkU/TP3Bxhx59eI/AAAAAAAAARg/thaG-RwQoH0/s320/Screenshot.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/_AD80Xi9bOkU/TP3BQHK1vgI/AAAAAAAAARc/1R0b6hcE7MM/s1600/linePlane.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;A and B are the 2 known points on the line and t is the parameter which will allow us to find a point P on the line.&lt;br /&gt;lets assume that P is the point of intersection between a line and a plane &lt;br /&gt;in order to find point P we will need to find value of the parameter t.&lt;br /&gt;to find t, we plug equation of line into the equation of plane, where we have everything we need to calculate t.&lt;br /&gt;once we have t, we plug into our equation of line back to find P.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;The equation of a line&lt;/b&gt;&lt;/u&gt; is: &lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;P = A + t(B – A)&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6fa8dc;&quot;&gt; ------------------------------------------------------------------&amp;nbsp; (1)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;- P&amp;nbsp; is any arbitrary point on the line.&amp;nbsp; In this case, P is the point of intersection of the ray and the plane&lt;br /&gt;- A is the starting point of the line&lt;br /&gt;- B is the end point of our line segment&lt;br /&gt;- t is the parameter.&amp;nbsp; Values between 0 and 1 represent points on our line.&lt;br /&gt;- Po and Co are position vector for P and C.&lt;br /&gt;- Po-Co  will lie completely in the plane. hence dot product of this to planes normal will be zero.&lt;br /&gt;&lt;u&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;The equation of a plane&lt;/b&gt;&lt;/u&gt; is:&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;N dot (P – C) = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6fa8dc;&quot;&gt; ------------------------------------------------------------------&amp;nbsp; (2)&lt;/span&gt;&lt;br /&gt;- N is the normal of the plane&lt;br /&gt;- P and C are known points on the plane.&amp;nbsp; In this case, P will represent the point of intersection. If our plane was represented by a triangle, C could be one of the vertices.&lt;br /&gt;&lt;br /&gt;Plug the equation of the ray from &lt;span style=&quot;color: #6fa8dc;&quot;&gt;---(1)&lt;/span&gt; into our intersection pt of the equation of the plane &lt;span style=&quot;color: #6fa8dc;&quot;&gt;---(2)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;N dot ( (A + tV) – C) = 0&lt;/span&gt;&lt;br /&gt;Solve for t:&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;(N dot (A + tV)) – (N dot C) = 0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;(N dot (A + tV)) = (N dot C)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;(N dot A) + (N dot tV) = (N dot C)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;N dot tV = (N dot C) - (N dot A)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;t = N dot (C – A) /N dot V&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #6fa8dc;&quot;&gt;------------------------------------------------------------------&amp;nbsp; (3)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;so we calculated the value of t. we can use this value in the line equation to find the co-ordinates&amp;nbsp; of the intersection point&lt;br /&gt;we have all the information on the right side of equal sign mean we can find P. &lt;br /&gt;puting t in equation of line&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;P = A + t(B – A)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #6fa8dc;&quot;&gt;------------------------------------------------------------------&amp;nbsp; (4)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If:&lt;br /&gt;t &amp;gt; 0 and t &amp;lt; 1&amp;nbsp; : The intersection occurs between the two points&lt;br /&gt;t = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : The intersection falls on the first point&lt;br /&gt;t = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Intersection falls on the second&amp;nbsp; point&lt;br /&gt;t &amp;gt; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Intersection occurs beyond second Point&lt;br /&gt;t &amp;lt; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Intersection happens before 1st point.</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/2702597893452018656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=2702597893452018656' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/2702597893452018656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/2702597893452018656'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2010/12/intersection-bwtween-line-and-plane.html' title='Intersection between Line and the Plane'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_AD80Xi9bOkU/TP3Bxhx59eI/AAAAAAAAARg/thaG-RwQoH0/s72-c/Screenshot.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-6241165744695585430</id><published>2010-11-30T18:43:00.000-08:00</published><updated>2010-12-07T22:27:08.794-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="center"/><category scheme="http://www.blogger.com/atom/ns#" term="line"/><category scheme="http://www.blogger.com/atom/ns#" term="Maya"/><category scheme="http://www.blogger.com/atom/ns#" term="mel"/><category scheme="http://www.blogger.com/atom/ns#" term="vector"/><title type='text'>Mel : How to find center of 2 selected vertex</title><content type='html'>&lt;br /&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt;    &lt;a href=&quot;http://www.montu.biz/2010/11/center-of-2-selected-vertex.html&quot;&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class=&quot;post-header&quot;&gt;&lt;/div&gt;&amp;nbsp;given 2 vectors cast a point on the line.&lt;br /&gt;so if we know 2 points out&amp;nbsp; in 3d space and if you want to shoot a point along the line anywhere in 3d space you can achieve this using vector equation of a line.you can also find center of 2 Selected vertex.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_AD80Xi9bOkU/TPaIJFcaTWI/AAAAAAAAARY/ot4Q1J9kJ_k/s1600/Screenshot.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/_AD80Xi9bOkU/TPaIJFcaTWI/AAAAAAAAARY/ot4Q1J9kJ_k/s320/Screenshot.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;using vector equation of line&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;r = ro + a&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;a = t*(v)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;r = ro + t*(v)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;t*(v)&lt;/span&gt; will be a vector that lines along the line and it tells us how far from the original point that we should move. if &lt;span style=&quot;color: #cc0000;&quot;&gt;t &lt;/span&gt;is positive we move away from the original point in direction of vector &lt;span style=&quot;color: #cc0000;&quot;&gt;v&lt;/span&gt; and if t is negative we move away from the original point in the opposite direction of vector &lt;span style=&quot;color: #cc0000;&quot;&gt;v&lt;/span&gt;. note vector &lt;span style=&quot;color: #cc0000;&quot;&gt;v&lt;/span&gt; can be anywhere in 3D as long as it is parallal to &lt;span style=&quot;color: #cc0000;&quot;&gt;a&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;string $verts[] = `ls -sl -fl`;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;vector $ro = `pointPosition $verts[0]`;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;vector $r = `pointPosition $verts[1]`;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;vector $v = $r - $ro;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;float $result[] = $ro + (0.5*$v);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;$sl =  `spaceLocator`;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;move $result[0] $result[1] $result[2] $sl;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;above script will create a locator in the center of 2 selected vertex as i used t as 0.5 here.   &lt;br /&gt;&lt;br /&gt;imagine your first point is camera position and second point is 2d pattern looking thru camera. if you want to extend the ray from these 2 points far enough you can use above script with the t value whatever you like. you can go t over 1 so the third point goes beyond your second point.</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/6241165744695585430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=6241165744695585430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/6241165744695585430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/6241165744695585430'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2010/11/center-of-2-selected-vertex.html' title='Mel : How to find center of 2 selected vertex'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_AD80Xi9bOkU/TPaIJFcaTWI/AAAAAAAAARY/ot4Q1J9kJ_k/s72-c/Screenshot.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-1185973313514055548</id><published>2010-11-30T18:16:00.000-08:00</published><updated>2010-12-07T22:28:11.019-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Maya"/><category scheme="http://www.blogger.com/atom/ns#" term="mel"/><category scheme="http://www.blogger.com/atom/ns#" term="multiple return value"/><category scheme="http://www.blogger.com/atom/ns#" term="procedure"/><title type='text'>Mel : How to return multiple values in procedure?</title><content type='html'>you can do this using string array&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;global proc string[] myproc() {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string $r[];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string $sel[] = `ls -sl`;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; float $pos[] = `xform -q -ws -t $sel[0]`;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $r[0] = $sel[0]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $r[1] = $pos[0]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $r[2] = $pos[1]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $r[3] = $pos[2]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $r; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;myproc();&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/div&gt;so for example if you want to store selected object&#39;s transform node and shape node name along with translate x,y,z in a string array, you can plug all of them in string array inside the proc.&lt;br /&gt;here i am forcing my script to store values only if shape node is camera.&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;global proc string[] camtr(string $myselection[]) {&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string $return[];&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string $shp[] = `listRelatives -s $myselection[0]`;&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for ( $s in $shp )&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; string $cam = `nodeType $s`;&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ($cam == &quot;camera&quot;)&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; print ( &quot;\n YES &quot; + $s + &quot; is camera\n&quot;);&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $pos =`xform -q -ws -t $myselection[0]`;&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $return[0] = $myselection[0];&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $return[1] = $shp[0];&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $return[2] = $pos[0];&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $return[3] = $pos[1];&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $return[4] = $pos[2];&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else &lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; print ( &quot;\n No &quot; + $s + &quot; is not a camera. It is a &quot; + $cam +&quot;\n&quot;);&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $return;&lt;/span&gt;&lt;br style=&quot;color: #6fa8dc;&quot; /&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: white;&quot;&gt;to see result of above proc&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;string $sel[] = `ls -sl -fl`;&lt;br /&gt;string $b[] =camtr($sel);&lt;/span&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt; &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/1185973313514055548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=1185973313514055548' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1185973313514055548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1185973313514055548'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2010/11/how-to-return-multiple-values-in.html' title='Mel : How to return multiple values in procedure?'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-5031277565655355969</id><published>2010-05-23T19:10:00.000-07:00</published><updated>2010-12-07T22:27:52.149-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dir"/><category scheme="http://www.blogger.com/atom/ns#" term="file"/><category scheme="http://www.blogger.com/atom/ns#" term="Maya"/><category scheme="http://www.blogger.com/atom/ns#" term="mel"/><title type='text'>Mel : useful Maya file commands</title><content type='html'>&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;some handy Maya&amp;nbsp; file commands&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;some basic file and directory path operation commands&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;How to query currently opened scene name?&lt;/div&gt;&lt;div style=&quot;color: #9fc5e8; font-family: Verdana,sans-serif;&quot;&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;file -q -sceneName;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;How to find directory path of the currently opened scene?&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;dirname(`file -q -sceneName`);&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;How to find path to your default projects directory?&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;string $path[]= `internalVar -uwd`;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;uwd flag is short for user work directory&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;How to make directory thru mel?&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;depends on where you want to make first line can vary.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;i will illustrate how to make folder in maya/scene folder&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$currentFilePath = dirname(`file -q -sceneName`);&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$folder = $currentFilePath + &quot;/my_folder&quot;;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;sysFile -makeDir $folder ;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;How to export obj using file command?&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;for example i will use above location to create another folder name my_obj_folder&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$sel = `ls -sl`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$currentFilePath = dirname(`file -q -sceneName`);&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$objfolder = $currentFilePath + &quot;/my_obj_folder&quot;;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;sysFile -makeDir $objfolder ;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;string $objpath = $objfolder + &quot;/&quot; + $sel[0] + &quot;.obj&quot;;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;file -typ &quot;OBJ&quot; -pr -es $objpath;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;if you want to make folder name as selected object name in maya then replace line 3 in above script with this &lt;span style=&quot;color: #6fa8dc;&quot;&gt;$objfolder = $currentFilePath + &quot;/&quot; + $sel[0];&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$sel = `ls -sl`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$currentFilePath = dirname(`file -q -sceneName`);&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;$objfolder = $currentFilePath + &quot;/&quot; + $sel[0];&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;sysFile -makeDir $objfolder ;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;string $objpath = $objfolder + &quot;/&quot; + $sel[0] + &quot;.obj&quot;;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;file -typ &quot;OBJ&quot; -pr -es $objpath;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;How to open a file using fileDialog mel command?&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;string $filename = `fileDialog -m 0 -directoryMask &quot;/home/username/maya/scenes/*.ma&quot;`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc; font-family: Verdana,sans-serif;&quot;&gt;file -o $filename;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;i have used fileDialog and file mel command here&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;you can replace path with whatever path you are working on.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;m flag in the first line stands for mode. 0 is for opening the file.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;note: if u have unsaved file opened when you run the script it will give u error.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/5031277565655355969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=5031277565655355969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/5031277565655355969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/5031277565655355969'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2010/05/useful-file-commands.html' title='Mel : useful Maya file commands'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-6818004483486739110</id><published>2010-03-15T23:00:00.000-07:00</published><updated>2010-12-07T22:28:54.883-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="camera pan and zoom"/><category scheme="http://www.blogger.com/atom/ns#" term="dragAttrContext"/><category scheme="http://www.blogger.com/atom/ns#" term="Maya"/><category scheme="http://www.blogger.com/atom/ns#" term="mel"/><title type='text'>Mel : Matchmover&#39;s Handy Tool</title><content type='html'>with camera offset x y and overscan attribute you can pan left right and zoom on to the imageplane without affecting camera transform node. this is really handy specially for matchmoving when you are trying to lineup camera to the track geometry or fixing camera and you want to zoom into the imageplane really close without affecting camera.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;global proc drag_Xpan(){&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camName[] = `ls -sl`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camShapeName[] = `listRelatives -s $camName[0]`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;dragAttrContext dxpan;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;dragAttrContext -edit -ct ($camShapeName[0] +&quot;.horizontalFilmOffset&quot;) dxpan;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;setToolTo dxpan;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;}&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;global proc drag_Ypan(){&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camName[] = `ls -sl`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camShapeName[] = `listRelatives -s $camName[0]`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;dragAttrContext dypan;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;dragAttrContext -edit -ct ($camShapeName[0] +&quot;.verticalFilmOffset&quot;) dypan;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;setToolTo dypan;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;}&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;global proc drag_Zoom(){&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camName[] = `ls -sl`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camShapeName[] = `listRelatives -s $camName[0]`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;dragAttrContext dzoom;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;dragAttrContext -edit -ct ($camShapeName[0] +&quot;.overscan&quot;) dzoom;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;setToolTo dzoom;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;}&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;global proc resetCam(){&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camName[] = `ls -sl`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;string $camShapeName[] = `listRelatives -s $camName[0]`;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;setAttr ($camShapeName[0] +&quot;.horizontalFilmOffset&quot;) 0;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;setAttr ($camShapeName[0] +&quot;.verticalFilmOffset&quot;) 0;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;setAttr ($camShapeName[0] +&quot;.overscan&quot;) 1;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;}&lt;/div&gt;&lt;br /&gt;To test these procedures i am going to add these to the my custom maya shelf. if you want you can make hotkey for these to make it even quicker. its your choice. i personally use hotkeys for these. dig in thru my earlier post to see how to make hotkey thru mel.&lt;br /&gt;&lt;br /&gt;but just for testing purpose i am adding them to shelf.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;scriptToShelf &quot;X&quot; &quot;drag_Xpan;&quot; &quot;1&quot;;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;scriptToShelf &quot;Y&quot; &quot;drag_Ypan;&quot; &quot;1&quot;;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;scriptToShelf &quot;Y&quot; &quot;drag_Zoom;&quot; &quot;1&quot;;&lt;/div&gt;&lt;div style=&quot;color: #6fa8dc;&quot;&gt;scriptToShelf &quot;reset&quot; &quot;resetCam;&quot; &quot;1&quot;;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Select a camera and look thru that camera in current model panel. load any image in the imageplane so that we can test these procedures better to see whats happening. test them one at a time using middle mouse drag screen left-right. hold control key while dragging middle mouse will make the drag slower and once you done you can reset them to default value.&lt;br /&gt;&lt;br /&gt;hope this is helpful. please make any suggestion if you have any.</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/6818004483486739110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=6818004483486739110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/6818004483486739110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/6818004483486739110'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2010/03/matchmovers-hand-tool.html' title='Mel : Matchmover&#39;s Handy Tool'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-1329700405670443095</id><published>2010-03-15T21:55:00.000-07:00</published><updated>2010-12-07T22:29:33.352-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="magnitude of vector"/><category scheme="http://www.blogger.com/atom/ns#" term="Maya"/><category scheme="http://www.blogger.com/atom/ns#" term="measure distance"/><category scheme="http://www.blogger.com/atom/ns#" term="mel"/><title type='text'>Mel: Measure Distance</title><content type='html'>&lt;div id=&quot;post_message_70377&quot;&gt;Maya has this Measure tool which pretty much does the job but i always felt lazy to go thru Create Menu / Measure tool and click on vertices one after other with snap on. too many things to do to get simple distance between two points. i made this script handy for myself for quick checks specially when i have survey information and measurement from set. you can simply make this global procedure in your user/maya/script path and assign hotkey to even make it quicker. it saves time when you want to query lots of measurements and cross check track data scale from tracking software in 3D. pretty sure this can be handy even for modelers, animator and fx guys. script currently works for transform, mesh, nurbsCurve type of nodes. you can modify it further to include different nodes based on your needs.&lt;br /&gt;&lt;br /&gt;script is self explanatory. also if you have any suggestion to make this script better please share.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;global proc getdistance(){&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: mediumturquoise;&quot;&gt;string $currentsel[] = `ls -sl -fl`;&lt;br /&gt;if ($currentsel[0] == &quot;&quot;) error &quot;You must select two nodes or vertex to measure the distance&quot;;&lt;br /&gt;else {&lt;br /&gt;&lt;br /&gt; int $numofvertex = size($currentsel);&lt;br /&gt;&lt;br /&gt;if($numofvertex &amp;gt; 2) error &quot;More than 2 nodes selected. Make selection again with only two nodes to measure distance between them&quot;;&lt;br /&gt;  else {&lt;br /&gt;   if(`objectType -isType &quot;mesh&quot; $currentsel[0]` || `objectType -isType &quot;nurbsCurve&quot; $currentsel[0]`)&lt;br /&gt;    {&lt;br /&gt;  &lt;br /&gt;    vector $va = `pointPosition $currentsel[0]`;&lt;br /&gt;    vector $vb = `pointPosition $currentsel[1]`;&lt;br /&gt;    vector $distpos = $va - $vb;&lt;br /&gt;    float $d = `mag &amp;lt;&amp;lt;$distpos.x, $distpos.y, $distpos.z&amp;gt;&amp;gt;`;&lt;br /&gt;    string $unit= `currentUnit -query -linear`;&lt;br /&gt;    print ($d + &quot;\t&quot; + $unit);&lt;br /&gt; &lt;br /&gt;    }&lt;br /&gt;   else if (`objectType -isType &quot;transform&quot; $currentsel[0]`)&lt;br /&gt;    {&lt;br /&gt;  &lt;br /&gt;    vector $va = `xform -q -ws -a -rp $currentsel[0]`;&lt;br /&gt;    vector $vb = `xform -q -ws -a -rp $currentsel[1]`;&lt;br /&gt;    vector $distpos = $va - $vb;&lt;br /&gt;    float $d = `mag &amp;lt;&amp;lt;$distpos.x, $distpos.y, $distpos.z&amp;gt;&amp;gt;`;&lt;br /&gt;    string $unit= `currentUnit -query -linear`;&lt;br /&gt;    print ($d + &quot;\t&quot; + $unit);&lt;br /&gt;  &lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;   }&lt;br /&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;   &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/1329700405670443095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=1329700405670443095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1329700405670443095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/1329700405670443095'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2010/03/measure-distance.html' title='Mel: Measure Distance'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6704711942008696192.post-7344258551449425376</id><published>2010-03-15T10:04:00.000-07:00</published><updated>2010-12-01T16:41:37.057-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Maya"/><category scheme="http://www.blogger.com/atom/ns#" term="mel"/><category scheme="http://www.blogger.com/atom/ns#" term="reposition"/><title type='text'>Reposition</title><content type='html'>&lt;div class=&quot;smallfont&quot;&gt;&lt;div&gt;&lt;span id=&quot;repdisplay_69601_1560&quot;&gt;&lt;img alt=&quot;supernova is on a distinguished road&quot; border=&quot;0&quot; class=&quot;inlineimg&quot; src=&quot;http://www.cgtantra.com/forums/images/reputation/reputation_pos.gif&quot; title=&quot;supernova is on a distinguished road&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;smallfont&quot;&gt;&lt;img alt=&quot;Default&quot; border=&quot;0&quot; class=&quot;inlineimg&quot; src=&quot;http://www.cgtantra.com/forums/images/icons/icon1.gif&quot; title=&quot;Default&quot; /&gt;     &lt;b&gt;Reposition using For loop&lt;/b&gt;    &lt;/div&gt;&lt;hr size=&quot;1&quot; style=&quot;background-color: #1c1c1c; color: #1c1c1c;&quot; /&gt;&lt;div id=&quot;post_message_69601&quot;&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;b&gt;Reposition &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let say If you want to reposition one object to the other, you can use &lt;span style=&quot;color: mediumturquoise;&quot;&gt;for &lt;/span&gt;loop variation. the script runs through for loop for every string that are declared in first line. try this out. make couple of polyCube and place them at different 3D location. select source object first and then target object (that you want to repostion to the first cube) and execute this in script editor.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: mediumturquoise;&quot;&gt;string $attributeList[] = {&quot;tx&quot;, &quot;ty&quot;, &quot;tz&quot;, &quot;rx&quot;, &quot;ry&quot;, &quot;rz&quot;, &quot;sx&quot;, &quot;sy&quot;, &quot;sz&quot;};&lt;br /&gt;string $sel[] = `ls -sl`;&lt;br /&gt;string $attribute;&lt;br /&gt;for($attribute in $attributeList) {&lt;br /&gt;setAttr ($sel[1] + &quot;.&quot; + $attribute) `getAttr ($sel[0] + &quot;.&quot; + $attribute)`;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;line 1 : storing all shortnames for tranform attribute in string array (eg: tx = tranformX)&lt;br /&gt;line 2 : declaring string array for storing selected object names&lt;br /&gt;line 3: declaring string that will run through for loop in next line. this line is not needed as maya automatically declares $attr as string type when you use for loop as in line 4&lt;br /&gt;line 4: for loop . to process each string in the array list in line 1 you can use a variation of the for loop that is specialized for use with arrays like this&lt;br /&gt;line 5: setting second selected object transform attribute from first selected object.&lt;br /&gt;&lt;br /&gt;If you want any particular channel (like only translate Z and rotate Y ) and not all of them then you use channelBox query like this. make sure you selected the channel in main channel box and run these lines.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: mediumturquoise;&quot;&gt;string $attributeList[] = `channelBox -q -sma &quot;mainChannelBox&quot;`;&lt;br /&gt;string $sel[] = `ls -sl`;&lt;br /&gt;string $attribute;&lt;br /&gt;for($attribute in $attributeList) {&lt;br /&gt;setAttr ($sel[1] + &quot;.&quot; + $attribute) `getAttr ($sel[0] + &quot;.&quot; + $attribute)`;&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.montu.biz/feeds/7344258551449425376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6704711942008696192&amp;postID=7344258551449425376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/7344258551449425376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6704711942008696192/posts/default/7344258551449425376'/><link rel='alternate' type='text/html' href='http://www.montu.biz/2010/03/reposition-using-for-loop-reposition.html' title='Reposition'/><author><name>Montu Jariwala</name><uri>http://www.blogger.com/profile/06746094515263751975</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>