<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Butters Tech Art Blog.</title>
	<atom:link href="http://www.techartblog.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.techartblog.com</link>
	<description>Sworn to uphold the technocratic oath</description>
	<lastBuildDate>Tue, 07 May 2013 04:18:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Physical Technical Art</title>
		<link>http://www.techartblog.com/video/physical-technical-art</link>
		<comments>http://www.techartblog.com/video/physical-technical-art#comments</comments>
		<pubDate>Sat, 18 Aug 2012 00:23:16 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Physical Technical Art]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Physical]]></category>
		<category><![CDATA[Tear Down]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=1065</guid>
		<description><![CDATA[Over the next couple of months I'm going to be blogging mainly on the topic of what I like to call Physical Technical Art, the tangible side of games development. So… what does that mean you say? Game Development in most parts is a software exercise; once concept art and motion capture has been digitized [...]]]></description>
			<content:encoded><![CDATA[<p>Over the next couple of months I'm going to be blogging mainly on the topic of what I like to call Physical Technical Art, the tangible side of games development. So… what does that mean you say? Game Development in most parts is a software exercise; once concept art and motion capture has been digitized the remainder of production is mainly dedicated to DCC’s, Assets Pipelines and Code. Development can be fraught with unforeseen hurdles and challenges, some of these problems require a team to think outside the software box and this is where Physical Technical Art focuses its solutions.</p>
<p>A great example of this is the XBox 360 Controller Monitor. This custom hardware enables the capture of the controller’s inputs (buttons and joysticks) and then displays the values on a small board. This board is then framed with the vision from the game and filmed, giving the reviewer a clear connection between the input and the time taken for it to be displayed on screen.</p>
<p>The following video is a Tear Down of this hardware, a brief overview of the electronics used and how it captures and displays its data:  </p>
<p style="text-align: center;"><span class="youtube">
<object width="560" height="340">
<param name="movie" value="http://www.youtube-nocookie.com/v/sqhkO4cYAZY?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" />
<param name="allowFullScreen" value="true" />
<embed wmode="opaque" src="http://www.youtube-nocookie.com/v/sqhkO4cYAZY?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="560" height="340"></embed>
<param name="wmode" value="opaque" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=sqhkO4cYAZY"><img src="http://img.youtube.com/vi/sqhkO4cYAZY/default.jpg" width="130" height="97" border=0></a></p><p><a href="http://www.youtube.com/watch?v=sqhkO4cYAZY">www.youtube.com/watch?v=sqhkO4cYAZY</a></p><br />
<em>Xbox 360 Controller Monitor (Tear Down)</em>
</p>
<p>Latency is an important concern when developing a game, it changes how the game is played and if it's too high the user may get frustrated ruining the experience. The Xbox 360 Controller monitor is a practical and simple solution to this important focus. Yes, input latency can be calculated within the devkit; but having a hardware solution ensures no overheads and enables testing for unprofileable games.</p>
<p><a href="http://youtu.be/QioO7LafTZw" title="Controller Monitor Demo" target="_blank">Ben Heck's Controller Monitor Intro Video</a></p>
<p><a href="http://www.benheck.com" title="www.benheck.com" target="_blank">Ben Heck's Website</a></p>
<p><a href="http://www.benheck.com/Downloads/programs/macro_controller.zip" title="Macro_Controller.Zip" target="_blank">Uno32 (Ardunio) Code: Macro_Controller.Zip</a></p>
<p><a href="http://www.chipcatalog.com/Docs2/www.fairchildsemi.com/82389.pdf?pass=542061805697092" title="Fair Child 8Bit Shift Register DataSheet" target="_blank">Fair Child 8Bit Shift Register DataSheet</a></p>
<p><br><br></p>
<p>If you use something like this or any other physical solutions in your studios, I would love to hear about it. You can contact me via the contacts tab or just leave a comment.</p>
<p>Cheers<br />
~B</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/video/physical-technical-art/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shader Toy &#8211; GLSL ES Online Editor, Compiler &amp; Previewer</title>
		<link>http://www.techartblog.com/web-finds/shadertoy</link>
		<comments>http://www.techartblog.com/web-finds/shadertoy#comments</comments>
		<pubDate>Thu, 05 Apr 2012 21:32:33 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Web Finds]]></category>
		<category><![CDATA[OpenGLSL ES]]></category>
		<category><![CDATA[Shaders]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=1002</guid>
		<description><![CDATA[Digging around the web the other day looking for GLSL ES info and I came across this site, it's a nifty online editor, compiler and previewer. It comes with some examples of 2D, 3D and Plane Deformer shaders and it can take input from Time, Mouse(LMB with current pixel and clicked pixel), Viewport Resolution and [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><img src="http://www.techartblog.com/wp-content/uploads/OpenGL_ES_logo.png" alt="" width="150" height="66" /></p>
<p>Digging around the web the other day looking for GLSL ES info and I came across this site, it's a nifty online editor, compiler and previewer. </p>
<p>It comes with some examples of 2D, 3D and Plane Deformer shaders and it can take input from Time, Mouse(LMB with current pixel and clicked pixel), Viewport Resolution and 4 Texture(sampler2D) channels.</p>
<p>Happy Shading!</p>
<p><center><img src="http://www.techartblog.com/wp-content/uploads/ShaderToy.png" alt="" title="ShaderToy" width="524" height="433"></p>
<p><a href="http://www.iquilezles.org/apps/shadertoy/">http://www.iquilezles.org/apps/shadertoy/</a></center><br />
<br><br />
<br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/web-finds/shadertoy/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shift dragging files into Maya 2012</title>
		<link>http://www.techartblog.com/maya/shift-dragging-files-into-maya-2012</link>
		<comments>http://www.techartblog.com/maya/shift-dragging-files-into-maya-2012#comments</comments>
		<pubDate>Fri, 02 Mar 2012 21:33:02 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Maya]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=994</guid>
		<description><![CDATA[Shift dragging files into Maya 2012 can be a risky business; it turns out that it will delete your file. So if you are after new ways of off-loading some of those pesky files that clutter your hard-drive simply shift drag them into Maya and all your dreams will come true. This works for even [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><img src="http://www.techartblog.com/wp-content/uploads/Maya2012.png" alt="" width="85" height="63" /></p>
<p>Shift dragging files into Maya 2012 can be a risky business; it turns out that it will delete your file.</p>
<p>So if you are after new ways of off-loading some of those pesky files that clutter your hard-drive simply shift drag them into Maya and all your dreams will come true. This works for even for Maya native files, they are imported then deleted from the source location. A simple restore from the recycling bin will cease your soon to be heart attack.</p>
<p>Happy Undeleting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/maya/shift-dragging-files-into-maya-2012/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying project files in Visual Studio during pre-build</title>
		<link>http://www.techartblog.com/tips/visual_studio_edit_files_prebuild</link>
		<comments>http://www.techartblog.com/tips/visual_studio_edit_files_prebuild#comments</comments>
		<pubDate>Thu, 22 Dec 2011 03:43:06 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=960</guid>
		<description><![CDATA[      So it turns out that Visual Studio uses the application's cache if a file is open at build time instead of loading the file off disk...ok so this is good, when you want to save memory and speed up the build process. BUT when you are editing a source file that is [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><a href="http://www.techartblog.com/wp-content/uploads/VS2008.png"><img class="size-full wp-image-867 alignright" title="VS2008" src="http://www.techartblog.com/wp-content/uploads/VS2008.png" alt="" width="85" height="63" /></a></p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p>So it turns out that Visual Studio uses the application's cache if a file is open at build time instead of loading the file off disk...ok so this is good, when you want to save memory and speed up the build process. BUT when you are editing a source file that is being created/modified during the Pre-Build step, then you are in a little bit of trouble.<span id="more-960"></span></p>
<p>After some digging, it turns out that it's a known process and in visual studio 2008 (at least) an additional option is not going to be added. So how do we get around this?</p>
<p>Add the highlighted line to your projects build settings and it will force the applications to load the file from disk and not from its cache. It didn't take me too long to find this information out, but it's good to know if you get in a position that you need to do this.</p>
<blockquote><p>&lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'PCRelease|AnyCPU' "&gt;<br />
&lt;DebugType&gt;pdbonly&lt;/DebugType&gt;<br />
&lt;Optimize&gt;true&lt;/Optimize&gt;<br />
&lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;<br />
&lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;<br />
&lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;<br />
&lt;WarningLevel&gt;4&lt;/WarningLevel&gt;<br />
<span style="color: #ffffff;"><strong>&lt;UseHostCompilerIfAvailable&gt;false&lt;/UseHostCompilerIfAvailable&gt;</strong></span><br />
&lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;<br />
&lt;/PropertyGroup&gt;</p></blockquote>
<p style="text-align: left;"><strong> </strong></p>
<div><strong>Source:</strong></div>
<p><a href="https://connect.microsoft.com/VisualStudio/feedback/details/433077/modifications-made-to-source-files-in-the-pre-build-step-are-not-propogated-to-the-final-binaries-when-building-in-visual-studio" target="_blank">Original Microsoft Feedback Post</a></p>
<p style="text-align: left;"><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/tips/visual_studio_edit_files_prebuild/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Perforce: Force update missing workspace files</title>
		<link>http://www.techartblog.com/tips/perforce-force-update-missing-workspace-files</link>
		<comments>http://www.techartblog.com/tips/perforce-force-update-missing-workspace-files#comments</comments>
		<pubDate>Sun, 06 Nov 2011 00:43:42 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Perforce]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=866</guid>
		<description><![CDATA[    Q: So I've accidentally deleted some random local files and I have no idea which ones. How do I get the files back when Perforce thinks they are still in my local workspace? I don't want to force update all the files, that would take way too long. A: Force update will do the trick, but it [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><a href="http://www.techartblog.com/wp-content/uploads/PerforceIcon.png"><img class="size-full wp-image-867 alignright" title="PerforceIcon" src="http://www.techartblog.com/wp-content/uploads/PerforceIcon.png" alt="" width="85" height="63" /></a></p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong>Q:</strong> So I've accidentally deleted some random local files and I have no idea which ones. How do I get the files back when Perforce thinks they are still in my local workspace? I don't want to force update all the files, that would take way too long.</p>
<p style="text-align: left;"><strong>A:</strong> Force update will do the trick, but it will take forever to pull the files down. With a little bit of digging in the documentation there is a way to diff your workspace against the Depot.</p>
<p style="text-align: left;"><strong> </strong></p>
<table width="100%" cellpadding="5px">
<tbody>
<tr>
<td style="text-align: left;" width="%"></td>
<td style="text-align: left;" bgcolor="#202020" width="500px">
<pre class="dos">  p4 diff -sd //Depot/path/... &gt; UpdateList.txt
  p4 -x UpdateList.txt sync -f</pre>
</td>
<td style="text-align: left;" width="%"></td>
</tr>
</tbody>
</table>
<p><span id="more-866"></span></p>
<p style="text-align: left;"><strong> </strong></p>
<p>As shown above the Diff command is used to write out all the files that it didn't find in the local workspace to a file named UpdateList.txt. Writing out to a text file can be useful if you need to check which files are missing or if you need to copy the list for another means. The output file will contain all the files that are missing from your workspace and also include any files that were moved/renamed in pending change lists under the specified path. In the second line you can see that the force update uses the files listed in the updateList.txt to only get what is missing. </p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p>In the command used below as my friend Dennis Roche pointed out, it can also be written as a single line if you don't need a file list before an update.</p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<table width="100%" cellpadding="5px">
<tbody>
<tr>
<td style="text-align: left;" width="%"></td>
<td style="text-align: left;" bgcolor="#202020" width="500px">
<pre class="dos">  p4 diff -sd //Depot/path/… | p4 -x – sync -f</pre>
</td>
<td style="text-align: left;" width="%"></td>
</tr>
</tbody>
</table>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p><strong>NB:</strong> If you have a pending changelist that contains moved/renamed files, force update will not effect/replace them.</p>
<p style="text-align: left;"><strong><br />
</strong></p>
<p style="text-align: left;"><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/tips/perforce-force-update-missing-workspace-files/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Qt Overdraw</title>
		<link>http://www.techartblog.com/maya/qt-overdraw</link>
		<comments>http://www.techartblog.com/maya/qt-overdraw#comments</comments>
		<pubDate>Wed, 20 Jul 2011 22:10:46 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Maya]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=820</guid>
		<description><![CDATA[When I was working on my last tutorial I came across an interesting issue with the Qt UI. I went through all the elements using windows modifier and notices a number of elements that appear to be dupes. Maya Perspective window after I started to shift some elements out For starters we have a duplicated [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><img src="http://www.techartblog.com/wp-content/uploads/Maya2012.png" alt="" width="85" height="63" /><img style="vertical-align: top;" src="http://www.techartblog.com/wp-content/uploads/QtIcon.png" alt="" width="40" height="50" /></p>
<p style="text-align: justify;">When I was working on my last tutorial I came across an interesting issue with the Qt UI. I went through all the elements using windows modifier and notices a number of elements that appear to be dupes.</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://www.techartblog.com/wp-content/uploads/QT_Overdraw.png"><img class="aligncenter size-full wp-image-821" title="QT_Overdraw" src="http://www.techartblog.com/wp-content/uploads/QT_Overdraw.png" alt="" width="606" height="131" /></a></p>
<p style="text-align: center;"><strong>Maya Perspective window after I started to shift some elements out</strong></p>
<p><span id="more-820"></span></p>
<p style="text-align: justify;">For starters we have a duplicated Display Bar?? And you can see on the right that the XRayBone icon is shown 4 times.  If I really felt like expanding every icon out probably all the icons suffer the same problem.</p>
<p style="text-align: justify;">Now the interesting fact about this is that the callbacks seem to be split across different elements which make me think that this might be intentional.</p>
<ol style="text-align: justify;">
<li>Takes mouse over messages, changing the image for all 4 icons</li>
<li>This receives all the mouse click events and will toggle all the 4 buttons.</li>
</ol>
<p style="text-align: justify;">All of the other XRay icons don’t receive any kind messages. So I was thinking that maybe Autodesk might have implemented Qt a little weird in Maya, so I checked it out in QT designer and it has the same issue.</p>
<p style="text-align: justify;">I've only checked this on Win7 but hey it might be the way that things need to work for this platform. If anyone else is able to check this out on another platform I would be interested to know. I’m not 100% sure if all these elements are being rendered individually, but if they are this could be a real performance hit if you are dealing with some heavy UI. I might head to the Qt forums and find out if there is any information.</p>
<p style="text-align: center;">I've also included a Summary video  with the Windows Modifier adjustments</p>
<p style="text-align: center;"><span class="youtube">
<object width="560" height="340">
<param name="movie" value="http://www.youtube-nocookie.com/v/2ef-Fcn0vrg?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" />
<param name="allowFullScreen" value="true" />
<embed wmode="opaque" src="http://www.youtube-nocookie.com/v/2ef-Fcn0vrg?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="560" height="340"></embed>
<param name="wmode" value="opaque" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=2ef-Fcn0vrg"><img src="http://img.youtube.com/vi/2ef-Fcn0vrg/default.jpg" width="130" height="97" border=0></a></p><p><a href="http://www.youtube.com/watch?v=2ef-Fcn0vrg">www.youtube.com/watch?v=2ef-Fcn0vrg</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/maya/qt-overdraw/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating .Net &amp; Maya 2012 UI – Pt 1</title>
		<link>http://www.techartblog.com/tutorial/integrating-dotnet-and-maya2012-ui-pt1</link>
		<comments>http://www.techartblog.com/tutorial/integrating-dotnet-and-maya2012-ui-pt1#comments</comments>
		<pubDate>Tue, 12 Apr 2011 20:31:59 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Hwnd]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Python.Net]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=654</guid>
		<description><![CDATA[This article is specific to Maya 2012, I have also created an alternate tutorial for Maya 2009 (32bit) Developers In this multi-part tutorial we’ll be covering two main areas, embedding .Net forms within Maya and extracting Maya UI components and embedding them within your .Net dialogs. To get this to work we will be exploiting [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><img src="http://www.techartblog.com/wp-content/uploads/Maya2012.png" alt="" width="85" height="63"/></p>
<p style="text-align: left;"><white>This article is specific to Maya 2012, I have also created an alternate tutorial for <a href="./?p=8">Maya 2009 (32bit) Developers</a></white>
</p>
<p style="text-align: justify;">In this multi-part tutorial we’ll be covering two main areas, embedding .Net forms within Maya and extracting Maya UI components and embedding them within your .Net dialogs. To get this to work we will be exploiting the windows messaging system and as a result, this will only work on Windows based systems. This technique is not exclusive to Maya and can be used for many other applications and has saved me on many occasions. Please understand that this tutorial is aimed at intermediate users of .Net and Maya Python scripting, as there will be some C# code used to interface with the windows messaging system and Python code to load the .Net windows within Maya. If you want to learn more about the following concepts you can check out the <a href="#AdditionalResources">Addition Resources</a> I have included.</p>
<p><span id="more-654"></span></p>
<p style="text-align: justify;">There are some drawbacks to using .Net dialogs within Maya, namely debugging and error handling, so please take this into consideration before implementing it within your pipeline. For this demo I will be using <a href="http://www.microsoft.com/express/" target="_blank">Visual Studio C# Express 2010</a>, but the concepts and code can be used within other software versions.</p>
<p style="text-align: justify;">Also throughout this tutorial I will be referring to C# and Maya Python code that has been condensed to save on space but I have included the full <a href="http://www.techartblog.com/wp-content/uploads/MayaUITutorial_2012Pt1.zip">Part 1 source code and solution</a> for your viewing pleasure. When compiling this project you will receive 2 warnings, currently there is a <a href="http://wishmesh.com/2010/10/x64-c-warning-referenced-assembly-system-data-dll-targets-a-different-processor/" target="_blank">bug with VS 2010</a> that makes this occur, the solution is correct so please disregard them.</p>
<p style="text-align: justify;">By the end of this multi-part tutorial you will be able to embed your .Net Dialogs within Maya 2012 properly, extract Maya UI components and embed them within your .Net application, and have a basic understanding of windows messaging. Recently Maya's UI has switched over to Qt, with these changes the code for spawning and finding windows has also.</p>
<p>I have broken the tutorial up into a couple of parts:</p>
<ol>
<white></p>
<li><a href="#1">Creating the .Net application</a></li>
<li><a href="#2">Connecting Maya with .Net using Python</a></li>
<li><a href="#3">Embedding the .Net window within Maya</a>
<ol type="a">
<li><a href="#3a">Windows, controls &amp; HWND’s</a>
<ol type="i">
<li><a href="#3ai">Finding a windows HWND</a></li>
<li><a href="#3aii">Windows Modifier</a></li>
</ol>
</li>
<li><a href="#3b">C# code used to parent UI</a>
<ol type="i">
<li><a href="#3bi">Code References</a></li>
<li><a href="#3bii">Find and Parent code</a></li>
</ol>
</li>
<li><a href="#3c">Maya code used to spawn UI</a></li>
</ol>
</li>
<p></white>
</ol>
<p><a name="1"></a><br />
<h2>Creating the .Net application</h2>
<p style="text-align: justify;">Let’s start by creating a C# (Windows Forms Application) solution; I have created one called <em>MayaUITutorial</em>. I renamed <em>Form1</em> to <em>embedForm_2012</em>, this will contain code to find a specific Maya window and embed itself into it.</p>
<p style="text-align: center;">
<a href="http://www.techartblog.com/wp-content/uploads/Forms_Design2012_01.png" target="_blank"><img alt=""   src="http://www.techartblog.com/wp-content/uploads/Forms_Design2012_01.png" title="Form Design" class="alignnone" width="500" height="365" /></a><br />
<strong>Fig 1.0</strong></p>
<blockquote><p style="text-align: justify;">In this image I have added a single button and removed the window’s border from the <em>embedForm_2012</em> so it can be embedded cleanly within Maya.</p>
</blockquote>
<p><a name="2"></a><br />
<h2>Connecting Maya with .Net using Python</h2>
<p style="text-align: justify;">First things first, to run any .Net code within Maya you need to have installed <a href="http://sourceforge.net/projects/pythonnet/files/pythonnet-2.0-alpha2-clr2.0_py26/" target="_blank">Python.Net</a> for Maya 2012 (Python 2.6) and instead of writing it all out again, my mate Seth Gibson has put together a mid level tutorial just on this: <a href="http://tech-artists.org/wiki/PythonNetInMaya" target="_blank">http://tech-artists.org/wiki/PythonNetInMaya</a> If your Python.Net is up and running I would still recommend you take a look at this tutorial and become familiar with the interface.</p>
<p style="text-align: justify;">Now that we have .Net setup and running in Maya, let’s get stuck right into the best bits.</p>
<p><a name="3"></a><br />
<h2>Embedding .Net in Maya</h2>
<p style="text-align: justify;">One of the main issues with spawning a .Net window within Maya is having it sort correctly, minimize/maximize with the Maya window and not displaying in the task bar as if it were a separate application. Although this can be done with Windows messaging it can be simplified by parenting the .Net window within a native Maya window. By doing this simple trick you solve the major issues associated with the spawning and destruction of.Net windows. To complete this parenting work around we can use the windows messaging system to our advantage.</p>
<p><a name="3a"></a><br />
<h3>Windows, Controls &amp; HWND’s</h3>
<p style="text-align: justify;">Every window and control within Windows has a “Windows Handle” or HWND; this is a unique address that identifies the UI and what messages it receives. In addition to this ID each UI has an owner or parent which can also pass messages onto its children e.g. If a parent window is told to minimize then its children will also follow.</p>
<p><a name="3ai"></a><br />
<h4>Finding a window’s HWND</h4>
<p style="text-align: justify;">When a window is created it is assigned a HWND, it is more than extremely rare for a window to have the same ID as when it was last created. To find the correct window that we want to access we need to assign a unique name/ title to it so we can identify it from all the other similar controls. Later on we will be running through some code that will search for this unique window, as part of the function call we will need to include the UI class name. There are a couple of ways to find what a control’s class is;  if you have the Professional version of Visual Studio there is a tool called “Microsoft Spy++”, otherwise you can get an app called “Windows Modifier”. For this tutorial we’ll be using Windows Modifier as it has a couple of extra features that we can use to our benefit.</p>
<p><a name="3aii"></a><br />
<h4><strong>Windows Modifier</strong></h4>
<p style="text-align: justify;"><a href="http://www.pcworld.com/downloads/file/fid,29597-order,4/reviews.html" target="_blank">Windows Modifier</a> is as the title suggests a tool to modify windows. In addition to investigating the window's Class and HWND it has the ability to modify the size, state and the parent of a particular window. With this you can test out UI changes and parenting without even writing a line of code.</p>
<p style="text-align: center;"><a href="http://www.techartblog.com/wp-content/uploads/WinMod_Window_2012.png" target="_blank"><img alt="" src="http://www.techartblog.com/wp-content/uploads/WinMod_Window_2012.png" title="Windows Modifier" class="alignnone" width="500" height="330" /></a><br />
<strong>Fig 2.0</strong></p>
<blockquote><p style="text-align: justify;">In the image above we can see that Windows Modifier has two ways to display its UI Tree (Window Text and Class Name). When we call the find function within C# we will be using both the text and class name of the selected window to get the correct HWND of the window, so take note we will be using this in the next section.</p>
</blockquote>
<p style="text-align: center;"><a href="http://www.techartblog.com/wp-content/uploads/ModifiedWindow_2012.png" target="_blank"><img alt="" src="http://www.techartblog.com/wp-content/uploads/ModifiedWindow_2012.png" title="Modified Window" class="alignnone" width="500" height="304" /></a><br />
<strong>Fig 2.1</strong></p>
<blockquote><p style="text-align: justify;">As a side note, in this image we have a Maya window that has had its UI modified as a demonstration of what is possible with windows messaging, after a form has been created. It is quite easy to move elements of a window to fit the needs of your interface. We will be focusing more on this in part 2 of the tutorial.</p>
</blockquote>
<p>Alright… enough talking, let’s get stuck into some juicy code.</p>
<p><a name="3b"></a><br />
<h3>C# Code used to Parent UI</h3>
<p style="text-align: justify;">To embed a .Net window within a Maya window we need to write some code in both C# and Maya. The C# code will be responsible for finding the Maya window and attaching itself within it. Maya will then create the unique window and call the necessary code to initiate the .Net form creation and attachment. Let’s start with the C# code first as it will make things a little clearer down the track.</p>
<p><a name="3bi"></a><br />
<h4>C# Code References</h4>
<p>The following condensed code is taken from the <em>embedForm_2012</em>:</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="csharp"><span style="color: #E98D13;">using</span> <span style="color: #EEEEEE;">System</span>.<span style="color: #EEEEEE;">Runtime</span>.<span style="color: #EEEEEE;">InteropServices</span>;
<span style="color: #E98D13;">namespace</span> MayaUITutorial
<span style="color: #EEEEEE;">&#123;</span>
    <span style="color: #E98D13;">public</span> partial <span style="color: #2A96BD;">class</span> embedForm_2012 : Form
    <span style="color: #EEEEEE;">&#123;</span>
        <span style="color: #079816; font-style: italic;">// Include SetParent Reference</span>
        <span style="color: #EEEEEE;">&#91;</span><span style="color: #2A96BD;">DllImport</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #D47C6E;">&quot;User32&quot;</span>, <span style="color: #2A96BD;">CharSet</span> = <span style="color: #2A96BD;">CharSet</span>.<span style="color: #E98D13;">Auto</span>, ExactSpelling = <span style="color: #E98D13;">true</span><span style="color: #EEEEEE;">&#41;</span><span style="color: #EEEEEE;">&#93;</span>
        <span style="color: #E98D13;">internal</span> <span style="color: #E98D13;">static</span> <span style="color: #E98D13;">extern</span> <span style="color: #2A96BD;">IntPtr</span> SetParent<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">IntPtr</span> hWndChild, <span style="color: #2A96BD;">IntPtr</span> hWndParent<span style="color: #EEEEEE;">&#41;</span>;
&nbsp;
        <span style="color: #079816; font-style: italic;">// Include hWnd of a selected window references</span>
        <span style="color: #EEEEEE;">&#91;</span><span style="color: #2A96BD;">DllImport</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #D47C6E;">&quot;user32.dll&quot;</span>, SetLastError = <span style="color: #E98D13;">true</span><span style="color: #EEEEEE;">&#41;</span><span style="color: #EEEEEE;">&#93;</span>
        <span style="color: #E98D13;">static</span> <span style="color: #E98D13;">extern</span> <span style="color: #2A96BD;">IntPtr</span> FindWindow<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">string</span> lpClassName, <span style="color: #2A96BD;">string</span> lpWindowName<span style="color: #EEEEEE;">&#41;</span>;
&nbsp;
        <span style="color: #EEEEEE;">&#91;</span><span style="color: #2A96BD;">DllImport</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #D47C6E;">&quot;user32.dll&quot;</span>, SetLastError = <span style="color: #E98D13;">true</span><span style="color: #EEEEEE;">&#41;</span><span style="color: #EEEEEE;">&#93;</span>
        <span style="color: #E98D13;">static</span> <span style="color: #E98D13;">extern</span> <span style="color: #2A96BD;">IntPtr</span> FindWindowEx<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">IntPtr</span> hwndParent, <span style="color: #2A96BD;">IntPtr</span> hwndChildAfter, <span style="color: #2A96BD;">string</span> lpszClass, <span style="color: #2A96BD;">string</span> lpszWindow<span style="color: #EEEEEE;">&#41;</span>;</pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">First of all we need to include System.Runtime.InteropServices to get access to the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx#Y1700" target="_blank">DllImportAttribue</a> creating references to SetParent (Setting the parent of a particular UI), <em>FindWindow</em> and <em>FindWindowEx</em> (Finding a window’s HWND based on a combination of the window title, class and parent). Using this in conjunction with a unique windows title we are able to get the correct HWND. These imports enable us to use shared unmanaged code within our managed application, or in other words, giving us access to the Windows API (WIN32 API). Take special note of the namespace, there is a current bug within python.net that requires you to have the same namespace as your assembly name.</p>
<blockquote><p style="text-align: justify;"><strong>NB:</strong> In the case that you are making multiple instances of your window you will have to pass the unique name to the form at time of creation. For this tutorial however we will assume that the window will not be instanced.</p>
</blockquote>
<p><a name="3bii"></a><br />
<h4>Find and Parent code</h4>
<p style="text-align: justify;">The following condensed code is used to search and attach the .Net window within a specifically named Maya window. As we are only looking for the window’s HWND there isn’t an awful lot of code in this example but in the next tutorial we will be digging a little deeper into a window’s components so you’ll get a couple more lines to check out.</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="csharp"><span style="color: #E98D13;">public</span> partial <span style="color: #2A96BD;">class</span> embedForm_2012 : Form
<span style="color: #EEEEEE;">&#123;</span>
    <span style="color: #E98D13;">public</span> <span style="color: #E98D13;">void</span> Embed_2012_Control<span style="color: #EEEEEE;">&#40;</span><span style="color: #EEEEEE;">&#41;</span>
    <span style="color: #EEEEEE;">&#123;</span>
        <span style="color: #079816; font-style: italic;">//Set the name and Class of the Maya blank window</span>
        <span style="color: #2A96BD;">string</span> lpszParentClass = <span style="color: #D47C6E;">&quot;QWidget&quot;</span>;
        <span style="color: #2A96BD;">string</span> lpszParentWindow = <span style="color: #D47C6E;">&quot;Embed Viewport.NET&quot;</span>;
&nbsp;
        <span style="color: #2A96BD;">IntPtr</span> ParenthWnd = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #2A96BD;">IntPtr</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #FF0000;">0</span><span style="color: #EEEEEE;">&#41;</span>;
&nbsp;
        <span style="color: #079816; font-style: italic;">/* Attach the .Net Form into the Maya blank window */</span>
        ParenthWnd = FindWindow<span style="color: #EEEEEE;">&#40;</span>lpszParentClass, lpszParentWindow<span style="color: #EEEEEE;">&#41;</span>;
        SetParent<span style="color: #EEEEEE;">&#40;</span><span style="color: #E98D13;">this</span>.<span style="color: #EEEEEE;">Handle</span>, ParenthWnd<span style="color: #EEEEEE;">&#41;</span>;
    <span style="color: #EEEEEE;">&#125;</span>
&nbsp;
    <span style="color: #E98D13;">private</span> <span style="color: #E98D13;">void</span> embed_2012_Form_Load<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">object</span> sender, EventArgs e<span style="color: #EEEEEE;">&#41;</span>
    <span style="color: #EEEEEE;">&#123;</span>
        Embed_2012_Control<span style="color: #EEEEEE;">&#40;</span><span style="color: #EEEEEE;">&#41;</span>;
    <span style="color: #EEEEEE;">&#125;</span>
<span style="color: #EEEEEE;">&#125;</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">I created a new procedure called <em>Embed_2012_Control</em> and have set it to run on form load. I have set the Parent Class and Parent Window Names based on the information I obtained from Windows Modifier and the unique name I gave my window. <em>FindWindow</em> is then called using this information and the result is a HWND to the Maya window. Now we only need to call SetParent using the .Net Forms HWND (this.Handle) as the child and the Maya window HWND as the parent. We now have a .Net window embedded.</p>
<p style="text-align: justify;">
<p><a name="3c"></a><br />
<h3>Maya code used to spawn UI</h3>
<p style="text-align: justify;">The following code is taken from the Demo_2012.py file; it contains the imports and Embed Class functionality you will need for Part 1 of the tutorial.</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="python"><span style="color: #008000; font-style: italic;"># Load all required Modules</span>
<span style="color: #ff7700;font-weight:bold;">import</span> clr
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #E94545;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #E94545;">threading</span>
<span style="color: #ff7700;font-weight:bold;">import</span> maya.<span style="color: #AAAAAA;">cmds</span>
&nbsp;
<span style="color: #008000; font-style: italic;"># Add path to Maya .Net DLL</span>
<span style="color: #E94545;">sys</span>.<span style="color: #AAAAAA;">path</span>.<span style="color: #AAAAAA;">append</span><span style="color: #AAAAAA;">&#40;</span> <span style="color: #806FD5;">' Path to MayaUITutorial.dll '</span><span style="color: #AAAAAA;">&#41;</span>
&nbsp;
<span style="color: #008000; font-style: italic;"># Add Reference to the .Net Tutorial Runtime Lib</span>
clr.<span style="color: #AAAAAA;">AddReference</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #806FD5;">'MayaUITutorial'</span><span style="color: #AAAAAA;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">import</span> MayaUITutorial
&nbsp;
<span style="color: #008000; font-style: italic;">##############################################################################</span>
<span style="color: #008000; font-style: italic;">## EMBED CLASS</span>
<span style="color: #008000; font-style: italic;">##</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> MayaUITutorial_Embed_2012<span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>:
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0F70F4;">__init__</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #EEEEEE;">self</span><span style="color: #AAAAAA;">&#41;</span>:
        <span style="color: #008000; font-style: italic;"># Create ref .Net embedForm_2012</span>
        <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">Form</span> = MayaUI.<span style="color: #AAAAAA;">embedForm_2012</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>
&nbsp;
        <span style="color: #008000; font-style: italic;"># Attach function to Button event</span>
        <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">Form</span>.<span style="color: #AAAAAA;">cmdButton</span>.<span style="color: #AAAAAA;">Click</span> += <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">cmdButton</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> Show<span style="color: #AAAAAA;">&#40;</span><span style="color: #EEEEEE;">self</span><span style="color: #AAAAAA;">&#41;</span>:
        <span style="color: #008000; font-style: italic;"># Create and display Maya window for the .Net to attach in</span>
        <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">MayaWindow</span> = maya.<span style="color: #AAAAAA;">cmds</span>.<span style="color: #AAAAAA;">window</span><span style="color: #AAAAAA;">&#40;</span> title=<span style="color: #806FD5;">'Embed Viewport.NET'</span>, iconName=<span style="color: #806FD5;">'.Net Demo'</span>, widthHeight=<span style="color: #AAAAAA;">&#40;</span><span style="color: #ff4500;">350</span>, <span style="color: #ff4500;">250</span><span style="color: #AAAAAA;">&#41;</span> <span style="color: #AAAAAA;">&#41;</span>
        maya.<span style="color: #AAAAAA;">cmds</span>.<span style="color: #AAAAAA;">showWindow</span><span style="color: #AAAAAA;">&#40;</span> <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">MayaWindow</span> <span style="color: #AAAAAA;">&#41;</span>
&nbsp;
        <span style="color: #008000; font-style: italic;"># Spawn and start new thread for .Net window</span>
        formThread = <span style="color: #E94545;">threading</span>.<span style="color: #AAAAAA;">Thread</span><span style="color: #AAAAAA;">&#40;</span> target = <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">Form</span>.<span style="color: #AAAAAA;">Show</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>, args = <span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span> <span style="color: #AAAAAA;">&#41;</span>
        formThread.<span style="color: #AAAAAA;">start</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> cmdButton<span style="color: #AAAAAA;">&#40;</span><span style="color: #EEEEEE;">self</span>, *args<span style="color: #AAAAAA;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #806FD5;">'Cmds Run'</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">In the above code, I have imported the necessary <em>CLR</em>, <em>SYS</em> and <em>Threading</em> modules. In the <em>__init__</em> method I created an instance of the <em>embedForm_2012</em> and connected the event handler for the button on the form. We call the Maya window create and show methods at this point as we need to have a window to attach to, unlike Maya 2009 we need to show the window for it to be created. The core part of this python code is within the <em>Show</em> method, it is very similar to the example shown in <a href="http://tech-artists.org/wiki/PythonNetInMaya" target="_blank">Seth’s tutorial</a> except in the thread creation where I have used <em>.Show()</em> instead of <em>.ShowDialog()</em>. We want to have the dialog as a non-modal window ( doesn’t draw exclusive focus, i.e. File Dialogs) so we can have it open constantly while we work.</p>
<p style="text-align: justify;">The creation of this window is the core element of the whole two tutorials. Making sure that this is a unique name is imperative to making it all work. Then we can spawn the window using:</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> Demo_2012
MayaUITutorialEmbed_2012_Window = Demo_2012.<span style="color: #AAAAAA;">MayaUITutorial_Embed_2012</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>
MayaUITutorialEmbed_2012_Window.<span style="color: #AAAAAA;">Show</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">And we can get access to the Maya window to modify it using:</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="python">maya.<span style="color: #AAAAAA;">cmds</span>.<span style="color: #AAAAAA;">window</span><span style="color: #AAAAAA;">&#40;</span> MayaUITutorialEmbed_2012_Window.<span style="color: #AAAAAA;">MayaWindow</span>, edit=<span style="color: #EEEEEE;">True</span>, widthHeight=<span style="color: #AAAAAA;">&#40;</span><span style="color: #ff4500;">150</span>, <span style="color: #ff4500;">170</span><span style="color: #AAAAAA;">&#41;</span> <span style="color: #AAAAAA;">&#41;</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p>&nbsp</p>
<p style="text-align: center;">In Part 2 we will be looking at embedding Maya UI in .Net dialogs.<br />
So stay tuned...</p>
</p>
<p><a name="AdditionalResources"></a><br />
<h3>Additional Resources</h3>
<p><ul><a href="http://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">Python.Net Mailing List</a></ul>
<ul><a href="http://www.developer.com/net/cplus/article.php/2197621" target="_blank">What is Managed / UnManaged code?</a></ul>
<ul><a href="http://msdn.microsoft.com/en-us/library/ms644927(v=VS.85).aspx" target="_blank">Windows Messaging and Messaging Queues</a></ul>
</p>
<p>&nbsp<br />
&nbsp</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/tutorial/integrating-dotnet-and-maya2012-ui-pt1/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Integrating .Net &amp; Maya 2009 UI – Pt 1</title>
		<link>http://www.techartblog.com/tutorial/integrating-dotnet-and-maya-ui-pt1</link>
		<comments>http://www.techartblog.com/tutorial/integrating-dotnet-and-maya-ui-pt1#comments</comments>
		<pubDate>Tue, 05 Apr 2011 05:26:57 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Hwnd]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Python.Net]]></category>

		<guid isPermaLink="false">http://www.triaxel.com/blog/?p=8</guid>
		<description><![CDATA[This article is specific to Maya 2009, I have also created an updated tutorial for Maya 2012 (64bit) Developers In this multi-part tutorial we’ll be covering two main areas, embedding .Net forms within Maya and extracting Maya UI components and embedding them within your .Net dialogs. To get this to work we will be exploiting [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><img src="http://www.techartblog.com/wp-content/uploads/Maya2009.png" alt="" width="85" height="63" /></p>
<p style="text-align: left;"><white>This article is specific to Maya 2009, I have also created an updated tutorial for <a href="./?p=654">Maya 2012 (64bit) Developers</a></white>
</p>
<p style="text-align: justify;">In this multi-part tutorial we’ll be covering two main areas, embedding .Net forms within Maya and extracting Maya UI components and embedding them within your .Net dialogs. To get this to work we will be exploiting the windows messaging system and as a result, this will only work on Windows based systems. This technique is not exclusive to Maya and can be used for many other applications and has saved me on many occasions. Please understand that this tutorial is aimed at intermediate users of .Net and Maya Python scripting, as there will be some C# code used to interface with the windows messaging system and Python code to load the .Net windows within Maya. If you want to learn more about the following concepts you can check out the <a href="#AdditionalResources">Addition Resources</a> I have included.</p>
<p><span id="more-8"></span></p>
<p style="text-align: justify;">There are some drawbacks to using .Net dialogs within Maya, namely debugging and error handling, so please take this into consideration before implementing it within your pipeline. For this demo I will be using <a href="http://www.microsoft.com/express/" target="_blank">Visual Studio C# Express 2010</a>, but the concepts and code can be used within other software versions.</p>
<p style="text-align: justify;">Also throughout this tutorial I will be referring to C# and Maya Python code that has been condensed to save on space but I have included the full <a href="http://www.techartblog.com/wp-content/uploads/MayaUITutorialPt1.zip">Part 1 source code and solution</a> for your viewing pleasure</p>
<p style="text-align: justify;">By the end of this multi-part tutorial you will be able to embed your .Net Dialogs within Maya 2009 (32bit) properly, extract Maya UI components and embed them within your .Net application, and have a basic understanding of windows messaging. Recently Maya's UI has switched over to Qt, which mean some of the code listed here will not work, I will be adding an addendum tutorial to show the alterations that need to be made for Qt versions of Maya.</p>
<p>I have broken the tutorial up into a couple of parts:</p>
<ol>
<white></p>
<li><a href="#1">Creating the .Net application</a></li>
<li><a href="#2">Connecting Maya with .Net using Python</a></li>
<li><a href="#3">Embedding the .Net window within Maya</a>
<ol type="a">
<li><a href="#3a">Windows, controls &amp; HWND’s</a>
<ol type="i">
<li><a href="#3ai">Finding a windows HWND</a></li>
<li><a href="#3aii">Windows Modifier</a></li>
</ol>
</li>
<li><a href="#3b">C# code used to parent UI</a>
<ol type="i">
<li><a href="#3bi">Code References</a></li>
<li><a href="#3bii">Find and Parent code</a></li>
</ol>
</li>
<li><a href="#3c">Maya code used to spawn UI</a></li>
</ol>
</li>
<p></white>
</ol>
<p><a name="1"></a><br />
<h2>Creating the .Net application</h2>
<p style="text-align: justify;">Let’s start by creating a C# (Windows Forms Application) solution; I have created one called <em>MayaUITutorial</em>. I renamed <em>Form1</em> to <em>embedForm</em>, this will contain code to find a specific Maya window and embed itself into it.</p>
<p style="text-align: center;">
<a href="http://www.techartblog.com/wp-content/uploads/Forms_Design_01.png" target="_blank"><img alt=""   src="http://www.techartblog.com/wp-content/uploads/Forms_Design_01.png" title="Form Design" class="alignnone" width="500" height="365" /></a><br />
<strong>Fig 1.0</strong></p>
<blockquote><p style="text-align: justify;">In this image I have added a single button and removed the window’s border from the <em>embedForm</em> so it can be embedded cleanly within Maya.</p>
</blockquote>
<p><a name="2"></a><br />
<h2>Connecting Maya with .Net using Python</h2>
<p style="text-align: justify;">First things first, to run any .Net code within Maya you need to have installed <a href="http://sourceforge.net/projects/pythonnet/files/pythonnet-2.0-alpha2-clr2.0_py25/" target="_blank">Python.Net</a> for Maya 2009 (Python 2.5) and instead of writing it all out again, my mate Seth Gibson has put together a mid level tutorial just on this: <a href="http://tech-artists.org/wiki/PythonNetInMaya" target="_blank">http://tech-artists.org/wiki/PythonNetInMaya</a> If your Python.Net is up and running I would still recommend you take a look at this tutorial and become familiar with the interface.</p>
<p style="text-align: justify;">Now that we have .Net setup and running in Maya, let’s get stuck right into the best bits.</p>
<p><a name="3"></a><br />
<h2>Embedding .Net in Maya</h2>
<p style="text-align: justify;">One of the main issues with spawning a .Net window within Maya is having it sort correctly, minimize/maximize with the Maya window and not displaying in the task bar as if it were a separate application. Although this can be done with Windows messaging it can be simplified by parenting the .Net window within a native Maya window. By doing this simple trick you solve the major issues associated with the spawning and destruction of.Net windows. To complete this parenting work around we can use the windows messaging system to our advantage.</p>
<p><a name="3a"></a><br />
<h3>Windows, Controls &amp; HWND’s</h3>
<p style="text-align: justify;">Every window and control within Windows has a “Windows Handle” or HWND; this is a unique address that identifies the UI and what messages it receives. In addition to this ID each UI has an owner or parent which can also pass messages onto its children e.g. If a parent window is told to minimize then its children will also follow.</p>
<p><a name="3ai"></a><br />
<h4>Finding a window’s HWND</h4>
<p style="text-align: justify;">When a window is created it is assigned a HWND, it is more than extremely rare for a window to have the same ID as when it was last created. To find the correct window that we want to access we need to assign a unique name/ title to it so we can identify it from all the other similar controls. Later on we will be running through some code that will search for this unique window, as part of the function call we will need to include the UI class name. There are a couple of ways to find what a control’s class is;  if you have the Professional version of Visual Studio there is a tool called “Microsoft Spy++”, otherwise you can get an app called “Windows Modifier”. For this tutorial we’ll be using Windows Modifier as it has a couple of extra features that we can use to our benefit.</p>
<p><a name="3aii"></a><br />
<h4><strong>Windows Modifier</strong></h4>
<p style="text-align: justify;"><a href="http://www.pcworld.com/downloads/file/fid,29597-order,4/reviews.html" target="_blank">Windows Modifier</a> is as the title suggests a tool to modify windows. In addition to investigating the window's Class and HWND it has the ability to modify the size, state and the parent of a particular window. With this you can test out UI changes and parenting without even writing a line of code.</p>
<p style="text-align: center;"><a href="http://www.techartblog.com/wp-content/uploads/WinMod_Window.png" target="_blank"><img alt="" src="http://www.techartblog.com/wp-content/uploads/WinMod_Window.png" title="Windows Modifier" class="alignnone" width="500" height="330" /></a><br />
<strong>Fig 2.0</strong></p>
<blockquote><p style="text-align: justify;">In the image above we can see that Windows Modifier has two ways to display its UI Tree (Window Text and Class Name). When we call the find function within C# we will be using both the text and class name of the selected window to get the correct HWND of the window, so take note we will be using this in the next section.</p>
</blockquote>
<p style="text-align: center;"><a href="http://www.techartblog.com/wp-content/uploads/ModifiedWindow.png" target="_blank"><img alt="" src="http://www.techartblog.com/wp-content/uploads/ModifiedWindow.png" title="Modified Window" class="alignnone" width="500" height="304" /></a><br />
<strong>Fig 2.1</strong></p>
<blockquote><p style="text-align: justify;">As a side note, in this image we have a Maya window that has had its UI modified as a demonstration of what is possible with windows messaging, after a form has been created. It is quite easy to move elements of a window to fit the needs of your interface. We will be focusing more on this in part 2 of the tutorial.</p>
</blockquote>
<p>Alright… enough talking, let’s get stuck into some juicy code.</p>
<p><a name="3b"></a><br />
<h3>C# Code used to Parent UI</h3>
<p style="text-align: justify;">To embed a .Net window within a Maya window we need to write some code in both C# and Maya. The C# code will be responsible for finding the Maya window and attaching itself within it. Maya will then create the unique window and call the necessary code to initiate the .Net form creation and attachment. Let’s start with the C# code first as it will make things a little clearer down the track.</p>
<p><a name="3bi"></a><br />
<h4>C# Code References</h4>
<p>The following condensed code is taken from the <em>emebedForm</em>:</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="csharp"><span style="color: #E98D13;">using</span> <span style="color: #EEEEEE;">System</span>.<span style="color: #EEEEEE;">Runtime</span>.<span style="color: #EEEEEE;">InteropServices</span>;
<span style="color: #E98D13;">namespace</span> MayaUI
<span style="color: #EEEEEE;">&#123;</span>
    <span style="color: #E98D13;">public</span> partial <span style="color: #2A96BD;">class</span> embedForm : Form
    <span style="color: #EEEEEE;">&#123;</span>
        <span style="color: #079816; font-style: italic;">// Include SetParent Reference</span>
        <span style="color: #EEEEEE;">&#91;</span><span style="color: #2A96BD;">DllImport</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #D47C6E;">&quot;User32&quot;</span>, <span style="color: #2A96BD;">CharSet</span> = <span style="color: #2A96BD;">CharSet</span>.<span style="color: #E98D13;">Auto</span>, ExactSpelling = <span style="color: #E98D13;">true</span><span style="color: #EEEEEE;">&#41;</span><span style="color: #EEEEEE;">&#93;</span>
        <span style="color: #E98D13;">internal</span> <span style="color: #E98D13;">static</span> <span style="color: #E98D13;">extern</span> <span style="color: #2A96BD;">IntPtr</span> SetParent<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">IntPtr</span> hWndChild, <span style="color: #2A96BD;">IntPtr</span> hWndParent<span style="color: #EEEEEE;">&#41;</span>;
&nbsp;
        <span style="color: #079816; font-style: italic;">// Include hWnd of a selected window references</span>
        <span style="color: #EEEEEE;">&#91;</span><span style="color: #2A96BD;">DllImport</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #D47C6E;">&quot;user32.dll&quot;</span>, SetLastError = <span style="color: #E98D13;">true</span><span style="color: #EEEEEE;">&#41;</span><span style="color: #EEEEEE;">&#93;</span>
        <span style="color: #E98D13;">static</span> <span style="color: #E98D13;">extern</span> <span style="color: #2A96BD;">IntPtr</span> FindWindow<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">string</span> lpClassName, <span style="color: #2A96BD;">string</span> lpWindowName<span style="color: #EEEEEE;">&#41;</span>;
&nbsp;
        <span style="color: #EEEEEE;">&#91;</span><span style="color: #2A96BD;">DllImport</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #D47C6E;">&quot;user32.dll&quot;</span>, SetLastError = <span style="color: #E98D13;">true</span><span style="color: #EEEEEE;">&#41;</span><span style="color: #EEEEEE;">&#93;</span>
        <span style="color: #E98D13;">static</span> <span style="color: #E98D13;">extern</span> <span style="color: #2A96BD;">IntPtr</span> FindWindowEx<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">IntPtr</span> hwndParent, <span style="color: #2A96BD;">IntPtr</span> hwndChildAfter, <span style="color: #2A96BD;">string</span> lpszClass, <span style="color: #2A96BD;">string</span> lpszWindow<span style="color: #EEEEEE;">&#41;</span>;</pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">First of all we need to include System.Runtime.InteropServices to get access to the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx#Y1700" target="_blank">DllImportAttribue</a> creating references to SetParent (Setting the parent of a particular UI), <em>FindWindow</em> and <em>FindWindowEx</em> (Finding a window’s HWND based on a combination of the window title, class and parent). Using this in conjunction with a unique windows title we are able to get the correct HWND. These imports enable us to use shared unmanaged code within our managed application, or in other words, giving us access to the Windows API (WIN32 API)</p>
<blockquote><p style="text-align: justify;"><strong>NB:</strong> In the case that you are making multiple instances of your window you will have to pass the unique name to the form at time of creation. For this tutorial however we will assume that the window will not be instanced.</p>
</blockquote>
<p><a name="3bii"></a><br />
<h4>Find and Parent code</h4>
<p style="text-align: justify;">The following condensed code is used to search and attach the .Net window within a specifically named Maya window. As we are only looking for the window’s HWND there isn’t an awful lot of code in this example but in the next tutorial we will be digging a little deeper into a window’s components so you’ll get a couple more lines to check out.</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="csharp"><span style="color: #E98D13;">public</span> partial <span style="color: #2A96BD;">class</span> embedForm : Form
<span style="color: #EEEEEE;">&#123;</span>
    <span style="color: #E98D13;">public</span> <span style="color: #E98D13;">void</span> Embed_Control<span style="color: #EEEEEE;">&#40;</span><span style="color: #EEEEEE;">&#41;</span>
    <span style="color: #EEEEEE;">&#123;</span>
        <span style="color: #079816; font-style: italic;">//Set the name and Class of the Maya blank window</span>
        <span style="color: #2A96BD;">string</span> lpszParentClass = <span style="color: #D47C6E;">&quot;AfxFrameOrView80&quot;</span>;
        <span style="color: #2A96BD;">string</span> lpszParentWindow = <span style="color: #D47C6E;">&quot;Embed Viewport.NET&quot;</span>;
&nbsp;
        <span style="color: #2A96BD;">IntPtr</span> ParenthWnd = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #2A96BD;">IntPtr</span><span style="color: #EEEEEE;">&#40;</span><span style="color: #FF0000;">0</span><span style="color: #EEEEEE;">&#41;</span>;
&nbsp;
        <span style="color: #079816; font-style: italic;">/* Attach the .Net Form into the Maya blank window */</span>
        ParenthWnd = FindWindow<span style="color: #EEEEEE;">&#40;</span>lpszParentClass, lpszParentWindow<span style="color: #EEEEEE;">&#41;</span>;
        SetParent<span style="color: #EEEEEE;">&#40;</span><span style="color: #E98D13;">this</span>.<span style="color: #EEEEEE;">Handle</span>, ParenthWnd<span style="color: #EEEEEE;">&#41;</span>;
    <span style="color: #EEEEEE;">&#125;</span>
&nbsp;
    <span style="color: #E98D13;">private</span> <span style="color: #E98D13;">void</span> embedForm_Load<span style="color: #EEEEEE;">&#40;</span><span style="color: #2A96BD;">object</span> sender, EventArgs e<span style="color: #EEEEEE;">&#41;</span>
    <span style="color: #EEEEEE;">&#123;</span>
        Embed_Control<span style="color: #EEEEEE;">&#40;</span><span style="color: #EEEEEE;">&#41;</span>;
    <span style="color: #EEEEEE;">&#125;</span>
<span style="color: #EEEEEE;">&#125;</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">I created a new procedure called <em>Embed_Control</em> and have set it to run on form load. I have set the Parent Class and Parent Window Names based on the information I obtained from Windows Modifier and the unique name I gave my window. <em>FindWindow</em> is then called using this information and the result is a HWND to the Maya window. Now we only need to call SetParent using the .Net Forms HWND (this.Handle) as the child and the Maya window HWND as the parent. We now have a .Net window embedded.</p>
<p style="text-align: justify;">
<p><a name="3c"></a><br />
<h3>Maya code used to spawn UI</h3>
<p style="text-align: justify;">The following code is taken from the Demo.py file; it contains the imports and Embed Class functionality you will need for Part 1 of the tutorial.</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="python"><span style="color: #008000; font-style: italic;"># Load all required Modules</span>
<span style="color: #ff7700;font-weight:bold;">import</span> clr
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #E94545;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #E94545;">threading</span>
<span style="color: #ff7700;font-weight:bold;">import</span> maya.<span style="color: #AAAAAA;">cmds</span>
&nbsp;
<span style="color: #008000; font-style: italic;"># Add path to Maya .Net DLL</span>
<span style="color: #E94545;">sys</span>.<span style="color: #AAAAAA;">path</span>.<span style="color: #AAAAAA;">append</span><span style="color: #AAAAAA;">&#40;</span> <span style="color: #806FD5;">' Path to MayaUITutorial.dll '</span><span style="color: #AAAAAA;">&#41;</span>
&nbsp;
<span style="color: #008000; font-style: italic;"># Add Reference to the .Net Tutorial Runtime Lib</span>
clr.<span style="color: #AAAAAA;">AddReference</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #806FD5;">'MayaUITutorial'</span><span style="color: #AAAAAA;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">import</span> MayaUI
&nbsp;
<span style="color: #008000; font-style: italic;">##############################################################################</span>
<span style="color: #008000; font-style: italic;">## EMBED CLASS</span>
<span style="color: #008000; font-style: italic;">##</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> MayaUITutorial_Embed<span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>:
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0F70F4;">__init__</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #EEEEEE;">self</span><span style="color: #AAAAAA;">&#41;</span>:
        <span style="color: #008000; font-style: italic;"># Create ref .Net embedForm</span>
        <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">Form</span> = MayaUI.<span style="color: #AAAAAA;">embedForm</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>
&nbsp;
        <span style="color: #008000; font-style: italic;"># Attach function to Button event</span>
        <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">Form</span>.<span style="color: #AAAAAA;">cmdButton</span>.<span style="color: #AAAAAA;">Click</span> += <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">cmdButton</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> Show<span style="color: #AAAAAA;">&#40;</span><span style="color: #EEEEEE;">self</span><span style="color: #AAAAAA;">&#41;</span>:
        <span style="color: #008000; font-style: italic;"># Create a Maya window for the .Net to attach in</span>
        <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">MayaWindow</span> = maya.<span style="color: #AAAAAA;">cmds</span>.<span style="color: #AAAAAA;">window</span><span style="color: #AAAAAA;">&#40;</span> title=<span style="color: #806FD5;">'Embed Viewport.NET'</span>, iconName=<span style="color: #806FD5;">'.Net Demo'</span>, widthHeight=<span style="color: #AAAAAA;">&#40;</span><span style="color: #ff4500;">350</span>, <span style="color: #ff4500;">250</span><span style="color: #AAAAAA;">&#41;</span> <span style="color: #AAAAAA;">&#41;</span>
&nbsp;
        <span style="color: #008000; font-style: italic;"># Spawn and start new thread for .Net window</span>
        formThread = <span style="color: #E94545;">threading</span>.<span style="color: #AAAAAA;">Thread</span><span style="color: #AAAAAA;">&#40;</span> target = <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">Form</span>.<span style="color: #AAAAAA;">Show</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>, args = <span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span> <span style="color: #AAAAAA;">&#41;</span>
        formThread.<span style="color: #AAAAAA;">start</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>
&nbsp;
        <span style="color: #008000; font-style: italic;">#Display the Maya window</span>
        maya.<span style="color: #AAAAAA;">cmds</span>.<span style="color: #AAAAAA;">showWindow</span><span style="color: #AAAAAA;">&#40;</span> <span style="color: #EEEEEE;">self</span>.<span style="color: #AAAAAA;">MayaWindow</span> <span style="color: #AAAAAA;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> cmdButton<span style="color: #AAAAAA;">&#40;</span><span style="color: #EEEEEE;">self</span>, *args<span style="color: #AAAAAA;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #806FD5;">'Cmds Run'</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">In the above code, I have imported the necessary <em>CLR</em>, <em>SYS</em> and <em>Threading</em> modules. In the <em>__init__</em> method I created an instance of the <em>embedForm</em> and connected the event handler for the button on the form. We call the Maya window create method at this point as we need to have a window to attach to. The core part of this python code is within the <em>Show</em> method, it is very similar to the example shown in <a href="http://tech-artists.org/wiki/PythonNetInMaya" target="_blank">Seth’s tutorial</a> except in the thread creation where I have used <em>.Show()</em> instead of <em>.ShowDialog()</em>. We want to have the dialog as a non-modal window ( doesn’t draw exclusive focus, i.e. File Dialogs) so we can have it open constantly while we work. Lastly we call the show method of the Maya window.</p>
<p style="text-align: justify;">The creation of this window is the core element of the whole two tutorials. Making sure that this is a unique name is imperative to making it all work. Then we can spawn the window using:</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> Demo
MayaUITutorialEmbedWindow = Demo.<span style="color: #AAAAAA;">MayaUITutorial_Embed</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span>
MayaUITutorialEmbedWindow.<span style="color: #AAAAAA;">Show</span><span style="color: #AAAAAA;">&#40;</span><span style="color: #AAAAAA;">&#41;</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">And we can get access to the Maya window to modify it using:</p>
<table cellpadding="5px" width="100%" bgcolor="#202020">
<tbody>
<tr>
<td><span style="font-family: arial; font-size: 11px; color:#AAAAAA;"></p>
<pre class="python">maya.<span style="color: #AAAAAA;">cmds</span>.<span style="color: #AAAAAA;">window</span><span style="color: #AAAAAA;">&#40;</span> MayaUITutorialEmbedWindow.<span style="color: #AAAAAA;">MayaWindow</span>, edit=<span style="color: #EEEEEE;">True</span>, widthHeight=<span style="color: #AAAAAA;">&#40;</span><span style="color: #ff4500;">150</span>, <span style="color: #ff4500;">170</span><span style="color: #AAAAAA;">&#41;</span> <span style="color: #AAAAAA;">&#41;</span></pre>
<p></span></td>
</tr>
</tbody>
</table>
<p>&nbsp</p>
<p style="text-align: center;">In Part 2 we will be looking at embedding Maya UI in .Net dialogs.<br />
So stay tuned...</p>
</p>
<p><a name="AdditionalResources"></a><br />
<h3>Additional Resources</h3>
<p><ul><a href="http://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">Python.Net Mailing List</a></ul>
<ul><a href="http://www.developer.com/net/cplus/article.php/2197621" target="_blank">What is Managed / UnManaged code?</a></ul>
<ul><a href="http://msdn.microsoft.com/en-us/library/ms644927(v=VS.85).aspx" target="_blank">Windows Messaging and Messaging Queues</a></ul>
</p>
<p>&nbsp<br />
&nbsp</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/tutorial/integrating-dotnet-and-maya-ui-pt1/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reel 2010</title>
		<link>http://www.techartblog.com/folio/robert-butterworth-maya-2010-reel</link>
		<comments>http://www.techartblog.com/folio/robert-butterworth-maya-2010-reel#comments</comments>
		<pubDate>Fri, 26 Nov 2010 14:59:54 +0000</pubDate>
		<dc:creator>Rob Butterworth</dc:creator>
				<category><![CDATA[Folio]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Cpp]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Mel]]></category>
		<category><![CDATA[Mental Ray]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[PyMel]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.techartblog.com/?p=211</guid>
		<description><![CDATA[This is a compilation of some of the Maya tools I have created and was able to show. 3dsMax reel still to come. If you want more details, check out the videos section. www.youtube.com/watch?v=tE15ntpdlCc]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">This is a compilation of some of the Maya tools I have created and was able to show. 3dsMax reel still to come.</p>
<p style="text-align: center;">If you want more details, check out the <a href="./?page_id=39" target="_self">videos section</a>.</p>
<p style="text-align: center;"><span class="youtube">
<object width="560" height="340">
<param name="movie" value="http://www.youtube-nocookie.com/v/tE15ntpdlCc?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" />
<param name="allowFullScreen" value="true" />
<embed wmode="opaque" src="http://www.youtube-nocookie.com/v/tE15ntpdlCc?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="560" height="340"></embed>
<param name="wmode" value="opaque" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=tE15ntpdlCc"><img src="http://img.youtube.com/vi/tE15ntpdlCc/default.jpg" width="130" height="97" border=0></a></p><p><a href="http://www.youtube.com/watch?v=tE15ntpdlCc">www.youtube.com/watch?v=tE15ntpdlCc</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techartblog.com/folio/robert-butterworth-maya-2010-reel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
