<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" 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" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0YFQHg-fyp7ImA9WhBUFUU.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392</id><updated>2013-05-03T06:51:51.657-07:00</updated><category term="listRelatives" /><category term="Export" /><category term="confirm dialog" /><category term="Print" /><category term="GDC" /><category term="Recursive" /><category term="Constraints" /><category term="fprint" /><category term="Import" /><category term="Maya" /><category term="Beer" /><category term="Fix" /><category term="Progress Bar" /><category term="Get Maya Version MEL" /><category term="convention" /><category term="Incremental Save" /><category term="Scripting" /><category term="Code" /><category term="Split Joints" /><category term="deformers" /><category term="PyQT" /><category term="Return" /><category term="schools" /><category term="Create SDK" /><category term="video" /><category term="Modules" /><category term="Windows Username" /><category term="joints" /><category term="Print Selected Objects" /><category term="nodeType" /><category term="animation tools" /><category term="Print Current Selection" /><category term="Class" /><category term="Command Line" /><category term="System" /><category term="TOkenize" /><category term="Position" /><category term="St. Patrick's Day" /><category term="logic" /><category term="continue" /><category term="Animschool" /><category term="arrays" /><category term="webinar" /><category term="procedure" /><category term="Learn" /><category term="String Array" /><category term="Print Vertices" /><category term="e3" /><category term="faceware" /><category term="Tips" /><category term="Free Mel Scripts" /><category term="sculpting" /><category term="Transfer UVs" /><category term="Attribute" /><category term="script swell" /><category term="3ds Max" /><category term="Objects" /><category term="source a script with a variable" /><category term="Namespace" /><category term="animators resource" /><category term="world matrix" /><category term="Multiple Namespaces" /><category term="Background Color" /><category term="Print Selection" /><category term="Parent" /><category term="PYMEL" /><category term="modeling" /><category term="error" /><category term="Namespacing" /><category term="recursion" /><category term="articles" /><category term="Python" /><category term="Create a directory with mel" /><category term="Print Random Quotes" /><category term="translates" /><category term="milestone" /><category term="Joint Chain" /><category term="image metrics" /><category term="efficiency" /><category term="eval" /><category term="transforms" /><category term="mesh" /><category term="Check if an object exists" /><category term="worldMatrix" /><category term="objExists" /><category term="executable" /><category term="How To Write To A Text File" /><category term="Make Set Driven Keys" /><category term="Progress Window" /><category term="auto key" /><category term="White Space" /><category term="Index" /><category term="animation" /><category term="Scripts" /><category term="MaxScript" /><category term="Maya Version" /><category term="animButtonState" /><category term="learning" /><category term="maya tools" /><category term="Scene File Name" /><category term="Coding" /><category term="Floating Slider Time" /><category term="speed" /><category term="Select Connections" /><category term="shout outs" /><category term="Parent Constraint" /><category term="Rigging" /><category term="loops" /><category term="Holiday" /><category term="Select Outgoing Nodes" /><category term="programming" /><category term="tutorial" /><category term="rotations" /><category term="fopen" /><category term="Zero Out Attributes" /><category term="Character Setup" /><category term="blendshapes" /><category term="better" /><category term="games" /><category term="break" /><category term="setAttr" /><category term="tech-artists.org" /><category term="fclose" /><category term="Game Developers Conference" /><category term="FilterString" /><category term="Point Constraint" /><category term="improving" /><category term="Google" /><category term="facial" /><category term="Functions" /><category term="Get Parent" /><category term="Removing Spaces From Names" /><category term="source" /><category term="Toggle Background Color with MEL" /><category term="Split Bones" /><category term="Data" /><category term="listHistory" /><category term="rotates" /><category term="infinite loop" /><category term="Blur" /><category term="nodes" /><category term="Removing Namespace" /><category term="MEL" /><category term="Orient Constraint" /><category term="Set Driven Keys" /><category term="warning" /><category term="Tricks" /><category term="Viewport" /><title>Script Swell</title><subtitle type="html">Besides the ramblings of a guy who likes to make things, Script Swell is a place to find MEL scripts, Maxscripts, Python tools and scripts for animators, cg artists, and anyone interested in improving their workflow and pipeline. The editor Jay Grenier is a technical artist currently residing in Burbank, CA.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.scriptswell.net/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.scriptswell.net/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>66</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ScriptSwell" /><feedburner:info uri="scriptswell" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CE8ER3k9cCp7ImA9WhBRFUQ.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-5551629384341619203</id><published>2013-03-06T09:59:00.002-08:00</published><updated>2013-03-06T10:00:06.768-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-06T10:00:06.768-08:00</app:edited><title>New Translated MEL Tutorial - Serbo-Croatian</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Scriptswell reader &lt;i&gt;Vera Djuraskovic&lt;/i&gt; was kind enough to do a great translation of my &lt;a href="http://www.scriptswell.net/p/technical-artist-tutorials.html"&gt;MEL Scripting Tutorial&lt;/a&gt;, "&lt;a href="http://www.scriptswell.net/2010/09/mel-tutorial-how-to-read-text-file.html"&gt;How to Read a Text File&lt;/a&gt;" into Serbo-Croatian.  I've added a link to it in the Tutorials page but you can also read it by clicking the link below.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://science.webhostinggeeks.com/mel-vodic-programiranje"&gt;http://science.webhostinggeeks.com/mel-vodic-programiranje&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If anyone else would like to to translate any of the scripts or tutorials on the site into your native language, feel free to do so and email me at jay@jaygrenier.com to have it posted.

Thanks Vera!&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/rXbc6-d7rBU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/5551629384341619203/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2013/03/new-translated-tutorial-serbo-croatian.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/5551629384341619203?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/5551629384341619203?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/rXbc6-d7rBU/new-translated-tutorial-serbo-croatian.html" title="New Translated MEL Tutorial - Serbo-Croatian" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2013/03/new-translated-tutorial-serbo-croatian.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYBQ3k-fCp7ImA9WhVSFE8.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-2746081895028190108</id><published>2012-03-10T12:15:00.001-08:00</published><updated>2012-03-10T16:52:32.754-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-10T16:52:32.754-08:00</app:edited><title>What a moment of inspiration can do...</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
There are times when we as artists, scripters, writers, breakers,&amp;nbsp;fixers,&amp;nbsp;builders, and anyone else who is in the business of or enjoys creating things, go through moments of what can only be described as raw and unadulterated inspiration. &amp;nbsp;When something you've experienced, seen, heard, or felt has left you wanting nothing more than to sit and &lt;i&gt;create&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
For me, inspiration can often be brought on from something as simple as observing nature, specifically the ocean. &amp;nbsp;When I think about the complexities of a single event like a wave breaking, the trillions of chemical and natural actions and reactions that ultimately led to that swell building up and eventually breaking somewhere, and the inevitable countless more reactions that will now occur because of it, it's nothing short of mind-blowing. &amp;nbsp;The butterfly effect in nature is a constant source of inspiration and awe. &amp;nbsp;Even with a relative understanding of physics, trying to break down and think about the infinite complexities of nature and how much there is to learn makes me feel like an excited little kid.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-RyF6qje3RFE/T1ux5UdiENI/AAAAAAAAAkI/uFCHTdqlzA0/s1600/learn-all-the-things.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://4.bp.blogspot.com/-RyF6qje3RFE/T1ux5UdiENI/AAAAAAAAAkI/uFCHTdqlzA0/s320/learn-all-the-things.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This week I was at the Game Developers Conference in San Francisco. &amp;nbsp;It's a place where you've essentially got the greatest minds in the industry all together sharing information and learning from each other. &amp;nbsp;It's an absolutely fantastic event. &amp;nbsp;I sat in on some great talks, round table discussions, and had a lot of great moments with people who's company I sincerely enjoy. &amp;nbsp;Nothing inspires me more than being around brilliant people. &amp;nbsp;Even some of our business meetings which tend to be significantly less fun than meeting with friends, left me with a feeling of motivation of what we can do with our technology this year to really push the envelope. &amp;nbsp;I can't stress enough how great it feels to be excited to go back to work and start applying some of these ideas to figure out how we can innovate and focus on the art, as opposed to simply doing a job at a studio for a paycheck. &amp;nbsp;Working with and being around creative people puts me in the best mood, I wouldn't trade it for anything!&lt;br /&gt;
&lt;br /&gt;
One of our meetings earlier this week was with one of the industry's leading facial animation artists, somebody who I've always been very interested to work with. &amp;nbsp;While discussing different ideas and projects we might be able to do together, he mentioned something he does while working that I thought was really neat. &amp;nbsp;He likes to keep a comprehensive list of all of his project ideas that he can add to whenever he is inspired. &amp;nbsp;This way, when free time presents itself, he can refer to his mega-list and pick something fun to work on. &amp;nbsp;Simple concept, but brilliant execution. &amp;nbsp;Keep track of the ideas you have during those intense periods of inspiration, so that later when that feeling is maybe not so intense, you've got an idea to look at and work on that will bring it back. &amp;nbsp;I have now started a list of my own and I have to say it's got me pretty excited, even though there's already thirty plus projects on it. &amp;nbsp;But hey, go big or go home.&lt;br /&gt;
&lt;br /&gt;
Something I really enjoy hearing about is what specific events have inspired you in the past? &amp;nbsp;What have you been doing that afterwards you left with that excited and "fired up" feeling. &amp;nbsp;What puts you in the zone?&lt;/div&gt;
&lt;br /&gt;
&lt;script src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;
&lt;/script&gt;&lt;fb:like colorscheme="dark" href="http://www.scriptswell.net/2012/03/what-moment-of-inspiration-can-do.html" showfaces="false"&gt;&lt;/fb:like&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/XMLpjO9jyAY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/2746081895028190108/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2012/03/what-moment-of-inspiration-can-do.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2746081895028190108?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2746081895028190108?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/XMLpjO9jyAY/what-moment-of-inspiration-can-do.html" title="What a moment of inspiration can do..." /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-RyF6qje3RFE/T1ux5UdiENI/AAAAAAAAAkI/uFCHTdqlzA0/s72-c/learn-all-the-things.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://www.scriptswell.net/2012/03/what-moment-of-inspiration-can-do.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4CQX8-eip7ImA9WhRVEEs.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-2445861652845974464</id><published>2012-01-08T16:12:00.000-08:00</published><updated>2012-01-08T16:12:40.152-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-08T16:12:40.152-08:00</app:edited><title>Skyrim Mod Team Looking For 3D Character Artist</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
MWH Games is currently looking to add an experienced 3D Character Artist to the team! This position is for the &lt;a href="http://www.mwhgames.com/mods/skyrim-dwarves-of-karak-dok/"&gt;Dwarves of Karak Dok&lt;/a&gt; mod for Skyrim.&lt;br /&gt;&lt;br /&gt;You will be responsible for working with the art team to create characters, weapons, armor and other items.  This includes modeling, sculpting and texturing game assets from start to finish.  We’re a small but growing team of game industry vets and game enthusiasts, and you will be collaborating primarily with the lead artist and the concept artist to execute the vision for DoKD.  You should be comfortable managing your own time, and of course must be willing to commit to hitting deadlines set by the project manager.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For more info check out the link below.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href="http://www.mwhgames.com/team/team-openings/3d-character-artist/"&gt;http://www.mwhgames.com/team/team-openings/3d-character-artist/&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/j-yyA3mxu4I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/2445861652845974464/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2012/01/skyrim-mod-team-looking-for-3d.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2445861652845974464?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2445861652845974464?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/j-yyA3mxu4I/skyrim-mod-team-looking-for-3d.html" title="Skyrim Mod Team Looking For 3D Character Artist" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2012/01/skyrim-mod-team-looking-for-3d.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkABRn8zfCp7ImA9WhRREEU.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-4998442310721616489</id><published>2011-11-23T14:49:00.001-08:00</published><updated>2011-11-23T14:52:37.184-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-23T14:52:37.184-08:00</app:edited><title>Skyrim Mod Team Looking For Concept Artist</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
If anyone knows of a concept artist who'd be interested in helping out on a Skyrim mod please let me know. Unpaid but potential for a percentage of contest winnings. Primarily fantasy weapon and armor designs with the possibility of character work.

&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-ktfhoiwfjiw/TrB0JXLQ8II/AAAAAAAAAHc/99Tf1AmNmaU/s1600/tes-skyrim-1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-ktfhoiwfjiw/TrB0JXLQ8II/AAAAAAAAAHc/99Tf1AmNmaU/s1600/tes-skyrim-1.jpg" width="480" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/9SJAxmx7zq4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/4998442310721616489/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2011/11/skyrim-mod-team-looking-for-concept.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/4998442310721616489?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/4998442310721616489?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/9SJAxmx7zq4/skyrim-mod-team-looking-for-concept.html" title="Skyrim Mod Team Looking For Concept Artist" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-ktfhoiwfjiw/TrB0JXLQ8II/AAAAAAAAAHc/99Tf1AmNmaU/s72-c/tes-skyrim-1.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://www.scriptswell.net/2011/11/skyrim-mod-team-looking-for-concept.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ENR3g8cCp7ImA9WhdWGUs.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-8985862413181732524</id><published>2011-09-13T18:56:00.000-07:00</published><updated>2011-09-13T19:01:36.678-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-13T19:01:36.678-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sculpting" /><category scheme="http://www.blogger.com/atom/ns#" term="faceware" /><category scheme="http://www.blogger.com/atom/ns#" term="webinar" /><category scheme="http://www.blogger.com/atom/ns#" term="animation" /><category scheme="http://www.blogger.com/atom/ns#" term="image metrics" /><category scheme="http://www.blogger.com/atom/ns#" term="modeling" /><category scheme="http://www.blogger.com/atom/ns#" term="facial" /><title>Webinar with ZBrush Guru Ryan Kingslien</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Recently &lt;a href="http://image-metrics.com/"&gt;Image Metrics&lt;/a&gt; hosted a facial sculpting and anatomy webinar with &lt;a href="http://zbrushworkshops.com/"&gt;ZBrush Workshops&lt;/a&gt; founder, Ryan Kingslien.  Ryan is one of the industry's most sought after artists and it was a pleasure to hear his take on how to tackle learning facial anatomy. &amp;nbsp;He has even recently started a new class on his &lt;a href="http://zbrushworkshops.com/"&gt;website&lt;/a&gt; based on the content of the webinar. &amp;nbsp;Check out the video below.

&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://vimeo.com/28949284"&gt;Sculpting The Face - Anatomy &amp;amp; Form&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://vimeo.com/28949284"&gt;&lt;span id="goog_1004908762"&gt;&lt;/span&gt;&lt;span id="goog_1004908763"&gt;&lt;/span&gt;&lt;img border="0" height="298" src="http://3.bp.blogspot.com/-VZbhgmM9wKw/TnAIChhqyfI/AAAAAAAAAfY/kvyVy_wGroU/s400/ryan_webinar.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
You can find videos of some of the other &lt;a href="http://vimeo.com/user6082681/videos"&gt;webinars&lt;/a&gt; we've done at Image Metrics in the right-hand side column.&lt;/div&gt;
&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/ixPXczKpc8Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/8985862413181732524/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2011/09/webinar-with-zbrush-guru-ryan-kingslien.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8985862413181732524?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8985862413181732524?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/ixPXczKpc8Q/webinar-with-zbrush-guru-ryan-kingslien.html" title="Webinar with ZBrush Guru Ryan Kingslien" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-VZbhgmM9wKw/TnAIChhqyfI/AAAAAAAAAfY/kvyVy_wGroU/s72-c/ryan_webinar.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2011/09/webinar-with-zbrush-guru-ryan-kingslien.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkACSHY5fSp7ImA9WhdTEEg.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-2762407822157996919</id><published>2011-07-07T10:04:00.000-07:00</published><updated>2011-07-07T10:12:49.825-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-07T10:12:49.825-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="video" /><category scheme="http://www.blogger.com/atom/ns#" term="faceware" /><category scheme="http://www.blogger.com/atom/ns#" term="webinar" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="image metrics" /><category scheme="http://www.blogger.com/atom/ns#" term="facial" /><title>Webinars &amp; Videos</title><content type="html">&lt;div style="text-align: left;"&gt;Script Swell now has a widget with links to the webinars and tutorial videos I've been working on the last couple of months.  So far they are all in the realm of facial animation and rigging, along with my Faceware demo from GDC this year.  As I make more videos I'll keep the links updated.  The links take you to YouTube, though you can also find them all on Vimeo if that is your preferred site.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://2.bp.blogspot.com/-E-L7TX0mUCQ/ThXo1aLZKUI/AAAAAAAAAb4/cyv-YMYuAkI/s400/videos.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5626659313727121730" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 225px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/Go_pbyA3Ld8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/2762407822157996919/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2011/07/webinars-videos.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2762407822157996919?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2762407822157996919?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/Go_pbyA3Ld8/webinars-videos.html" title="Webinars &amp; Videos" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-E-L7TX0mUCQ/ThXo1aLZKUI/AAAAAAAAAb4/cyv-YMYuAkI/s72-c/videos.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2011/07/webinars-videos.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AMRXY6fSp7ImA9WhZUFE0.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-803674576369311998</id><published>2011-06-06T17:06:00.000-07:00</published><updated>2011-06-06T17:16:24.815-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-06T17:16:24.815-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="convention" /><category scheme="http://www.blogger.com/atom/ns#" term="e3" /><title>E3 Expo 2011 - June 7-9 - Los Angeles</title><content type="html">&lt;div style="text-align: left;"&gt;The 2011 E3 Expo begins tomorrow in LA!  It's always a fun and semi-relaxing expo for us.  Although we have our fair share of meetings and biz-dev going on, for the most part we spend a lot of the time actually &lt;i&gt;enjoying&lt;/i&gt; the event and getting to see all of the new games!  Usually we're stuck in a meeting room all day doing stuff...not this time!  This week we'll be out and about enjoying the talks, trailers, videos, events, etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm really excited to see some of the new trailers and get up to speed on this year's releases.  I work too much and haven't really been paying any attention to gaming news.  That's part of the irony of the gaming industry I suppose.  It's a bad habit and something we should all strive to avoid. :)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hit me up if you'll be in town for the expo.  Plenty of parties and cool stuff going on.  Hope to see some of you guys here.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In some other un-related news, I suck at updating the blog.  I'll try to fix that.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://blogs-images.forbes.com/jessedivnich/files/2011/05/e3.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://blogs-images.forbes.com/jessedivnich/files/2011/05/e3.png" border="0" alt="" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 253px; height: 300px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/Orj83LtL7PI" height="1" width="1"/&gt;</content><link rel="related" href="http://www.e3expo.com/" title="E3 Expo 2011 - June 7-9 - Los Angeles" /><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/803674576369311998/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2011/06/e3-expo-2011-june-7-9-los-angeles.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/803674576369311998?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/803674576369311998?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/Orj83LtL7PI/e3-expo-2011-june-7-9-los-angeles.html" title="E3 Expo 2011 - June 7-9 - Los Angeles" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2011/06/e3-expo-2011-june-7-9-los-angeles.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUHQnw7cCp7ImA9WhZSFkw.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-7276248268817775548</id><published>2011-03-31T14:35:00.000-07:00</published><updated>2011-03-31T15:57:13.208-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-31T15:57:13.208-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="faceware" /><category scheme="http://www.blogger.com/atom/ns#" term="webinar" /><category scheme="http://www.blogger.com/atom/ns#" term="image metrics" /><category scheme="http://www.blogger.com/atom/ns#" term="Rigging" /><category scheme="http://www.blogger.com/atom/ns#" term="facial" /><title>Facial Rigging Webinar - Balancing Quality and Control - Part I</title><content type="html">I'm doing a free facial rigging webinar next Monday on April 4th from 2-3pm PST as a part of Image Metrics' &lt;i&gt;Faceware 3.0 Weekly Webinar&lt;/i&gt; series.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;"Facial Rigging - Balancing Quality and Control"&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It's a three part session that will eventually lead to an attempt to answer the common question, "&lt;span style="font-style:italic;"&gt;What's the best way to build a facial rig?&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;This coming webinar will start us off with a discussion on the most common rig types I see in both the game-space as well as film and commercial, what our experiences have been with them in both quality and usability, and issues we've had to deal with in production using these different types of assets.  We'll go over what types of rigs tend to work best for different types of productions.  I'll be discussing the most common things that character riggers tend to leave out or don't polish enough when building facial rigs.   I'll also answer some common questions regarding joint placement, use of blendshapes and curve-based rigs, and skinning techniques.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For more info, &lt;a href="http://www.image-metrics.com/community/showthread.php?52-Faceware-3.0-Weekly-Webinar-003-quot-Facial-Rigging-I-Balancing-Quality-and-Control-quot"&gt;visit the IM forums.&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope to you see everyone there!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/3u13IikC5q0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/7276248268817775548/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2011/03/facial-rigging-balancing-quality-and.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/7276248268817775548?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/7276248268817775548?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/3u13IikC5q0/facial-rigging-balancing-quality-and.html" title="Facial Rigging Webinar - Balancing Quality and Control - Part I" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://www.scriptswell.net/2011/03/facial-rigging-balancing-quality-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QHQ307eip7ImA9WhZTGE8.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-8682140202212171395</id><published>2011-03-22T12:12:00.000-07:00</published><updated>2011-03-22T12:15:32.302-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-22T12:15:32.302-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="MaxScript" /><title>MEL/MAXScript Tutorial Requests</title><content type="html">I've been wanting to write another MEL and/or MAXScript tutorial lately, but I'm not sure yet what topic(s) I want to cover.  There's plenty of MEL commands and techniques and other stuff I could do but I figured I'd put out a call and see if anyone had some specific requests.  Leave a comment if you have an idea for a tutorial that you'd like to see.&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/XpiT0senBkg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/8682140202212171395/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2011/03/melmaxscript-tutorial-requests.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8682140202212171395?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8682140202212171395?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/XpiT0senBkg/melmaxscript-tutorial-requests.html" title="MEL/MAXScript Tutorial Requests" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>7</thr:total><feedburner:origLink>http://www.scriptswell.net/2011/03/melmaxscript-tutorial-requests.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04NQnc9eSp7ImA9Wx9VF0s.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-5012350263956587723</id><published>2011-02-03T09:03:00.000-08:00</published><updated>2011-02-03T13:53:13.961-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-03T13:53:13.961-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="faceware" /><category scheme="http://www.blogger.com/atom/ns#" term="image metrics" /><category scheme="http://www.blogger.com/atom/ns#" term="GDC" /><category scheme="http://www.blogger.com/atom/ns#" term="Game Developers Conference" /><title>Game Developers Conference (GDC) 2011</title><content type="html">Hey Scriptahs!  Apologies for the lack of updates lately.  I started a new job in December and with the holidays and such it's been a busy, busy couple of months.  I did get to take another trip to Scotland though to visit a client last week and I'll be all over North America this year, including being in San Francisco for GDC.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://enterbf3.com/images/gdc-bf3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 580px; height: 367px;" src="http://enterbf3.com/images/gdc-bf3.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Nick Ramsay and I will be doing a Live FACEWARE™ demo at GDC on Thursday (3/3) at 10:30am (Room 309, South Hall).  Image Metrics' facial animation software will soon be released to the public and we'll be showing you what it does and how to use it.&lt;br /&gt;&lt;br /&gt;There is also a technical artist meet-up brewing (looking like Wednesday evening).  Seth Gibson is organizing.  For more details check out this thread at TAO.  (&lt;a href="http://tech-artists.org/forum/showthread.php?t=1303"&gt;http://tech-artists.org/forum/showthread.php?t=1303&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;There are plenty of technical artist sessions at GDC this year, it should be great fun.  If you'll be at the conference leave a comment below., maybe we can meet up and grab a beer!&lt;br /&gt;&lt;br /&gt;&lt;script src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt;&lt;fb:like href="http://www.scriptswell.net/2011/02/game-developers-conference-gdc-2011.html" showfaces="false" colorscheme="dark"&gt;&lt;/fb:like&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/mtviuwqHNB0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/5012350263956587723/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2011/02/game-developers-conference-gdc-2011.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/5012350263956587723?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/5012350263956587723?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/mtviuwqHNB0/game-developers-conference-gdc-2011.html" title="Game Developers Conference (GDC) 2011" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2011/02/game-developers-conference-gdc-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cGSXcyfSp7ImA9Wx9SGE4.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-1147857011764617101</id><published>2010-12-08T10:50:00.000-08:00</published><updated>2010-12-08T12:10:28.995-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-08T12:10:28.995-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Export" /><category scheme="http://www.blogger.com/atom/ns#" term="fopen" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="fprint" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><category scheme="http://www.blogger.com/atom/ns#" term="How To Write To A Text File" /><category scheme="http://www.blogger.com/atom/ns#" term="fclose" /><category scheme="http://www.blogger.com/atom/ns#" term="maya tools" /><category scheme="http://www.blogger.com/atom/ns#" term="Data" /><title>MEL Scripting Tutorial: How To Write To A Text File</title><content type="html">In this mel scripting tutorial we'll look at how to write data out to a file so you can make your own data exporting tools.  By the end of it you'll have a firm understanding of and know how to take data from your Maya scene and write it out to a file.  This is a follow up to the previous tutorial: &lt;a href="http://www.scriptswell.net/2010/09/mel-tutorial-how-to-read-text-file.html"&gt;How To Read A Text File&lt;/a&gt;.  This article assumes you've read the previous tutorial and is a continuation of the concepts discussed in it.  If you've not read the tutorial on how to read a text file, please browse Script Swell's &lt;a href="http://www.scriptswell.net/p/technical-artist-tutorials.html"&gt;Technical Artist Tutorials &lt;/a&gt;or &lt;a href="http://www.scriptswell.net/2010/09/mel-tutorial-how-to-read-text-file.html"&gt;click here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Skill Level:&lt;/span&gt; Beginner to Intermediate&lt;br /&gt;&lt;br /&gt;There are two things you'll need in order to proceed: some data to write out, and a text a file to write it to.  To start off let's create a string array in Maya.  In the script editor, copy and paste the following and run it.&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;// Create A String Array With Test Data&lt;br /&gt;string $myStrArray[] = {"This is line one of my data from Maya.", "This is line two.", "And then line three!"} ;&lt;/pre&gt;Next, create a file in an easy location, e.g. "C:\mel\testFile_v01.txt".  In this file, on the first line type the following: "This is the first line of my text file, version 01!".   Save and close your file.&lt;br /&gt;&lt;br /&gt;Now let's get into some code and see how this works.  The idea here is that we're going to "open" our file as an object in Maya, put our data inside it, then "close" it.  If you recall in the previous tutorial we use the &lt;span style="font-weight: bold;"&gt;fopen&lt;/span&gt; command to open the file and prepare it for use.&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;// Create A String Array With Test Data&lt;br /&gt;string $myStrArray[] = {"This is line one of my data from Maya.", "This is line two.", "And then line three!"} ;&lt;br /&gt;&lt;br /&gt;// Define Your File Path&lt;br /&gt;string $filePath = "C:/mel/testFile_v01.txt" ;&lt;br /&gt;&lt;br /&gt;// Open Your File&lt;br /&gt;$fileId = `fopen $filePath "a"` ;&lt;/pre&gt;The first difference you may have noticed from the previous tutorial is that instead of "r" (for 'read') we've switched to "a" which stands for "append".  What this means is that we're telling MEL that when we're working with this particular file, we'll be writing to it but we'll be appending data onto the end of whatever is there.  This way using the "a" flag you can keep your current data intact and simply add more to it.  Let's continue on with more code.&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;// Create A String Array With Test Data&lt;br /&gt;string $myStrArray[] = {"This is line one of my data from Maya.", "This is line two.", "And then line three!"} ;&lt;br /&gt;&lt;br /&gt;// Define Your File Path&lt;br /&gt;string $filePath = "C:/mel/testFile_v01.txt" ;&lt;br /&gt;&lt;br /&gt;// Open Your File&lt;br /&gt;$fileId = `fopen $filePath "a"` ;&lt;br /&gt;&lt;br /&gt;// Print Array To File&lt;br /&gt;for($line in $myStrArray)&lt;br /&gt;fprint $fileId ($line+"\n") ;&lt;br /&gt;&lt;br /&gt;// Close File&lt;br /&gt;fclose $fileId ;&lt;/pre&gt;The newest line in our code starts with a for in loop and is looping through our string array one line at a time.  This is because in this case we don't just want to dump all the data to the file, we want to have control over how it's added and make sure it's exporting to an easily readable format.  We loop through our array one line at a time and use the &lt;span style="font-weight: bold;"&gt;fprint&lt;/span&gt; command.  What &lt;span style="font-weight: bold;"&gt;fprint&lt;/span&gt; does is essentially the same thing that the normal &lt;span style="font-weight: bold;"&gt;print&lt;/span&gt; command does except it prints to your text file instead of Maya's script editor.  Just like &lt;span style="font-weight: bold;"&gt;print &lt;/span&gt;though, it will not add a new line at the end of the argument and this must be done manually, hence the &lt;span style="font-style: italic;"&gt;"\n"&lt;/span&gt; that I've appended to the &lt;span style="font-style: italic;"&gt;$line&lt;/span&gt; variable.  If you leave this out, all of your data will print to a single line!   After we're finished printing out the data we're using &lt;span style="font-weight: bold;"&gt;fclose&lt;/span&gt; to "close" our file object.&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Tip: If you forget to use fclose and leave the file object "open" within Maya it will become locked and you won't be able to make changes to it outside of the program.  If this happens you will need to close Maya to &lt;/span&gt;&lt;span style="font-style: italic;"&gt;"unlock" your file.&lt;/span&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;After running this script, take a look at your text file and you'll see the file now reads the following:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;This is the first line of my text file, version 01!&lt;br /&gt;This is line one of my data from Maya.&lt;br /&gt;This is line two.&lt;br /&gt;And then line three!&lt;/pre&gt;Nicely done!  You are now one step closer to building your data export tool.  Next we'll double back slightly and look at another flag we can use in the &lt;span style="font-weight: bold;"&gt;fopen&lt;/span&gt; command.  Look at the code below.&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;// Create A String Array With Test Data&lt;br /&gt;string $myStrArray[] = {"This is line one of my data from Maya.", "This is line two.", "And then line three!"} ;&lt;br /&gt;&lt;br /&gt;// Define Your File Path&lt;br /&gt;string $filePath = "C:/mel/testFile_v01.txt" ;&lt;br /&gt;&lt;br /&gt;// Open Your File&lt;br /&gt;$fileId = `fopen $filePath "w"` ;&lt;br /&gt;&lt;br /&gt;// Print Array To File&lt;br /&gt;for($line in $myStrArray)&lt;br /&gt;fprint $fileId ($line+"\n") ;&lt;br /&gt;&lt;br /&gt;// Close File&lt;br /&gt;fclose $fileId ;&lt;/pre&gt;The only change here is we've swapped the "a" flag with it's brother: "w" which stands for "write".  What &lt;span style="font-style: italic;"&gt;write &lt;/span&gt;will do is destroy the prior contents of the file and replace them with whatever we're printing to it.  So your result will be:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;This is line one of my data from Maya.&lt;br /&gt;This is line two.&lt;br /&gt;And then line three!&lt;/pre&gt;This time only the string array has been printed to the file and the original file's contents were destroyed.&lt;br /&gt;&lt;br /&gt;Both of these flags are useful depending on the context of what you're doing.  Be sure to check out these commands in the MEL documentation as well for a slightly more in-depth look at how they work.&lt;br /&gt;&lt;br /&gt;It really is  simple as that to write out data!  As long as you remember to &lt;span style="font-weight: bold;"&gt;fclose&lt;/span&gt; your file and use the correct flags when using &lt;span style="font-weight: bold;"&gt;fopen&lt;/span&gt; you shouldn't have any trouble using this technique.&lt;br /&gt;&lt;br /&gt;For more tutorials check out the &lt;a href="http://www.scriptswell.net/p/technical-artist-tutorials.html"&gt;Technical Artist Tutorials&lt;/a&gt; page.  Leave a comment below if you have any thoughts or questions and thanks for reading!&lt;br /&gt;&lt;br /&gt;&lt;script src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt;&lt;fb:like href="http://www.scriptswell.net/2010/12/mel-scripting-tutorial-how-to-write-to.html" showfaces="false" colorscheme="dark"&gt;&lt;/fb:like&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/LduYA9264sA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/1147857011764617101/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/12/mel-scripting-tutorial-how-to-write-to.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1147857011764617101?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1147857011764617101?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/LduYA9264sA/mel-scripting-tutorial-how-to-write-to.html" title="MEL Scripting Tutorial: How To Write To A Text File" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/12/mel-scripting-tutorial-how-to-write-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAGRX45cSp7ImA9Wx9TEkQ.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-7827573486833424701</id><published>2010-11-19T12:23:00.000-08:00</published><updated>2010-11-20T14:05:24.029-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-20T14:05:24.029-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="break" /><category scheme="http://www.blogger.com/atom/ns#" term="warning" /><category scheme="http://www.blogger.com/atom/ns#" term="Return" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="error" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><category scheme="http://www.blogger.com/atom/ns#" term="continue" /><title>A Few Fundamental MEL Commands Everyone Should Know</title><content type="html">Here are a couple of useful MEL commands/operators that you'll end up using in a lot of the stuff you write.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;continue ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Skips one iteration of a loop.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;break ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Stops the loop and continues script where the loop ends.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Warning("&lt;/span&gt;You messed up, but it isn't too bad so I'll keep going.&lt;span style="font-weight: bold;"&gt;")&lt;/span&gt; ;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Warnings alert the user that something is awry, but it's not a deal breaker.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Error("&lt;/span&gt;You messed up bad, I need to quit now.&lt;span style="font-weight: bold;"&gt;")&lt;/span&gt; ;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The error command will stop a script in it's tracks, ending everything. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;return ; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Ends a procedure/function/method, but not the entire script.  Continues on where the procedure ends.  Can also be used to return a value (return $myString).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cgsutra.com/"&gt;CGSutra&lt;/a&gt; has a great article going into more depth on these and a lot more of the fundamental MEL concepts.  &lt;a href="http://www.cgsutra.com/autodesk_maya_tutorials/mel/chapter_06/ch06_mel_introduction_to_programming_concepts.php"&gt;Check it out here.&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/CwNVClmehtg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/7827573486833424701/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/11/few-fundamental-mel-commands-everyone.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/7827573486833424701?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/7827573486833424701?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/CwNVClmehtg/few-fundamental-mel-commands-everyone.html" title="A Few Fundamental MEL Commands Everyone Should Know" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/11/few-fundamental-mel-commands-everyone.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08MSHw6eCp7ImA9Wx5UF00.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-2168932487364342833</id><published>2010-10-20T10:23:00.000-07:00</published><updated>2010-10-21T15:58:09.210-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-21T15:58:09.210-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="animators resource" /><category scheme="http://www.blogger.com/atom/ns#" term="animation" /><category scheme="http://www.blogger.com/atom/ns#" term="Animschool" /><category scheme="http://www.blogger.com/atom/ns#" term="schools" /><category scheme="http://www.blogger.com/atom/ns#" term="Rigging" /><category scheme="http://www.blogger.com/atom/ns#" term="modeling" /><title>animatorsresource: New Animation School: AnimSchool</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/___mEmpez3ck/TL4AxzKZSlI/AAAAAAAAAVk/JGWnc_hReng/s1600/AnimSchoolLogo2b.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 250px; height: 250px;" src="http://2.bp.blogspot.com/___mEmpez3ck/TL4AxzKZSlI/AAAAAAAAAVk/JGWnc_hReng/s1600/AnimSchoolLogo2b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;img src="file:///C:/DOCUME%7E1/jayg/LOCALS%7E1/Temp/moz-screenshot.png" alt="" /&gt;&lt;img src="file:///C:/DOCUME%7E1/jayg/LOCALS%7E1/Temp/moz-screenshot-1.png" alt="" /&gt;&lt;a href="http://animatorsresource.blogspot.com/2010/10/new-animation-school-animschool.html?spref=bl"&gt;animatorsresource: New Animation School: AnimSchool&lt;/a&gt;: "...There is a new online animation school set to debut in November called AnimSchool. school will be run by the creator of &lt;a href="http://www.3dappealblog.com/"&gt;3D Appeal Blog&lt;/a&gt; and &lt;a href="http://www.3dappealblognow.com/"&gt;3D Appeal Blog Now&lt;/a&gt;, &lt;a href="http://www.linkedin.com/profile/view?id=925408&amp;amp;authType=name&amp;amp;authToken=oezR&amp;amp;locale=en_US&amp;amp;pvs=pp&amp;amp;trk=ppro_viewmore"&gt;David Gallagher&lt;/a&gt;."&lt;br /&gt;&lt;br /&gt;Looks like David's school will have a, "3D Character" program that teaches modeling and rigging on top of the animation classes.  Read JP's article over at &lt;a href="http://animatorsresource.blogspot.com/"&gt;Animators Resource&lt;/a&gt; for more info and an interview with David.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt;&lt;fb:like href="http://www.scriptswell.net/2010/10/animatorsresource-new-animation-school.html" showfaces="false" colorscheme="dark"&gt;&lt;/fb:like&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/9XdRiAKIMP8" height="1" width="1"/&gt;</content><link rel="related" href="http://animatorsresource.blogspot.com/2010/10/new-animation-school-animschool.html?spref=bl" title="animatorsresource: New Animation School: AnimSchool" /><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/2168932487364342833/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/10/animatorsresource-new-animation-school.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2168932487364342833?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2168932487364342833?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/9XdRiAKIMP8/animatorsresource-new-animation-school.html" title="animatorsresource: New Animation School: AnimSchool" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/___mEmpez3ck/TL4AxzKZSlI/AAAAAAAAAVk/JGWnc_hReng/s72-c/AnimSchoolLogo2b.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/10/animatorsresource-new-animation-school.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEGRHkycCp7ImA9Wx5UFkw.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-1200332827428581239</id><published>2010-10-17T10:23:00.000-07:00</published><updated>2010-10-20T16:50:25.798-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-20T16:50:25.798-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><title>MEL Scripting Tutorial: How To Read A Text File</title><content type="html">This is a scripting tutorial that will show you how to use MEL to read a text file and use the data from it in Maya.  As a scripter it's an essential skill to have.  A lot of times there will be data you need in a file that's outside of your program and you'll need to get it.  The file may contain animation data you need to access, skin weighting data, a list of objects needed in a scene or any other type of data you could imagine a text file having.  This tutorial assumes you have a basic understanding of MEL syntax and how to run a script in Maya.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Skill Level:&lt;/span&gt; Beginner to Intermediate&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;First off we need a data file to test with, so let's make one.  Open up your favorite text editor (&lt;span style="font-style: italic;"&gt;notepad will work if you don't have anything else&lt;/span&gt;), create a new &lt;span style="font-weight: bold;"&gt;.TXT&lt;/span&gt; file. and save it somewhere as "&lt;span style="font-weight: bold;"&gt;myDataFile.txt"&lt;/span&gt;.  For this lesson, I recommend saving your file somewhere with a relatively simple file path, e.g. &lt;span style="font-style: italic;"&gt;"C:\mel\myDataFile.txt".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Copy and paste the following data into your file and save:&lt;/span&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;//objectName,posX,posY,posZ,rotX,rotY,rotZ,scaleX,scaleY,scaleZ&lt;br /&gt;pCube1,0,0,0,0,0,0,1,1,1&lt;br /&gt;pSphere1,-5,10,-5,-90,90,-45,1,1,1&lt;br /&gt;pCylinder1,2.5,2.342,4.2823,0,0,0,1,1,1&lt;br /&gt;pPlane1,0,0,0,360,180,45,1,1,1&lt;/pre&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;Tip: The file doesn't necessarily have to use a .TXT file extension.  Any text-based file format will work the same way.  You can even make up your own file extension.  I like to use .RIG files.&lt;/span&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Now that we have a file to test with let's look at what's in it.  It's important to look at what type of data you're working with so you can plan on how to bring it in and in what format you'll need it to be in once it's in Maya.&lt;br /&gt;&lt;br /&gt;In this case there are multiple lines of text, with each line having ten values separated by commas.  We refer to this type of data as &lt;span style="font-style: italic;"&gt;comma-separated&lt;/span&gt;.  Our example has the name of an object and it's nine transform values (&lt;span style="font-style: italic;"&gt;translate X,Y,Z, rotate X,Y,Z, scale X,Y,Z&lt;/span&gt;). Note that the first line doesn't have any actual values, it just serves to tell us what each value represents.  This is common in data files.  You may need to adjust your script to skip the first line when it brings in the data.&lt;br /&gt;&lt;br /&gt;Using this data we're going to find the objects in our Maya scene and set their transforms.  Let's get to it!&lt;br /&gt;&lt;br /&gt;The first part of our script is putting the path to the file we just created into a string variable.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// Define Your File Path&lt;br /&gt;string $filePath = "C:/mel/myDataFile.txt" ;&lt;/pre&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Tip: File paths in Maya (and most packages) require that you use forward slashes (/) instead of backslashes (\).  You will get errors if you use backslashes.&lt;/span&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;span&gt;&lt;br /&gt;Now that we have the path saved in &lt;span style="font-weight: bold;"&gt;$filePath&lt;/span&gt; we're going to use a MEL command called &lt;span style="font-weight: bold;"&gt;fopen&lt;/span&gt; .  This command tells Maya to find the file and open it and also tells Maya what we're going to do with the file.  There is an optional string argument (&lt;span style="font-style: italic;"&gt;I recommend always using it&lt;/span&gt;) that will tell Maya if you're going to just read the file, write to it, or append to the end of the existing file.  Check out the MEL Documentation for a more in-depth description on how these work, but for now just be aware that since we're reading the data from the file, we're going to use "r" for &lt;span style="font-style: italic;"&gt;read&lt;/span&gt;.&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// Open Your File&lt;br /&gt;$fileId = `fopen $filePath "r"` ;&lt;/pre&gt;&lt;br /&gt;With the line of code above we've stored our "open" file into the variable &lt;span style="font-weight: bold;"&gt;$fileId.&lt;/span&gt; Now anytime we want to refer to that file in our script we can refer to &lt;span style="font-weight: bold;"&gt;$fileId.  &lt;/span&gt;By using the &lt;span style="font-style: italic;"&gt;"r"&lt;/span&gt; string in the command we've also told Maya that it only has permission to &lt;span style="font-style: italic;"&gt;read &lt;/span&gt;from the file and nothing else.  This way we don't have to worry about the file being changed in any way.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;-----------------------------------------------------------&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Tip: In the fread command, besides "r" (read), you can also use "w" (write) or "a" (append).  More on this in the next tutorial.&lt;/span&gt;&lt;span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;-----------------------------------------------------------&lt;br /&gt;&lt;span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;Now that the file is open, let's interact with it. There are two commands we're going to look at in this tutorial.  The first command is &lt;span style="font-weight: bold;"&gt;fread&lt;/span&gt;.  This is used in the following way:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// Read The Data Using fread&lt;br /&gt;string $data = `fread $fileId $data` ;&lt;/pre&gt;&lt;br /&gt;The usage is a little odd since we're simultaneously defining a string variable and using it as an argument in the command, but this is the way &lt;span style="font-weight: bold;"&gt;fread&lt;/span&gt; works.  What it will do is take all of your data in the file and return it as a single string.  In this case our return string value would be:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// Result: objectName,polygonType,posX,posY,posZ,rotX,rotY,rotZ,scaleX,scaleY,scaleZ&lt;br /&gt;pCube1,0,0,0,0,0,0,1,1,1&lt;br /&gt;pSphere1,-5,10,-5,-90,90,-45,1,1,1&lt;br /&gt;pCylinder1,2.5,2.342,4.2823,0,0,0,1,1,1&lt;br /&gt;pPlane1,0,0,0,360,180,45,1,1,1//&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Nice! All of the data from the text file is in Maya!   Success!&lt;br /&gt;&lt;br /&gt;The only problem is...ALL of that information is in a single string.  It's not much use to you in this format since the actual data is dense and on multiple lines.  If you really wanted to you could take that string and break it up into all of the data you need (&lt;span style="font-style: italic;"&gt;a mixture of loops and heavy usage of &lt;/span&gt;&lt;a style="font-style: italic;" href="http://www.scriptswell.net/2010/03/mel-tutorial-tokenize.html"&gt;MEL's tokenize command&lt;/a&gt;)...but there's an easier way to handle it.  There is another command we can use called &lt;span style="font-weight: bold;"&gt;fgetline&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;fgetline&lt;/span&gt; command will get a single line of data from the file and put it into a string variable.   This becomes useful because we can now create a string array and put each line into it separately.  This will give us a string array containing our entire text file.&lt;br /&gt;&lt;br /&gt;The only hiccup here is &lt;span style="font-weight: bold;"&gt;fgetline &lt;/span&gt;will simply get one line of text and then stop.   It's not smart enough to continue through the whole text file, we have to tell it to do that.   We do this with a &lt;span style="font-weight: bold;"&gt;WHILE&lt;/span&gt; loop.  Check it out below ...let's combine everything we've done so far:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// Define Your File Path&lt;br /&gt;string $filePath = "C:/mel/myDataFile.txt" ;&lt;br /&gt;&lt;br /&gt;// Open Your File&lt;br /&gt;$fileId = `fopen $filePath "r"` ;&lt;br /&gt;&lt;br /&gt;// Get The First Line&lt;br /&gt;string $nextLine = `fgetline $fileId` ;&lt;br /&gt;&lt;br /&gt;// Loop Until The String Size Is Zero (No Data)&lt;br /&gt;while (size($nextLine) &gt; 0) {&lt;br /&gt;&lt;br /&gt;// Strip Whitespace From The Beginning And End Of The Line&lt;br /&gt;string $cleanLine = strip($nextLine) ;&lt;br /&gt;&lt;br /&gt;// Print Line&lt;br /&gt;print ($cleanLine+"\n") ;&lt;br /&gt;&lt;br /&gt;// Get Next Line And Continue&lt;br /&gt;$nextLine = `fgetline $fileId` ;&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;If you run this, you'll see Maya print out the five lines of our text file.  This time, each of those lines was printed one at a time.   Ultimate success!&lt;br /&gt;&lt;br /&gt;Let's make a few more additions and turn this into a procedure.  First I want it to return an array, so I'm going to define a string array and then put each of my lines into it when I get them from the text file.  Next I want to add an argument to tell it to skip the first line.  This is useful if I know the first line of my file contains data I don't want.  Lastly, instead of hard coding the path into the function, I want to pass the file path into my procedure as an argument to make it more versatile.&lt;br /&gt;&lt;br /&gt;When we're finished our procedure looks like this:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// **********************************************************&lt;br /&gt;// Reads A Text File And Returns A String Array Of Each Line&lt;br /&gt;global proc string[] jgTextFileToStringArray (int $skipFirstLine, string $filePath) {&lt;br /&gt;&lt;br /&gt;// Open File&lt;br /&gt;$fileId = `fopen $filePath "r"` ;&lt;br /&gt;&lt;br /&gt;// Define String Array&lt;br /&gt;string $dataArray[] ;&lt;br /&gt;&lt;br /&gt;// Get The First Line&lt;br /&gt;string $nextLine = `fgetline $fileId` ;&lt;br /&gt;&lt;br /&gt;// Loop Until The String Size Is Zero (No Data On That Line)&lt;br /&gt;while (size($nextLine) &gt; 0) {&lt;br /&gt;&lt;br /&gt;// Strip Whitespace From The Beginning And End Of The Line&lt;br /&gt;string $cleanLine = strip($nextLine) ;&lt;br /&gt;&lt;br /&gt;// Add To Array&lt;br /&gt;$dataArray[size($dataArray)] = $cleanLine ;&lt;br /&gt;&lt;br /&gt;// Get Next Line And Continue&lt;br /&gt;$nextLine = `fgetline $fileId` ;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Remove First Line&lt;br /&gt;if($skipFirstLine) stringArrayRemoveAtIndex(0,$dataArray) ;&lt;br /&gt;&lt;br /&gt;// Return Array&lt;br /&gt;return $dataArray ;&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Check out the finished version here: &lt;/span&gt;&lt;a href="http://www.jaygrenier.com/mel/jgTextFileToStringArray.mel"&gt;jgTextFileToStringArray.mel&lt;/a&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;The next tutorial will extend on this and go over how to write to and append to a text file.&lt;br /&gt;&lt;br /&gt;Leave a comment below if you found this helpful or have any questions.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Looking for more tutorials?  Check out Script Swell's &lt;a href="http://www.scriptswell.net/p/technical-artist-tutorials.html"&gt;Technical Artist Tutorials&lt;/a&gt; page.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt;&lt;fb:like href="http://www.scriptswell.net/2010/09/mel-tutorial-how-to-read-text-file.html" showfaces="false" colorscheme="dark"&gt;&lt;/fb:like&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/lKFg2AJa7OQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/1200332827428581239/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/09/mel-tutorial-how-to-read-text-file.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1200332827428581239?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1200332827428581239?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/lKFg2AJa7OQ/mel-tutorial-how-to-read-text-file.html" title="MEL Scripting Tutorial: How To Read A Text File" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/09/mel-tutorial-how-to-read-text-file.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUBRHk6cCp7ImA9Wx5WF04.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-4720857389930716358</id><published>2010-09-28T16:34:00.001-07:00</published><updated>2010-09-28T20:17:35.718-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-28T20:17:35.718-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="Recursive" /><category scheme="http://www.blogger.com/atom/ns#" term="recursion" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Understanding Recursion</title><content type="html">Always remember...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"In order to understand &lt;/span&gt;&lt;a style="font-style: italic;" href="http://www.google.com/search?q=recursion"&gt;recursion&lt;/a&gt;&lt;span style="font-style: italic;"&gt;, you must first understand &lt;/span&gt;&lt;a style="font-style: italic;" href="http://en.wikipedia.org/wiki/Recursion"&gt;recursion&lt;/a&gt;&lt;span style="font-style: italic;"&gt;."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;:-)&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/eypwSoXk4iA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/4720857389930716358/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/09/understanding-recursion.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/4720857389930716358?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/4720857389930716358?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/eypwSoXk4iA/understanding-recursion.html" title="Understanding Recursion" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/09/understanding-recursion.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUENQ3Y7eip7ImA9Wx5WEkg.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-1512508322589393194</id><published>2010-09-23T08:49:00.000-07:00</published><updated>2010-09-23T09:01:32.802-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-23T09:01:32.802-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="milestone" /><category scheme="http://www.blogger.com/atom/ns#" term="script swell" /><title>ScriptSwell Milestone - Over 1000 Visitors This Month!</title><content type="html">1,135 unique visitors this month!  The one thousand mark is a milestone I've been waiting for and to my surprise it went way up and over in the last few days.  Apparently people &lt;span style="font-style: italic;"&gt;really&lt;/span&gt; like knowing how to &lt;a href="http://www.scriptswell.net/2010/09/mel-remove-all-namespaces.html"&gt;remove namespaces&lt;/a&gt;. &lt;span style="font-weight: bold;"&gt;:-)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I just wanted to say thanks and give a quick shout out to everyone who has been visiting Script Swell so far this year.  I enjoy writing this blog a lot but it's always more motivating to know people are &lt;span style="font-style: italic;"&gt;reading &lt;/span&gt;it.  Thanks for stopping by and I hope Script Swell continues to be a useful resource for you.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;continue ;&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/qZ0n86u8Jek" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/1512508322589393194/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/09/scriptswell-milestone-over-1000.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1512508322589393194?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1512508322589393194?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/qZ0n86u8Jek/scriptswell-milestone-over-1000.html" title="ScriptSwell Milestone - Over 1000 Visitors This Month!" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/09/scriptswell-milestone-over-1000.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUFRH46cSp7ImA9Wx5WEks.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-2387065505876730443</id><published>2010-09-22T12:38:00.000-07:00</published><updated>2010-09-23T10:50:15.019-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-23T10:50:15.019-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Free Mel Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="blendshapes" /><category scheme="http://www.blogger.com/atom/ns#" term="nodes" /><category scheme="http://www.blogger.com/atom/ns#" term="mesh" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="deformers" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><title>MEL: Delete Targets From A Blendshape Node</title><content type="html">Cleaning up a blendshape node in Maya can be a nightmare. It makes it really difficult to remove targets from the node and even when you do it leaves ghost indexes that can only be removed if you know what they are. The script below allows you to highlight the targets you want to keep in the Channel Box and remove all of the others. Clean and simple. It does this by building a new blendshape node with only your highlighted targets and reconnecting everything exactly the way it was originally. This includes ordering the input stack in the same order it found them.&lt;br /&gt;&lt;br /&gt;Code Can Be Found Here: &lt;a href="http://jaygrenier.com/mel/jgRebuildBlendshapeNode.mel"&gt;jgRebuildBlendshapeNode.mel&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A smart man (or woman!) might wonder why Maya has such a difficult time simply deleting some blendshapes. A discussion for another day I suppose.&lt;br /&gt;&lt;br /&gt;This script utilizes the jgReturnMeshDeformers procedure from yesterday's post. Read about it &lt;a href="http://www.scriptswell.net/2010/09/mel-list-all-deformers-on-mesh.html"&gt;here.&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/C6wFdALXrRg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/2387065505876730443/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/09/mel-delete-targets-from-blendshape-node.html#comment-form" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2387065505876730443?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/2387065505876730443?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/C6wFdALXrRg/mel-delete-targets-from-blendshape-node.html" title="MEL: Delete Targets From A Blendshape Node" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>9</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/09/mel-delete-targets-from-blendshape-node.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYMRn45eyp7ImA9Wx5WEEQ.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-6175027103503913248</id><published>2010-09-21T10:37:00.001-07:00</published><updated>2010-09-21T11:19:47.023-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-21T11:19:47.023-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Free Mel Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="mesh" /><category scheme="http://www.blogger.com/atom/ns#" term="tech-artists.org" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="nodeType" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="deformers" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><category scheme="http://www.blogger.com/atom/ns#" term="listHistory" /><title>MEL: List All Deformers On A Mesh</title><content type="html">Yesterday while working on another script, I found myself in need of a list of all of the deformers on a piece of geometry.  It seemed like a simple enough thing to get. After all, it was listed right there in the history tab. Fast forward an hour later and the only method I had come up with to find the data was not going to work for what I needed.  So, I reached out to a couple of friends and posted on &lt;a href="http://www.tech-artists.org/"&gt;Tech-Artists.org&lt;/a&gt; and got a really great answer.  It's still a bit convoluted and I'm bitter that Maya won't just give it to you easily, but it works and it's a relatively small amount of code.&lt;br /&gt;&lt;br /&gt;I had been tinkering with using the &lt;span style="font-weight: bold;"&gt;listHistory&lt;/span&gt;&lt;span&gt; mel command but the problem with this is that it returns ALL of the history on the mesh object and not just the deformers.  My issue was then, how do I distinguish the deformers from the rest of the data?  Without a list of every possible deformer Maya offers to compare it to, there's no way I could find them all.&lt;br /&gt;&lt;br /&gt;Solution?  `&lt;span style="font-weight: bold;"&gt;nodeType -inherited`&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This command along with the &lt;span style="font-style: italic; font-weight: bold;"&gt;-inherited&lt;/span&gt; flag will &lt;span style="font-style: italic;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;Return a string array containing the names of each of the base node types inherited by the given object."  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Someone pointed out on the forum that all deformers inherit from the "&lt;span style="font-style: italic;"&gt;geometryFilter&lt;/span&gt;" base node.  With this information we can check through each node in the meshes' history and see if it inherits from &lt;span style="font-style: italic;"&gt;geometryFilter.&lt;/span&gt;  With this, we can return a nice, clean list of all the deformers on a mesh object.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// **********************************************************&lt;br /&gt;// Returns All Deformers On A Mesh&lt;br /&gt;global proc string[] jgReturnMeshDeformers (string $mesh) {&lt;br /&gt;&lt;br /&gt; // List History&lt;br /&gt; string $history[] = `listHistory $mesh` ;&lt;br /&gt;&lt;br /&gt; // Loop And Check If It's A Deformer&lt;br /&gt; string $deformers[] ;&lt;br /&gt; for($node in $history) {&lt;br /&gt;     string $types[] = `nodeType -inherited $node`;&lt;br /&gt;     if(stringArrayContains("geometryFilter",$types)) {&lt;br /&gt;         stringArrayInsertAtIndex(size($deformers),$deformers,$node) ;&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return $deformers ;&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Download Here: &lt;a href="http://www.jaygrenier.com/mel/jgReturnMeshDeformers.mel"&gt;jgReturnMeshDeformers.mel&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Another little gem that comes with this method is that it returns them in the current stack order.  Bonus!&lt;br /&gt;&lt;br /&gt;So far this method is working out very well for my needs.  If you find any issues with it or would like to discuss, please leave a comment below.&lt;br /&gt;&lt;br /&gt;Tomorrow's post will be about the script I was originally needing this for, which is a procedure to rebuild a blendShape node with only your specified targets.  Maya doesn't allow you delete targets from a blendShape node without a hassle, and when it does delete them it leaves empty target indexes and a big mess under the hood.  Swing by tomorrow for more about this.  Cheers!&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/q-L9lKw7B_M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/6175027103503913248/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/09/mel-list-all-deformers-on-mesh.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/6175027103503913248?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/6175027103503913248?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/q-L9lKw7B_M/mel-list-all-deformers-on-mesh.html" title="MEL: List All Deformers On A Mesh" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>7</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/09/mel-list-all-deformers-on-mesh.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UHQHk5eip7ImA9Wx5UFk0.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-8436449085332182776</id><published>2010-09-16T15:01:00.000-07:00</published><updated>2010-10-20T13:07:11.722-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-20T13:07:11.722-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Free Mel Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="Incremental Save" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><title>MEL Script: Incremental Save</title><content type="html">This mel script will automatically increment your saved scene for you.   Simple and sweet, just source the script to either increment your already numbered scene or to add a serial number at the end of a filename without one.  Also adds your new file to your Recent Files list in the File menu.  I recommend saving it and then calling it with a shelf button for easy access.&lt;br /&gt;&lt;br /&gt;Download Here: &lt;a href="http://www.jaygrenier.com/mel/jgIncrementalSave.mel"&gt;MEL Script - jgIncrementalSave.mel&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// **********************************************************  &lt;br /&gt;// Automatically Increments A Saved Maya File&lt;br /&gt;global proc jgIncrementalSave () {&lt;br /&gt;&lt;br /&gt;// Scene File Name&lt;br /&gt;string $sceneFile = `file -q -sn` ;&lt;br /&gt;&lt;br /&gt;// Get File Extension&lt;br /&gt;string $extension = `fileExtension $sceneFile` ;&lt;br /&gt;&lt;br /&gt;// Remove Extension&lt;br /&gt;string $fileNameNoExt ;&lt;br /&gt;if($extension == "mb" || $extension ==  ".ma") {&lt;br /&gt;&lt;br /&gt; // Tokenize Filename&lt;br /&gt; string $buffer[] ;&lt;br /&gt; tokenize $sceneFile "." $buffer ;&lt;br /&gt;&lt;br /&gt; // Recompile Scenename Without Extension&lt;br /&gt; for($i = 0; $i &lt; (size($buffer)-1); $i++) {    $fileNameNoExt = $fileNameNoExt + $buffer[$i] ;   }    } else {      // Error Check   error "Open file isn't .mb or .ma, please save before incrementing." ;    }    // Extract Name And Current Version Using Regex  string $nameWithNoVersion = `match ".*[^0-9]" $fileNameNoExt` ;  string $currentVersion = `match "[0-9]+$" $fileNameNoExt` ;   // Check For Integer, Add One If None  if($currentVersion == "") $currentVersion = "00" ;   // Increment Version  int $int = $currentVersion ;  $int++ ;   // Pad Digits If Needed  int $beforeCount = size($currentVersion) ;  string $incVersion = $int ;  int $afterCount = size($incVersion) ;  if($beforeCount &gt; $afterCount) {&lt;br /&gt; while($beforeCount &gt; $afterCount) {&lt;br /&gt;  $incVersion = ("0"+$incVersion) ;&lt;br /&gt;  $afterCount = size($incVersion) ;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Make New Filename&lt;br /&gt;string $newFileName = ($nameWithNoVersion+$incVersion+"."+$extension) ;&lt;br /&gt;&lt;br /&gt;// Save It&lt;br /&gt;file -rename $newFileName ;&lt;br /&gt;file -f -save ;&lt;br /&gt;&lt;br /&gt;// Add To Recent File List&lt;br /&gt;if($extension == "mb") catch(`addRecentFile $newFileName "mayaBinary"`) ;&lt;br /&gt;if($extension == "ma") catch(`addRecentFile $newFileName "mayaAscii"`) ;&lt;br /&gt;&lt;br /&gt;// Finish&lt;br /&gt;print ("Saved as "+$newFileName+"\n") ;&lt;br /&gt;&lt;br /&gt;} jgIncrementalSave ;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As always if you find any bugs, have any questions about the code, or would like to make suggestions please leave a comment below.&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/nN7Rh9xVvFc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/8436449085332182776/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/09/mel-jgincrementalsavemel-increment-your.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8436449085332182776?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8436449085332182776?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/nN7Rh9xVvFc/mel-jgincrementalsavemel-increment-your.html" title="MEL Script: Incremental Save" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>7</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/09/mel-jgincrementalsavemel-increment-your.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IDQ3w6eSp7ImA9Wx5UFk0.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-8179933304070181787</id><published>2010-09-13T12:17:00.000-07:00</published><updated>2010-10-20T13:12:52.211-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-20T13:12:52.211-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Free Mel Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="Namespacing" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="Namespace" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><category scheme="http://www.blogger.com/atom/ns#" term="Removing Namespace" /><title>MEL Script: Remove All Namespaces</title><content type="html">There are already a few posts on ScriptSwell dealing with namespaces in general, but here is a quick and dirty way to just remove &lt;span style="font-style: italic;"&gt;all&lt;/span&gt; of them from your scene, no questions asked.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;&lt;br /&gt;// Get All Nodes In Scene&lt;br /&gt;string $allNodes[] = `ls` ;&lt;br /&gt;&lt;br /&gt;// Loop Through Them&lt;br /&gt;for($node in $allNodes) {&lt;br /&gt;&lt;br /&gt; // Tokenize And Rename&lt;br /&gt; string $buffer[] ;&lt;br /&gt; tokenize $node ":" $buffer ;&lt;br /&gt; string $newName = $buffer[size($buffer)-1] ;&lt;br /&gt; catch(`rename $node $newName`) ;&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;This uses the &lt;span style="font-style: italic;"&gt;tokenize&lt;/span&gt; command.  For more info, check out this &lt;span style="font-style: italic;"&gt;&lt;a href="http://www.scriptswell.net/2010/03/mel-tutorial-tokenize.html"&gt;mel tutorial on how to use the tokenize command&lt;/a&gt;.&lt;/span&gt;  Essentially it's looping through every node in your scene, checking if there are colons in the name of it, and renaming the object to what it would be with no namespaces.&lt;br /&gt;&lt;br /&gt;The reason I call this dirty is because it has potential to cause naming conflicts in your scene file.  In a lot of cases namespaces are there for a reason, so you should make sure it's safe to remove them before doing so.  Maya does not support having more than one object with the same name, so if you run this script it may end up changing the names of some of your nodes.  Usually this is in the form of adding a number to the end of it.  (i.e. &lt;span style="font-style: italic;"&gt;hand_CTRL&lt;/span&gt; becomes &lt;span style="font-style: italic;"&gt;hand_CTRL1&lt;/span&gt;).  Be sure to save your scene before running this (as you should with any MEL script) and do some testing before you continue forward to make sure everything is working like it should.&lt;br /&gt;&lt;br /&gt;Also:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Every Maya scene file has a list of namespaces that have at one time or another been used in that scene.  This script will &lt;span style="font-style: italic;"&gt;not &lt;/span&gt;remove any from that list.&lt;/li&gt;&lt;li&gt;If something is referenced in your scene, this will not be able to remove the namespace properly.&lt;/li&gt;&lt;li&gt;You'll see a slew of error messages pass by, this is Maya trying to rename nodes that aren't allowed to be renamed.  You can ignore these.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;For more reading about namespaces in Maya, check out the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.scriptswell.net/2010/02/mel-remove-namespaces-from-string-or.html"&gt;More In-Depth Post On Removing Namespaces Using Tokenize&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.scriptswell.net/2010/02/mel-working-with-multiple-level.html"&gt;Working With Multiple Level Namespaces&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/cFJVt42evjQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/8179933304070181787/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/09/mel-remove-all-namespaces.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8179933304070181787?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8179933304070181787?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/cFJVt42evjQ/mel-remove-all-namespaces.html" title="MEL Script: Remove All Namespaces" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>5</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/09/mel-remove-all-namespaces.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkACQHwyeyp7ImA9Wx5RFEw.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-8919647785852561469</id><published>2010-08-21T11:14:00.000-07:00</published><updated>2010-08-21T11:19:21.293-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-21T11:19:21.293-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="articles" /><title>Repost: Some lesser-known truths about programming</title><content type="html">I saw this on &lt;a href="http://www.reddit.com"&gt;Reddit&lt;/a&gt; this morning and thought some of you may like to read it.  Find the link to the full article on &lt;a href="http://dotmac.rationalmind.net"&gt;http://dotmac.rationalmind.net&lt;/a&gt; below.&lt;br /&gt;&lt;blockquote style="color: rgb(204, 204, 204);"&gt;My experience as a programmer has taught me a few things about writing  software.  Here are some things that people might find surprising about  writing code:&lt;/blockquote&gt;&lt;ul style="color: rgb(204, 204, 204);"&gt;&lt;blockquote&gt;&lt;li&gt;A programmer spends about 10-20% of his time writing code, and most programmers write about &lt;a href="http://stackoverflow.com/questions/966800/mythical-man-month-10-lines-per-developer-day-how-close-on-large-projects"&gt;10-12 lines of code per day&lt;/a&gt;  that goes into the final product, regardless of their skill level.   Good programmers spend much of the other 90% thinking, researching, and  experimenting to find the best design.  Bad programmers spend much of  that 90% debugging code by randomly making changes and seeing if they  work.&lt;br /&gt;“A great lathe operator commands several times the wage of an  average lathe operator, but a great writer of software code is worth  10,000 times the price of an average software writer.” –Bill Gates&lt;/li&gt;&lt;li&gt;A  good programmer is ten times more productive than an average  programmer.  A great programmer is 20-100 times more productive than the  average.  This &lt;a href="http://www.devtopics.com/programmer-productivity-the-tenfinity-factor/"&gt;is not an exaggeration&lt;/a&gt;  – studies since the 1960′s have consistently shown this.  A bad  programmer is not just unproductive – he will not only not get any work  done, but create a lot of work and headaches for others to fix.&lt;/li&gt;&lt;/blockquote&gt;&lt;/ul&gt;Read the full article here: &lt;a href="http://dotmac.rationalmind.net/2010/08/some-lesser-known-truths-about-programming/"&gt;http://dotmac.rationalmind.net/2010/08/some-lesser-known-truths-about-programming/&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/SskWyh4yFJk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/8919647785852561469/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/08/repost-some-lesser-known-truths-about.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8919647785852561469?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/8919647785852561469?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/SskWyh4yFJk/repost-some-lesser-known-truths-about.html" title="Repost: Some lesser-known truths about programming" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/08/repost-some-lesser-known-truths-about.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8AQn4_eSp7ImA9Wx5TEkg.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-5062979193769145473</id><published>2010-07-27T11:17:00.001-07:00</published><updated>2010-07-27T11:20:43.041-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-27T11:20:43.041-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Transfer UVs" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><category scheme="http://www.blogger.com/atom/ns#" term="Rigging" /><title>Maya: Transfer Mesh UVs After Rigging</title><content type="html">This is slightly off-topic than the usual scripting posts, but I found this really useful and wanted to share.&lt;br /&gt;&lt;br /&gt;It's a technique on how to transfer UVs from one mesh to another while maintaining deformer history on your object.  It worked for what I was doing and I imagine I'll be using it again in the future.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://animbiz.blogspot.com/2010/02/transferring-uvs-after-rigging.html"&gt;http://animbiz.blogspot.com/2010/02/transferring-uvs-after-rigging.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'm currently working on a bullet proof  transfer script, I'll let the world know when it works. :)&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/ShMTrnopDz0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/5062979193769145473/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/07/maya-transfer-mesh-uvs-after-rigging.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/5062979193769145473?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/5062979193769145473?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/ShMTrnopDz0/maya-transfer-mesh-uvs-after-rigging.html" title="Maya: Transfer Mesh UVs After Rigging" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/07/maya-transfer-mesh-uvs-after-rigging.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcFR3wyeip7ImA9WxFaF04.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-3093588082824736652</id><published>2010-07-21T11:27:00.001-07:00</published><updated>2010-07-21T11:30:16.292-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-21T11:30:16.292-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="3ds Max" /><category scheme="http://www.blogger.com/atom/ns#" term="animButtonState" /><category scheme="http://www.blogger.com/atom/ns#" term="auto key" /><category scheme="http://www.blogger.com/atom/ns#" term="MaxScript" /><title>Maxscript: Check If Auto Key Is Turned On</title><content type="html">Need to query if auto key is turned on or off using maxscript?  Use the &lt;span style="font-weight: bold;"&gt;animButtonState&lt;/span&gt; command.  It returns &lt;span style="font-style: italic;"&gt;true&lt;/span&gt; or&lt;span style="font-style: italic;"&gt; false&lt;/span&gt;, so using this info you can check it's current state and then setup a toggle for it, or use it make sure Max is in the correct mode before running a script.&lt;br /&gt;&lt;br /&gt;Simple, yet extremely useful!&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/ITn1XczmdQA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/3093588082824736652/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/07/maxscript-check-if-auto-key-is-turned.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/3093588082824736652?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/3093588082824736652?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/ITn1XczmdQA/maxscript-check-if-auto-key-is-turned.html" title="Maxscript: Check If Auto Key Is Turned On" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/07/maxscript-check-if-auto-key-is-turned.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08CQXY4cCp7ImA9WxFaEUg.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-259713832783236091</id><published>2010-07-14T17:59:00.000-07:00</published><updated>2010-07-14T18:04:20.838-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-14T18:04:20.838-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="MaxScript" /><title>MEL To Maxscript To MEL</title><content type="html">For whatever reason, I am a huge fan of using MEL to export a Maxscript file and vice versa.  There is a strange feeling of satisfaction, something along the lines of getting away with a crime or not letting the man bring you down.  Grab your code by the balls.  That is all.  :)&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/KBnsTm_Z79I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/259713832783236091/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/07/mel-to-maxscript-to-mel.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/259713832783236091?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/259713832783236091?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/KBnsTm_Z79I/mel-to-maxscript-to-mel.html" title="MEL To Maxscript To MEL" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/07/mel-to-maxscript-to-mel.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIESHw8eip7ImA9WxFaGEk.&quot;"><id>tag:blogger.com,1999:blog-9194959783867453392.post-1885161099625481173</id><published>2010-07-13T10:55:00.000-07:00</published><updated>2010-07-22T17:21:49.272-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-22T17:21:49.272-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Free Mel Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripting" /><category scheme="http://www.blogger.com/atom/ns#" term="Functions" /><category scheme="http://www.blogger.com/atom/ns#" term="Get Parent" /><category scheme="http://www.blogger.com/atom/ns#" term="Scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="MEL" /><category scheme="http://www.blogger.com/atom/ns#" term="listRelatives" /><category scheme="http://www.blogger.com/atom/ns#" term="Parent" /><category scheme="http://www.blogger.com/atom/ns#" term="Maya" /><title>MEL/PyMEL: Get Top Most Parent Of An Object</title><content type="html">Here is a function I use often that will give you the top-most parent of any object.  I use it when I want to perform a function on an entire heirarchy but don't want to worry about needing to select the top most object.  I can just grab any of them, hit a button and it grabs the top (using the function here) and then selects or grabs the entire hierarchy.  I'm kind of OCD about saving every possible second.&lt;br /&gt;&lt;br /&gt;Mel Version:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;// **********************************************************&lt;br /&gt;// Return Top Parent Of Any Node&lt;br /&gt;global proc string jgReturnTopParent (string $obj) {&lt;br /&gt;&lt;br /&gt;string $a[] = {} ;&lt;br /&gt;string $b ;&lt;br /&gt;$a = `listRelatives -p $obj` ;&lt;br /&gt;while(size($a) &gt; 0) {&lt;br /&gt;    $b = $a[0] ;&lt;br /&gt;    $a = `listRelatives -p $a[0]` ;&lt;br /&gt;}&lt;br /&gt;return $b ;&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;PyMel Version:&lt;br /&gt;&lt;pre name="code" class="JScript:nogutter"&gt;##################################################&lt;br /&gt;## Return Top Parent Of Any Node&lt;br /&gt;def jgReturnTopParent(obj):&lt;br /&gt;&lt;br /&gt; # Imports&lt;br /&gt; import pymel.core as pm&lt;br /&gt;&lt;br /&gt; # Get First Parent&lt;br /&gt; varA = pm.listRelatives(obj,p=True)&lt;br /&gt;&lt;br /&gt; # Loop All Parents&lt;br /&gt; while(len(varA) &gt; 0):&lt;br /&gt;&lt;br /&gt;    varB = varA[0]&lt;br /&gt;    varA = pm.listRelatives(varA[0],p=True)&lt;br /&gt;&lt;br /&gt; return varB&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Update: Thanks to Scott Englert for pointing out in the comments that MEL and PyMel both have built in functions for this already.&lt;br /&gt;&lt;br /&gt;MEL command that comes with Maya:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;rootOf($obj);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;PyMEL method of dag nodes:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;obj.root()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Cheers Scott!&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/ScriptSwell/~4/L5igeMq2aN4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.scriptswell.net/feeds/1885161099625481173/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.scriptswell.net/2010/07/mel-get-top-level-parent-of-node.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1885161099625481173?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9194959783867453392/posts/default/1885161099625481173?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ScriptSwell/~3/L5igeMq2aN4/mel-get-top-level-parent-of-node.html" title="MEL/PyMEL: Get Top Most Parent Of An Object" /><author><name>JayG</name><uri>http://www.blogger.com/profile/11384081951780850864</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://3.bp.blogspot.com/_7_YSVzGLUQg/SK4Jvz0nDLI/AAAAAAAAAAM/XK5S5WXhHvo/S220/jaySpike.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.scriptswell.net/2010/07/mel-get-top-level-parent-of-node.html</feedburner:origLink></entry></feed>
