<?xml version="1.0" encoding="UTF-8" ?>
			<rss version="2.0">
				<channel>
					
								<lastBuildDate>Sat, 04 Feb 2012 01:47:06 GMT</lastBuildDate>
							
								<title><![CDATA[jhaywood.com]]></title>
							
								<generator><![CDATA[Doteasy Hosted Blogs - Powered By Doteasy.com]]></generator>
							
								<link><![CDATA[http://apps.jhaywood.com/Blog/]]></link>
							
								<ttl><![CDATA[60]]></ttl>
							
								<description><![CDATA[James Haywood's random rumblings...
&nbsp;
Infrequent discussions on 3dsMax, WPF, and other stuff
]]></description>
							
								<docs><![CDATA[http://blogs.law.harvard.edu/tech/rss]]></docs>
							
								<pubDate>Sat, 04 Feb 2012 01:47:06 GMT</pubDate>
							
						<item>
							
											<description><![CDATA[<p>There are three key components to getting .Net 4.0 working inside of Max 2011...</p>
<ol>
    <li>Recompile the mxsdotNet.dlx file using Visual Studio 2010.</li>
    <li>Modify the 3dsMax.exe.config file.</li>
    <li>Install the Visual C++ 2010 components.</li>
</ol>
<p>I'll describe each in detail below, but first I should mention that this is not officially supported by Autodesk.&nbsp; So if you run into trouble because of it, you're on your own.&nbsp; Kind of like hacking your video card to make it run faster.<br />
<br />
I've been running Max 2011 with .Net 4.0 WPF tools running within it for a couple months now without any noticable issues.&nbsp; But I can't gaurantee that this will be the case for everyone.&nbsp; And I've only been using the 64-bit version, although I can't think of why this wouldn't work with the 32-bit version as well.&nbsp; As for versions of Max before 2011, I have no idea if this will work or not.<br />
<br />
So, on to the instructions...<br />
<br />
1. Recompiling the mxsdotNet plugin is pretty straighforward.&nbsp; Just install the SDK, open the<em> ...\samples\maxscript\mxsdotNet\mxsdotNet.sln </em>file and compile.&nbsp; If you don't have Visual Studio 2010, you can download the already recompiled 64-bit version below.<br />
<br />
2. Open the<em> ...\Autodesk\3ds Max 2011\3dsmax.exe.config </em>file in a text editor and add the following lines right before the closing<em> &lt;/configuration&gt;</em> tag...<br />
<br />
<font face="Courier New"> &lt;startup useLegacyV2RuntimeActivationPolicy=&quot;true&quot;&gt;<br />
&nbsp; &lt;supportedRuntime version=&quot;v4.0&quot; sku=&quot;.NETFramework,Version=v4.0&quot;/&gt;<br />
&lt;/startup&gt;<br />
</font> <br />
3.&nbsp; Lastly, if you haven't already installed Visual Studio 2010, you'll need to manually install the Visual C++ 2010 components.&nbsp; But if you have, then these should be installed for you already.&nbsp; You can download the installers here...<br />
<br />
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&amp;displaylang=en">32-bit</a><br />
<a href="http://www.microsoft.com/downloads/details.aspx?familyid=BD512D9E-43C8-4655-81BF-9350143D5867&amp;displaylang=en">64-bit</a><br />
<br />
And that's it.&nbsp; Once you've got all the necessary files modified correctly, you'll be able to load and use .Net 4.0 assemblies directly in Max.&nbsp; The <strong>DataGridView </strong>control alone is worth the effort.<br />
<br />
Download 64-bit .Net plugin and config file <a href="http://www.jhaywood.com/blog/mxsdotNet_64bit.zip">here</a>.</p>]]></description>
										
											<title><![CDATA[DotNet 4.0 in 3dsMax 2011]]></title>
										
											<link><![CDATA[http://apps.jhaywood.com/Blog/?e=52773&d=08/11/2010&s=DotNet%204%2E0%20in%203dsMax%202011]]></link>
										
											<guid><![CDATA[http://apps.jhaywood.com/Blog/?e=52773&d=08/11/2010&s=DotNet%204%2E0%20in%203dsMax%202011]]></guid>
										
											<pubDate>Thu, 12 Aug 2010 02:44:00 GMT</pubDate>
										
						</item>
					
						<item>
							
											<description><![CDATA[<p><img src="/blog/upload/j/h/jhaywood.com/d2d719ea7e4d619c03d99f0fad01b111.jpg" target="_new" alt="MaxScript Editor Autocomplete" /><br />
<br />
You may or may not know about the autocomplete feature available in the MaxScript Editor (as of version 9 or so, I forget when it was changed exactly).&nbsp; It's very helpful when scripting to cut down on typos and to speed things up over all (for another way to speed up script creation, check out Johan's blog <a href="http://blog.subd.nl/2010/03/maxscript-editor-tips-abbreviations/">post </a>about using abbreviations).<br />
<br />
To enable it, select &quot;Open Global Options File&quot; in the &quot;Tools&quot; menu.&nbsp; Then do a search for &quot;autocomplete&quot; and change or insert the following lines...<br />
<br />
<font face="Courier New">autocompleteword.automatic=1<br />
autocomplete.*.ignorecase=1<br />
autocomplete.choose.single=0<br />
</font><br />
You can see what each line actually does by reading the MaxScript help doc.&nbsp; After you save the file, you'll see the autocomplete popup menu as you type when there is only one other word in the current script that mathces what you've typed up to that point.&nbsp; Then just press Enter to fill out the rest of the word.&nbsp; You can also press Ctrl-Enter at any time while you're typing to bring up a list of possible matches which you can then select from using the up/down arrow keys.<br />
<br />
While that alone is pretty handy, wouldn't it be useful if autocomplete didn't just look for words within the current script, but was able to match against any MaxScript command too?&nbsp; Well it can.&nbsp; You just need to provide an api file for it to use which lists all of the commands.&nbsp; Unfortunately, Autodesk doesn't provide one with Max, but I've made a script that will create one for you.<br />
<br />
Download the script below and run it to create the api file.&nbsp; It will try to save it to your Max root folder, but if you run into trouble becuase of Windows UAC settings, just modify the script to save it somewhere else, shut down Max, and then move it to the root.&nbsp; Then add the following lines to the global options file...<br />
<br />
<font face="Courier New"> autocomplete.*.start.characters=$(chars.alpha)$(chars.numeric)$_@#.<br />
</font><font face="Courier New">api.*.ms=maxscript.api</font><br />
<br />
You can actually add more than one api file, for things like custom functions and such.&nbsp; Just create a text file with one word on each line, or a word/period/word combination for functions within scructs, and save it to the Max root.&nbsp; Then and add the file name to the above line following a semicolon, like so...<br />
<br />
<font face="Courier New">api.*.ms=maxscript.api;mytools.api</font><br />
<br />
The one problem with using an api file is that it takes precedent over the current script, so that you no longer get words from the script you're working on in the autocomplete list.&nbsp; What you can do, though, is if you're beginning to type the name of a local function or something that you know already exists in the current script, press <strong>Ctrl-Enter </strong>and you'll see your local word matches.<br />
<br />
One last thing, I'm posting the script to create the api file instead of the api file itself because different versions of Max will have different commands available.&nbsp; So this lets you create a new list for every new version of Max.<br />
<br />
Download the script <a href="http://www.jhaywood.com/blog/createMaxscriptApiFile.zip">here</a>.</p>]]></description>
										
											<title><![CDATA[Autocomplete in the MaxScript Editor]]></title>
										
											<link><![CDATA[http://apps.jhaywood.com/Blog/?e=51577&d=07/13/2010&s=Autocomplete%20in%20the%20MaxScript%20Editor]]></link>
										
											<guid><![CDATA[http://apps.jhaywood.com/Blog/?e=51577&d=07/13/2010&s=Autocomplete%20in%20the%20MaxScript%20Editor]]></guid>
										
											<pubDate>Tue, 13 Jul 2010 11:12:00 GMT</pubDate>
										
						</item>
					
						<item>
							
											<description><![CDATA[<p>I recently came across a nasty issue that comes up when hosting a WPF control inside of a docked Max rollout.&nbsp; The problem is that anything that causes the entire Max UI to redraw (like docking/undocking a rollout or changing the minimized state of the Graphite ribbon while it's docked) makes the WPF control completely disappear.&nbsp; The elements of the control pop back into existence as you mouse over them, but of course it's a pain to have to keep waving your arrow over a section of the screen to get your controls back.<br />
<br />
Fortunately, there's a fairly easy work around to keep it from disappearing.<br />
<br />
So, execute the following script and you'll see a row of WPF buttons in a stackpanel docked to the left side of the screen like so...<br />
<br />
<img alt="WPF refresh issue 1" target="_new" src="/blog/upload/j/h/jhaywood.com/23b8c22bfa28a3558e44223bbc63d54e.JPG" /><br />
<br />
<font face="Courier New">------------------<br />
dotNet.loadAssembly @&quot;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll&quot;<br />
<br />
rollout wpfRefresh_RLT &quot;&quot; width:70 height:220<br />
(<br />
&nbsp; dotNetControl eh &quot;Integration.ElementHost&quot; width:70 height:500 align:#left offset:[-14,-5]<br />
&nbsp;&nbsp; on wpfRefresh_RLT open do<br />
&nbsp;&nbsp; (<br />
&nbsp;&nbsp;&nbsp;&nbsp; uc = dotNetObject &quot;System.Windows.Controls.UserControl&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; eh.child = uc<br />
&nbsp;&nbsp;&nbsp;&nbsp; sp = dotNetObject &quot;System.Windows.Controls.StackPanel&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; for i = 1 to 10 do<br />
&nbsp;&nbsp;&nbsp;&nbsp; (<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; btn = dotNetObject &quot;System.Windows.Controls.Button&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; btn.height = 20<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; btn.content = &quot;button &quot; + i as string<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sp.children.add btn<br />
&nbsp;&nbsp;&nbsp;&nbsp; )<br />
&nbsp;&nbsp;&nbsp;&nbsp; uc.content = sp<br />
&nbsp;&nbsp; )<br />
)<br />
<br />
createDialog wpfRefresh_RLT style:#(#style_toolwindow,#style_sysmenu,#style_resizing)<br />
cui.RegisterDialogBar wpfRefresh_RLT style:#(#cui_floatable,#cui_dock_left,#cui_handles)<br />
cui.DockDialogBar wpfRefresh_RLT #cui_dock_left<br />
------------------<br />
</font><br />
And now if you do something to make the UI redraw, like I mentioned above, you get this...<br />
<br />
<img alt="WPF refresh issue 2" target="_new" src="/blog/upload/j/h/jhaywood.com/c988b9fa6809b062e415cc07e779d0d7.JPG" /><br />
<br />
Wave the mouse arrow over the controls and you'll see them reappear one at a time.<br />
<br />
The way to keep this from happening is to catch the <strong>Paint</strong> event on the ElementHost and manually force it to redraw by calling it's <strong>Refresh()</strong> method.&nbsp; That's easy enough, but it turns out that calling Refresh() causes the Paint event to trigger again.&nbsp; So it gets into a nice little infinite loop and really messes with Max's overall performance.<br />
<br />
So we need to add one more step, which is to use a boolean variable to make sure that it only refreshes once and then stops.<br />
<br />
Add the following to the rollout to make these changes:</p>
<p><font face="Courier New"><br />
------------------<br />
local doRefresh = true<br />
<br />
on eh Paint args do</font> <font face="Courier New"><br />
(<br />
&nbsp;&nbsp;&nbsp; if doRefresh then<br />
&nbsp;&nbsp;&nbsp; (<br />
&nbsp; &nbsp; &nbsp;&nbsp; doRefresh = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eh.refresh()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doRefresh = true<br />
&nbsp;&nbsp;&nbsp;&nbsp; )<br />
)<br />
-------------------</font><br />
<br />
Now the WPF control will redraw itself whenever it needs to.&nbsp; The full script can be downloaded <a href="http://jhaywood.com/blog/wpfRefreshIssue.zip">here</a>.</p>]]></description>
										
											<title><![CDATA[WPF Refresh Issue With Docked Rollouts]]></title>
										
											<link><![CDATA[http://apps.jhaywood.com/Blog/?e=51000&d=06/30/2010&s=WPF%20Refresh%20Issue%20With%20Docked%20Rollouts]]></link>
										
											<guid><![CDATA[http://apps.jhaywood.com/Blog/?e=51000&d=06/30/2010&s=WPF%20Refresh%20Issue%20With%20Docked%20Rollouts]]></guid>
										
											<pubDate>Wed, 30 Jun 2010 04:36:00 GMT</pubDate>
										
						</item>
					
						<item>
							
											<description><![CDATA[<p><img alt="Torus on the highway" target="_new" src="/blog/upload/j/h/jhaywood.com/e190168e63e1f8664a1d925c8a3e4626.jpg" /><br />
<em>Torus on the highway</em></p>
<p>I was recently directed to a great HDR toolset called Smart IBL.&nbsp; It's basically a system for creating HDR images with a bunch of imbedded information that makes it really easy to set up a realistic rendering environment inside of any (well most) 3D apps.<br />
<br />
The main application is called sIBL-GUI.&nbsp; It's a browser for your sIBL set, and the interface for connecting to the 3D app.&nbsp; It's really easy to set up with Max so that all you have to do is download or create some sIBL files, add them to the sIBL-GUI database, select one, and then click a button to have a light (or lights), a ground plane, and environment settings all created automatically.<br />
<br />
The other tool, sIBL-Edit, is also useful, but the automated script for creating the Max environment isn't as up to date as the sIBL-GUI version.&nbsp; So use GUI for 3D app interop, and Edit for modifying the embedded information.<br />
<br />
I've been having a lot of fun with both of these lately, and have even contributed to the Max template in the GUI app.&nbsp; So if you're doing any HDR rendering, give it a shot.<br />
<br />
Links:</p>
<p><a href="http://www.hdrlabs.com/sibl/index.html">Smart IBL</a><br />
<a href="http://www.hdrlabs.com">IBL Tools<br />
HDR Labs Home</a></p>]]></description>
										
											<title><![CDATA[Smart IBL and Setting Up HDR Invironments]]></title>
										
											<link><![CDATA[http://apps.jhaywood.com/Blog/?e=50694&d=06/24/2010&s=Smart%20IBL%20and%20Setting%20Up%20HDR%20Invironments]]></link>
										
											<guid><![CDATA[http://apps.jhaywood.com/Blog/?e=50694&d=06/24/2010&s=Smart%20IBL%20and%20Setting%20Up%20HDR%20Invironments]]></guid>
										
											<pubDate>Thu, 24 Jun 2010 12:28:00 GMT</pubDate>
										
						</item>
					
						<item>
							
											<description><![CDATA[<p><img src="/blog/upload/j/h/jhaywood.com/b72e0ec3c68e21198bcb7178c2c30734.jpg" target="_new" alt="Progress Bar, Part 3" /></p>
<p>&nbsp;</p>
<p>This will be a short post.&nbsp; I just wanted to finish up this series about hosting a WPF control inside of Max by showing how, as one final method, you can also use a WPF window instead of either the MaxForm window or the rollout.&nbsp; The script code is basically the same as the MaxForm version, minus the ElementHost.&nbsp; You don't need it because the WPF control is being loaded into a WPF window.&nbsp; No host needed.<br />
<font face="Courier New"><br />
-------------------------------------------------------------------------<br />
dotNet.loadAssembly @&quot;&lt;folder name&gt;\ProgressBar\ProgressBar\bin\Debug\ProgressBar.dll&quot;<br />
<br />
bar = dotNetObject &quot;ProgressBar.UserControl1&quot;<br />
frm = dotnetobject &quot;System.Windows.Window&quot;<br />
<br />
frm.title = &quot;Progress&quot;<br />
frm.width = bar.width + 16<br />
frm.height = bar.height + 34<br />
frm.windowStartupLocation = frm.windowStartupLocation.centerScreen<br />
frm.windowStyle = frm.windowStyle.toolWindow<br />
<br />
frm.content = bar<br />
<br />
frm.show()<br />
-------------------------------------------------------------------------</font><br />
<br />
There are a couple of extra drawbacks though. One, you need to manage all of the foreground and background colors yourself if you want it to look like it's part of Max.&nbsp; Same goes for assigning the parent window as Max itself, so that it will follow along with Max as you maximize/minimize or navigate away to different programs.&nbsp; Otherwise it just kinds of floats off by itself and is easy to lose.<br />
<br />
Finally, and probably most importantly, you need to set the &quot;accelerators&quot; state depending on whether the window has focus or not.&nbsp; Accelerators are just another name for hotkeys.&nbsp; And if don't manually manage this, the user won't be able to type into any text boxes in your tool.&nbsp; So in the &quot;GotFocus&quot; event you'll want to turn hotkeys off with &quot;enableAccelerators = false&quot;.&nbsp; And then turn them back on in the &quot;LostFocus&quot; event.<br />
<br />
So overall, unless you're planning on doing something that you can't do with a regular window, like changing the shape or something crazy like that, I don't see any benefit to using a WPF window over either of the other two methods.</p>]]></description>
										
											<title><![CDATA[WPF in 3dsMax, Part 3]]></title>
										
											<link><![CDATA[http://apps.jhaywood.com/Blog/?e=50108&d=06/14/2010&s=WPF%20in%203dsMax%2C%20Part%203]]></link>
										
											<guid><![CDATA[http://apps.jhaywood.com/Blog/?e=50108&d=06/14/2010&s=WPF%20in%203dsMax%2C%20Part%203]]></guid>
										
											<pubDate>Mon, 14 Jun 2010 06:29:00 GMT</pubDate>
										
						</item>
					
						<item>
							
											<description><![CDATA[<p><img src="/blog/upload/j/h/jhaywood.com/22dacc777aad05ef155f8a6811a8a75a.jpg" target="_new" alt="Progress Bar, Part 2" /><br />
<br />
<br />
To follow up on part 1, a nice side benefit to using the <strong>ElementHost </strong>for loading your WPF control into Max is that you can put it inside of a rollout.&nbsp; This let's you do things like dock it to the Max viewport, add it inside of a scripted modifier or plugin, or any number of other Max-specific things you can do with a rollout.<br />
<br />
And here is a sample of how to do that with the progress bar I posted in <a href="http://apps.jhaywood.com/Blog/?e=49614&amp;d=06/03/2010&amp;s=WPF%20in%203dsMax%2C%20Part%201">Part 1</a>:</p>
<p><font face="Courier New">-------------------------------------------------------------------------<br />
<br />
-- load the assemblies<br />
dotNet.loadAssembly @&quot;&lt;folder name&gt;\Projects\ProgressBar\ProgressBar\bin\Debug\ProgressBar.dll&quot;<br />
dotNet.loadAssembly @&quot;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll&quot;<br />
<br />
-- create the rollout<br />
bar = dotNetObject &quot;ProgressBar.UserControl1&quot;<br />
size = [bar.width,bar.height]<br />
frm = rollout progressBar_RLT &quot;Progress&quot; width:size.x height:size.y<br />
(<br />
&nbsp;&nbsp;&nbsp; dotNetControl eh &quot;Integration.ElementHost&quot; width:size.x height:size.y align:#left offset:[-14,-5]<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; on progressBar_RLT open do<br />
&nbsp;&nbsp;&nbsp; (<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; eh.child = bar<br />
&nbsp;&nbsp;&nbsp; )<br />
)<br />
<br />
createDialog progressBar_RLT<br />
cui.RegisterDialogBar progressBar_RLT<br />
<br />
-------------------------------------------------------------------------</font></p>
<p>Once you have it loaded, the commands used in the previous post to make it progress through the steps work just the same, since the WPF assembly itself hasn't changed.<br />
<br />
You might notice that the background is different now.&nbsp; That's because when using the MaxForm window, the background of the window is set automatically to whatever color Max itself is set to, and all the controls contained in that window inherit that color for their background.&nbsp; But this doesn't happen witha a rollout.<br />
<br />
So if you want to maintain a consistent look to your UI, you'll need to set the background of the WPF control manually.&nbsp; The best way to do that would be to set up the &quot;Loaded&quot; event for the UserControl on the code side of your project to query the background color from Max and then apply it.&nbsp; Lone Robot has some great information on how do to just that <a href="http://lonerobot.net/?p=472">here</a>.</p>]]></description>
										
											<title><![CDATA[WPF in 3dsMax, Part 2]]></title>
										
											<link><![CDATA[http://apps.jhaywood.com/Blog/?e=49810&d=06/07/2010&s=WPF%20in%203dsMax%2C%20Part%202]]></link>
										
											<guid><![CDATA[http://apps.jhaywood.com/Blog/?e=49810&d=06/07/2010&s=WPF%20in%203dsMax%2C%20Part%202]]></guid>
										
											<pubDate>Mon, 07 Jun 2010 04:15:00 GMT</pubDate>
										
						</item>
					
						<item>
							
											<description><![CDATA[<p><img alt="Progress Bar" target="_new" src="/blog/upload/j/h/jhaywood.com/c8baa76675815ccdfcb57cb20907372b.jpg" /></p>
<p>&nbsp;</p>
<p><font face="Verdana">Some time ago I wanted to start getting my head around WPF, and especially how I could integrate tools made with WPF into Max.&nbsp; So I decided to start with something simple, which was to take an existing script that displays a progress bar using standard Max controls and convert it to WPF.<br />
<br />
I'm not going into the details of WPF programming because there's a ton of useful information on the interwebs already.&nbsp; And if you want a good reference book, I can recommend Adam Nathan's &quot;WPF Unleashed&quot; (although you might want to wait for the new version).&nbsp; But the WPF portion of this project is available for download at the bottom of this post.<br />
<br />
A few things to note:<br />
<br />
* The process I'm describing here only works with Max 2010 and up.<br />
<br />
* If using VS 2010 to build your own projects, you'll need to build them using .Net 3.5 since Max doesn&rsquo;t support 4.0 yet.&nbsp; Do this by going to the project properties and changing the Target Framework to &quot;.NET Framework 3.5&quot;.<br />
<br />
* If you don&rsquo;t want to load the VS project, the .dll you'll need is included with the project files in the &ldquo;bin/debug&rdquo; folder.<br />
<br />
So the basic idea is that you create an ElementHost WinForms in either a rollout or MaxForm window, and then put the WPF control inside of that. <br />
</font><font face="Verdana"><br />
<font color="#00ff00">Here's the MaxScript portion needed to create the progress bar in Max...</font> <br />
</font></p>
<p><font face="Courier New">-------------------------------------------------------------------------</font></p>
<p><font face="Courier New">-- load the progress bar library<br />
dotNet.loadAssembly @&quot;&lt;folder location&gt;\ProgressBar\ProgressBar\bin\Debug\ProgressBar.dll&quot;<br />
<br />
-- load the WPF Integration library needed to create the ElementHost control<br />
dotNet.loadAssembly @&quot;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll&quot;<br />
<br />
-- define controls<br />
bar = dotNetObject &quot;ProgressBar.UserControl1&quot;<br />
frm = dotNetObject &quot;MaxCustomControls.MaxForm&quot;<br />
eh = dotNetObject &quot;System.Windows.Forms.Integration.ElementHost&quot;<br />
<br />
-- make controls fill the form window<br />
eh.dock = eh.dock.fill<br />
<br />
-- create form<br />
frm.text = &quot;Progress&quot;<br />
frm.width = bar.width + 16<br />
frm.height = bar.height + 34<br />
frm.startPosition = frm.startPosition.centerScreen<br />
frm.formBorderStyle = frm.formBorderStyle.fixedToolWindow<br />
<br />
-- add ElementHost, which holds the WPF control<br />
frm.controls.Add eh<br />
-- add the WPF control<br />
eh.child = bar<br />
-- open the window<br />
frm.showModeless()<br />
<br />
-- set number of steps to use<br />
bar.steps = 50<br />
<br />
-- loop through the steps<br />
for i = 1 to bar.steps do<br />
(<br />
&nbsp;&nbsp;&nbsp; -- force the UI to update</font><font face="Courier New"><br />
&nbsp;&nbsp;&nbsp; (dotNetClass &quot;System.Windows.Forms.Application&quot;).DoEvents()<br />
&nbsp;&nbsp;&nbsp; -- increment one step and change label<br />
&nbsp;&nbsp;&nbsp; bar.DoStep()<br />
&nbsp;&nbsp;&nbsp; bar.ProgressLabel = &quot;Thing &quot; + i as string<br />
&nbsp;&nbsp;&nbsp; sleep .05<br />
)<br />
<br />
frm.close()</font></p>
<p><font face="Courier New">-------------------------------------------------------------------------</font></p>
<p><font face="Verdana"><font color="#00ff00">And <a href="http://jhaywood.com/blog/progressbar.zip">here</a> is the Visual Studio 2010 project.</font></font><font face="Verdana"><br />
<br />
<font>&lt; Edited to remove the UserControl, which I orginally had to hold the ElementHost, but isn't actually needed. &gt;</font><br />
</font></p>]]></description>
										
											<title><![CDATA[WPF in 3dsMax, Part 1]]></title>
										
											<link><![CDATA[http://apps.jhaywood.com/Blog/?e=49614&d=06/03/2010&s=WPF%20in%203dsMax%2C%20Part%201]]></link>
										
											<guid><![CDATA[http://apps.jhaywood.com/Blog/?e=49614&d=06/03/2010&s=WPF%20in%203dsMax%2C%20Part%201]]></guid>
										
											<pubDate>Thu, 03 Jun 2010 09:39:00 GMT</pubDate>
										
						</item>
					
				</channel>
			</rss>
		
