<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:iweb="http://www.apple.com/iweb" version="2.0">
  <channel>
    <title>The Art of Tech</title>
    <link>http://www.jason-parks.com/public/public/The_Art_of_Tech/The_Art_of_Tech.html</link>
    <description>Technical artists are the newly recognized problem solvers crucial to any serious 3D pipeline. It takes  special skills and lots of passion to figure your way through a complicated pipeline. Here are some hints to help you on your way. Technical Artists unite!</description>
    <generator>iWeb 3.0.3</generator>
    <image>
      <url>http://www.jason-parks.com/public/public/The_Art_of_Tech/The_Art_of_Tech_files/wearmansmall.png</url>
      <title>The Art of Tech</title>
      <link>http://www.jason-parks.com/public/public/The_Art_of_Tech/The_Art_of_Tech.html</link>
    </image>
    <item>
      <title>Power Python for Maya Development - GDC 2011</title>
      <link>http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2011/3/7_Power_Python_for_Maya_Development_-_GDC_2011.html</link>
      <guid isPermaLink="false">f47ca77b-fe8a-4aa9-a2e3-bba5c9526df5</guid>
      <pubDate>Mon, 7 Mar 2011 21:01:48 -0800</pubDate>
      <description>&lt;a href=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2011/3/7_Power_Python_for_Maya_Development_-_GDC_2011_files/Presentation%20photo_.jpg&quot;&gt;&lt;img src=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Media/object000_2.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:183px; height:137px;&quot;/&gt;&lt;/a&gt;Do you ask yourself any of these questions?&lt;br/&gt;&lt;br/&gt;a). Ever wonder what the big deal is with Python vs. MEL?&lt;br/&gt;b). What is all of this Python Classing and PyMEL nonsense?&lt;br/&gt;c). Why go to the trouble of using a complicated IDE?&lt;br/&gt;&lt;br/&gt;The answers are in my talk from GDC last week. Hope it helps those ready to take the plunge into PyMEL and advanced Python development:&lt;br/&gt;&lt;br/&gt;PDF: &lt;a href=&quot;http://www.jason-parks.com/PowerPython/Jason_Parks_VisualArts_PowerPythonDevelopment.pdf&quot;&gt;Power Python Development for Maya&lt;/a&gt;  (6 MB)&lt;br/&gt;&lt;br/&gt;ZIP of Movies: &lt;a href=&quot;http://www.jason-parks.com/PowerPython/Jason_Parks_VisualArts_PowerPythonDevelopment_Movies.zip&quot;&gt;Power Python Dev Movies&lt;/a&gt;  (51 MB)&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Feel free to email me for questions: &lt;a href=&quot;mailto:jason@jason-parks.com/&quot;&gt;jason@jason-parks.com&lt;/a&gt;</description>
      <enclosure url="http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2011/3/7_Power_Python_for_Maya_Development_-_GDC_2011_files/Presentation%20photo_.jpg" length="102028" type="image/jpeg"/>
    </item>
    <item>
      <title>@deprecated Decorator</title>
      <link>http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/12/18_%40deprecated_Decorator.html</link>
      <guid isPermaLink="false">26fb2772-e35b-4e35-a587-eec51c538050</guid>
      <pubDate>Sat, 18 Dec 2010 00:59:32 -0800</pubDate>
      <description>&lt;a href=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/12/18_%40deprecated_Decorator_files/imgres-1.jpg&quot;&gt;&lt;img src=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Media/object001_2.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:182px; height:182px;&quot;/&gt;&lt;/a&gt;Turns out that I’m always, repeat, always re-writing, and re-organizing my code. If you’re like me, you’ll want to leave your old functions or classes &amp;amp; methods in place while you re-write or move them. Then you’ll want to leave little tags everywhere there is an old call to one of these.&lt;br/&gt;&lt;br/&gt;Seth Gibson (&lt;a href=&quot;http://twitter.com/#!/voMethod&quot;&gt;@voMethod&lt;/a&gt; on Twitter) suggested I use:&lt;br/&gt;&lt;br/&gt;import warnings&lt;br/&gt;&lt;br/&gt;def myFunc():&lt;br/&gt;      warnings.warn('Please use code elsewhere', DeprecationWarning)    &lt;br/&gt;      pass&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Which will notify you when this function gets called. But it won’t pester you. Just the first time you call it and when it gets changed. Very kewl trick.&lt;br/&gt;&lt;br/&gt;Dug around and noticed that PyMEL had a decorator in pymel.internal.pwarnings that performed just as well but provides a little more Syntactic sugar:&lt;br/&gt;&lt;br/&gt;from pymel.internal.pwarnings import deprecated&lt;br/&gt;&lt;br/&gt;@deprecated(&amp;quot;Please use code elsewhere&amp;quot;)&lt;br/&gt;def myFunc1():&lt;br/&gt;      pass&lt;br/&gt;&lt;br/&gt;myFunc1()&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Good ‘ol PyMEL, delivers again.</description>
      <enclosure url="http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/12/18_%40deprecated_Decorator_files/imgres-1.jpg" length="9616" type="image/jpeg"/>
    </item>
    <item>
      <title>Python @staticmethod and @classmethod</title>
      <link>http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/12/3_Python_%40staticmethod_and_%40classmethod.html</link>
      <guid isPermaLink="false">1bb2b5ee-070e-439b-8718-4fa195bd62be</guid>
      <pubDate>Fri, 3 Dec 2010 00:20:14 -0800</pubDate>
      <description>&lt;a href=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/12/3_Python_%40staticmethod_and_%40classmethod_files/imgres.jpg&quot;&gt;&lt;img src=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Media/object000_3.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:183px; height:137px;&quot;/&gt;&lt;/a&gt;(Lifted from Didip Kerabat’s blog &lt;a href=&quot;http://rapd.wordpress.com/2008/07/02/python-staticmethod-vs-classmethod/&quot;&gt;HERE&lt;/a&gt;:)&lt;br/&gt;Unlike Java, where static method and class method are the same thing, in Python there is subtle difference:&lt;br/&gt;Say function a() is defined in Parent Class, while Sub Class extends Parent Class&lt;br/&gt;If function a() has @staticmethod decorator, Sub.a() still refers to definition inside Parent Class. Whereas,&lt;br/&gt;If function a() has @classmethod decorator, Sub.a() will points definition inside Sub Class.&lt;br/&gt;Let’s talk about some definitions here:&lt;br/&gt;@staticmethod function is nothing more than a function defined inside a class. It is callable without instantiating the class first. It’s definition is immutable via inheritance.&lt;br/&gt;@classmethod function also callable without instantiating the class, but its definition follows Sub class, not Parent class, via inheritance. That’s because the first argument for @classmethod function must always be cls (class).&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Reference:&lt;br/&gt;&lt;a href=&quot;http://rapd.wordpress.com/2008/07/02/python-staticmethod-vs-classmethod/&quot;&gt;http://rapd.wordpress.com/2008/07/02/python-staticmethod-vs-classmethod/&lt;/a&gt;</description>
      <enclosure url="http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/12/3_Python_%40staticmethod_and_%40classmethod_files/imgres.jpg" length="20768" type="image/jpeg"/>
    </item>
    <item>
      <title>Remote Maya Python Debugging in Eclipse</title>
      <link>http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/11/8_Remote_Maya_Python_Debugging_in_Eclipse.html</link>
      <guid isPermaLink="false">5047b198-2126-48c8-954a-2446072d6b3c</guid>
      <pubDate>Mon, 8 Nov 2010 22:07:26 -0800</pubDate>
      <description>&lt;a href=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/11/8_Remote_Maya_Python_Debugging_in_Eclipse_files/droppedImage.png&quot;&gt;&lt;img src=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Media/object049.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:183px; height:137px;&quot;/&gt;&lt;/a&gt;PyDev has debugger:&lt;br/&gt;&lt;br/&gt;Turns out Pydev has a nice plugin/package calling the module pydevd.py. Instructions on generic usage are here:&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://pydev.org/manual_adv_remote_debugger.html&quot;&gt;http://pydev.org/manual_adv_remote_debugger.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;When we say remote, it doesn’t have to be on another computer, it can be on your own computer, it is just debugging a script that is not being run from within your Eclipse Development Environment, but is being executed from some other source like a Python IDLE console or a DCC app running Python, like Maya! So let’s do it . . .&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Setup pythonpath:&lt;br/&gt;&lt;br/&gt;Firstly, you’ll need the path to the pydevd.py module in your Maya session’s pythonpaths. Follow the instructions in the link above to find out where this path is (something like: eclipse/plugins/org.python.pydev.debug_x.x.x/pysrc/). Add it to your python path in via Maya.env, userSetup.mel, userSetup.py, or your preferred method. Restart Maya of course.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Start Pydev server:&lt;br/&gt;&lt;br/&gt;Now you actually need to start the server per the link’s instructions by first switching to your debug perspective, ‘cause that’s what it’s for and then pressing the little bug icon in your toolbar to start the Pydev server.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Load module, call method:&lt;br/&gt;&lt;br/&gt;You can now add these lines to the script you want to debug:&lt;br/&gt;&lt;br/&gt;import pydevd&lt;br/&gt;pydevd.settrace()&lt;br/&gt;&lt;br/&gt;Probably want to echo to Eclipse w/ these args:&lt;br/&gt;&lt;br/&gt;pydevd.settrace(stdoutToServer=True, stderrToServer=True, suspend=False)&lt;br/&gt;&lt;br/&gt;If you run the script with this line in Maya when your Eclipse Pydev server is running, Eclipse will grab the process at this line. But what is nicer is to just establish the connection and set your breakpoint in any script in Eclipse and then Eclipse will grab the process as soon as you run that script in Maya. You’ll need to modify the suspend=True arg to False so suspension does not happen at the spot this line is run, but instead just makes the connection and waits for suspension to happen when a breakpoint is hit:&lt;br/&gt;&lt;br/&gt;import pydevd&lt;br/&gt;pydevd.settrace(stdoutToServer=True, stderrToServer=True, suspend=False)&lt;br/&gt;&lt;br/&gt;Set your breakpoint in your python script. Call it from Maya, Maya will hang, switch to Eclipse and look for the magic green line.&lt;br/&gt;&lt;br/&gt;Now you get awesome stack data, listed as “Variables” in Eclipse and the Console is interactive! just like the debug probe in Wing. Don’t forget that Eclipse can ‘watch’ variables with the “Expressions” window too! If you don’t think this is awesome, you are not a serious Maya Python programmer, ‘cause this is the coolest thing since sliced bread if you ask me.&lt;br/&gt;&lt;br/&gt;Eventually you’ll probably want to just make a command like this:&lt;br/&gt;&lt;br/&gt;def connectToEclipse():&lt;br/&gt;    import pydevd&lt;br/&gt;    pydevd.settrace(stdoutToServer=True, stderrToServer=True,     suspend=False)&lt;br/&gt;&lt;br/&gt;And just call the function whenever your gonna start your debugging.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;One Thing Missing:&lt;br/&gt;&lt;br/&gt;There is one major convenience missing in this “debug probe” however, and that is code-completion. One of the huge advantages of the Debug Probe in Wing IDE while you’re debugging Maya is that you can “see” what the current environment is inside Maya at any given moment. This is so handy it is hard to describe. Very handy for diagnosing why certain Python packages and modules are not importing so well. With Wing’s Debug Probe, you just interrupt your session, and start typing “import” and you can start to experiment with paths and namespaces to see what will import under what name. Anyway, I miss the code-completion in this Console.&lt;br/&gt;&lt;br/&gt;Of course the connections can get a little sticky and you may have to restart one or both apps occasionally to get things setup again. Just FYI.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Infinitely Awesome:&lt;br/&gt;&lt;br/&gt;Regardless, this connection is awesome; so infinitely valuable to debug in real-time, I won’t even start. Wing does it a little more nicely, but it does cost. Great thing about Eclipse and Pydev, is that it is free!&lt;br/&gt;</description>
      <enclosure url="http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/11/8_Remote_Maya_Python_Debugging_in_Eclipse_files/droppedImage.png" length="155388" type="image/png"/>
    </item>
    <item>
      <title>Debugging MotionBuilder with Wing IDE</title>
      <link>http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/10/30_Debugging_MotionBuilder_with_Wing_IDE.html</link>
      <guid isPermaLink="false">6b49819a-67fe-45ff-88dc-321465978635</guid>
      <pubDate>Sat, 30 Oct 2010 08:40:45 -0700</pubDate>
      <description>&lt;a href=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/10/30_Debugging_MotionBuilder_with_Wing_IDE_files/pyfbsdk.jpg&quot;&gt;&lt;img src=&quot;http://www.jason-parks.com/public/public/The_Art_of_Tech/Media/object050.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:183px; height:137px;&quot;/&gt;&lt;/a&gt;Debugging Maya with the Wing Python IDE has been one of the greatest breakthroughs in Maya scripting/programming development in recent memory.&lt;br/&gt;&lt;br/&gt;I first heard about this possibility from WarpCat’s blog:&lt;br/&gt;&lt;a href=&quot;http://warpcat.blogspot.com/2009/02/remove-debugging-from-wing-to-maya.html&quot;&gt;http://warpcat.blogspot.com/2009/02/remove-debugging-from-wing-to-maya.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;My latest project requires some MotionBuilder scripting again and now that I am used to scripting like a pro w/ a real IDE and debugging, I was desperate to get Wing to connect to my MotionBuilder python process.&lt;br/&gt;&lt;br/&gt;It turns out to be rather simple&lt;br/&gt;&lt;br/&gt;	1.	Put this file into one of your MotionBuilder python paths:&lt;br/&gt;	a.	wingdbstub.py&lt;br/&gt;2. Then type ‘import wingdbstub’ in your MoBu python console.&lt;br/&gt;	1.	Set a breakpoint in your code loaded into Wing&lt;br/&gt;	2.	Run your script from MotionBuilder&lt;br/&gt;&lt;br/&gt;Voila! Wing should grab it.&lt;br/&gt;&lt;br/&gt;*Added bonus. For autocomplete in Eclipse, you can add this line:&lt;br/&gt;&lt;br/&gt;if False: from pyfbsdk_gen_doc import *&lt;br/&gt;&lt;br/&gt;It turns out that there is a stub file for the pyfbsdk docs in pyfbsdk_gen_doc.py. So if you import this file, Eclipse (and other IDE’s, I presume) will reference this file for the docs for all classes and methods. The problem is that if you actually important this file, it will overwrite the functionality of the commands and they will not do anything. So by putting the ‘if False’ condition in there, when you run any of these scripts, it will not actually import the code. But Eclipse does not know any better and will still check this file for doc reference.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description>
      <enclosure url="http://www.jason-parks.com/public/public/The_Art_of_Tech/Entries/2010/10/30_Debugging_MotionBuilder_with_Wing_IDE_files/pyfbsdk.jpg" length="122957" type="image/jpeg"/>
    </item>
  </channel>
</rss>

