<?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>Adventures in Keyframes and Code &#187; UI Design</title>
	<atom:link href="http://www.keyframesandcode.com/code/category/development/maxscript/ui-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.keyframesandcode.com/code</link>
	<description>MaxScript, ActionScript, PHP &#38; JavaScript</description>
	<lastBuildDate>Mon, 30 Aug 2010 15:12:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Progress Bar Updater</title>
		<link>http://www.keyframesandcode.com/code/development/maxscript/progress-bar-updater/</link>
		<comments>http://www.keyframesandcode.com/code/development/maxscript/progress-bar-updater/#comments</comments>
		<pubDate>Thu, 01 May 2008 16:46:49 +0000</pubDate>
		<dc:creator>Dave Stewart</dc:creator>
				<category><![CDATA[For Scripters]]></category>
		<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[UI Design]]></category>

		<guid isPermaLink="false">http://www.keyframesandcode.com/code/uncategorized/progress-bar-updater/</guid>
		<description><![CDATA[Updating a progress bar is fairly simple in conceptual terms, but it always takes a slightly different bit of code to do it right:

What if the sequence is backwards?
What if you&#8217;re incrementing in units of 2, or 3, or 10?
How big is the progress jump?

It makes sense to abstract the process and stick it in [...]]]></description>
			<content:encoded><![CDATA[<p>Updating a progress bar is fairly simple in conceptual terms, but it always takes a slightly different bit of code to do it right:</p>
<ul>
<li>What if the sequence is backwards?</li>
<li>What if you&#8217;re incrementing in units of 2, or 3, or 10?</li>
<li>How big is the progress jump?</li>
</ul>
<p>It makes sense to abstract the process and stick it in a struct. The progressBarUpdater does just that, and really is as simple as:</p>
<ol>
<li>Create a struct instance</li>
<li>Initialize it with a reference to a progress bar, and the known start and end values of the calculation</li>
<li>Call update() for each loop iteration.</li>
</ol>
<p>In code, starting with a 2-line initialization, it looks like this:</p>
<pre>
pbu = progressBarUpdater()
pbu.init pb1 startValue endValue</pre>
<p>And to update the progress bar, this is the <strong>only</strong> command you need to place in the loop:</p>
<pre>
pbu.update()</pre>
<p>The pbUpdater struct already knows everything it needs to know, so it&#8217;s just one call.</p>
<h3>Download</h3>
<p>Download <a href="http://www.keyframesandcode.com/resources/maxscript/For%20Scripters/Progress%20Bar%20Updater/progressBarUpdater.ms">progressBarUpdater.ms</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyframesandcode.com/code/development/maxscript/progress-bar-updater/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UI Manager</title>
		<link>http://www.keyframesandcode.com/code/development/maxscript/rollout-prefs-manager/</link>
		<comments>http://www.keyframesandcode.com/code/development/maxscript/rollout-prefs-manager/#comments</comments>
		<pubDate>Thu, 01 May 2008 00:00:00 +0000</pubDate>
		<dc:creator>Dave Stewart</dc:creator>
				<category><![CDATA[For Scripters]]></category>
		<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[UI Design]]></category>

		<guid isPermaLink="false">http://www.keyframesandcode.com/code/?p=124</guid>
		<description><![CDATA[A struct containing methods to save and load rollout settings, such as size, position, control states, items, etc
to a preferences file, as well as methods to accomplish UI control tasks for example keeping one spinner higher or lower
than another when editing ranges.
Usage
To manage a rollout or dialog, you simply:

create a struct instance
initialize it with a [...]]]></description>
			<content:encoded><![CDATA[<p>A struct containing methods to save and load rollout settings, such as size, position, control states, items, etc<br />
to a preferences file, as well as methods to accomplish UI control tasks for example keeping one spinner higher or lower<br />
than another when editing ranges.</p>
<h3>Usage</h3>
<p>To manage a rollout or dialog, you simply:</p>
<ol>
<li>create a struct instance</li>
<li>initialize it with a reference to a rollout</li>
<li>Manage the rollout by calling the struct&#8217;s methods</li>
</ol>
<p>In code, that&#8217;s as easy as this:</p>
<pre>ui = uiManager()
ui.initialize roTools
ui.loadPosition()</pre>
<p>All settings are saved to an .ini file named after the rollout title, so in this case, an ini file named &#8220;Tools.ini&#8221; would be saved to your max installation&#8217;s <strong>/plugcfg</strong> folder.</p>
<h3>Methods</h3>
<p>This is a work in progress, and will be updated from time to time with new methods.</p>
<blockquote>
<h3>Dialog functions</h3>
<ul>
<li><strong>savePosition </strong>- save the dialog position</li>
<li><strong>loadPosition </strong>- load the dialog position</li>
<li><strong>saveSize </strong>- save the dialog size</li>
<li><strong>loadSize </strong>- restore the dialog size</li>
</ul>
<h3>Rollout functions</h3>
<ul>
<li><strong>autoSizeFloater </strong>- resize the floater to exactly the size of all open rollouts</li>
<li><strong>toggleRollout </strong>- set one or several rollouts open</li>
<li><strong>loadRolloutStates </strong>- save all rolled-up / down states (not yet implemented)</li>
<li><strong>saveRolloutStates </strong>- load all rolled-up / down states (not yet implemented)</li>
</ul>
<h3>Control functions</h3>
<ul>
<li><strong>updateSpinnerPair </strong>- ensure that spinners react as a pair, eg one can never go higher than the other</li>
<li><strong>moveListboxItem</strong> &#8211; move selected Listbox items up or down, and have them remain selected</li>
<li><strong>moveMultiListboxItems</strong> &#8211; move multiple MultiListbox selections up or down, and have them remain selected</li>
<li><strong>getValue </strong>- abstract function to get a control&#8217;s value (not yet implimented)</li>
<li><strong>setValue </strong>- abstract function to set a controls&#8217;s value (not yet implimented)</li>
</ul>
<h3>Preference functions (WIP)</h3>
<ul>
<li><strong>saveValue </strong>- save a control&#8217;s value</li>
<li><strong>loadValue </strong>- load a control&#8217;s value</li>
<li><strong>saveAllValues </strong>- save all controls&#8217; values</li>
<li><strong>loadAllValues </strong>- load all controls&#8217; values</li>
</ul>
</blockquote>
<h3>Downloads</h3>
<p>Download <a href="http://www.keyframesandcode.com/resources/maxscript/UI%20Design/UI%20Manager/uiManager0.52.ms">uiManager0.52.ms</a>. Place in your <strong>scripts/startup</strong> directory, or just include the file when you need it.</p>
<p>These example files will get you started:</p>
<ul>
<li><a href="http://www.keyframesandcode.com/resources/maxscript/UI%20Design/UI%20Manager/uiManager-preferences-example.ms">Preferences functionality</a> &#8211; save and restore a dialog&#8217;s position when re-running a script</li>
<li><a href="http://www.keyframesandcode.com/resources/maxscript/UI%20Design/UI%20Manager/uiManager-floater-example.ms">Floater functionality</a> &#8211; open only selected rollouts, and automatically resize when opening rollouts</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.keyframesandcode.com/code/development/maxscript/rollout-prefs-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveX TreeView Functions</title>
		<link>http://www.keyframesandcode.com/code/development/maxscript/treeview-functions/</link>
		<comments>http://www.keyframesandcode.com/code/development/maxscript/treeview-functions/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 00:00:00 +0000</pubDate>
		<dc:creator>Dave Stewart</dc:creator>
				<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[UI Design]]></category>

		<guid isPermaLink="false">http://www.keyframesandcode.com/code/?p=147</guid>
		<description><![CDATA[This MAXScript entry has not yet been completed&#8230;

A set of functions for manipulating ActiveX Treeviews
]]></description>
			<content:encoded><![CDATA[<p>This MAXScript entry has not yet been completed&#8230;<br />
<span id="more-147"></span><br />
A set of functions for manipulating ActiveX Treeviews</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyframesandcode.com/code/development/maxscript/treeview-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML Help Template</title>
		<link>http://www.keyframesandcode.com/code/development/maxscript/html-help-template/</link>
		<comments>http://www.keyframesandcode.com/code/development/maxscript/html-help-template/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 00:00:00 +0000</pubDate>
		<dc:creator>Dave Stewart</dc:creator>
				<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[UI Design]]></category>

		<guid isPermaLink="false">http://www.keyframesandcode.com/code/?p=125</guid>
		<description><![CDATA[This MAXScript entry has not yet been completed&#8230;

An HTML template for a good-looking help system for your scripts
]]></description>
			<content:encoded><![CDATA[<p>This MAXScript entry has not yet been completed&#8230;<br />
<span id="more-125"></span><br />
An HTML template for a good-looking help system for your scripts</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyframesandcode.com/code/development/maxscript/html-help-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash UI Examples</title>
		<link>http://www.keyframesandcode.com/code/development/maxscript/flash-ui-examples/</link>
		<comments>http://www.keyframesandcode.com/code/development/maxscript/flash-ui-examples/#comments</comments>
		<pubDate>Tue, 30 Aug 2005 00:00:00 +0000</pubDate>
		<dc:creator>Dave Stewart</dc:creator>
				<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[Quoting]]></category>
		<category><![CDATA[UI Design]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.keyframesandcode.com/code/?p=123</guid>
		<description><![CDATA[Flash has always allowed the use of Active X controls in its interface rollouts, and by using Flash&#8217;s FS Commands, you can allow interaction in the Flash interface to affect 3dsmax, and 3dsmax interaction to feedback to Flash. It&#8217;s a really easy way to build rich interfaces within 3dsmax without getting into C++ plugins.
The following [...]]]></description>
			<content:encoded><![CDATA[<p>Flash has always allowed the use of Active X controls in its interface rollouts, and by using Flash&#8217;s FS Commands, you can allow interaction in the Flash interface to affect 3dsmax, and 3dsmax interaction to feedback to Flash. It&#8217;s a really easy way to build rich interfaces within 3dsmax without getting into C++ plugins.</p>
<p>The following demos were all completed from 2002 to 2005 using Flash 4, and its quite basic (by today&#8217;s standards) scripting language. I can&#8217;t even remember if it was called ActionScript then, or was just Flash.</p>
<p>Anyway. Needless to say, if you want to do funky Flash interaction these days you should be looking at .net inside 3dsmax and ActionScript 2 / 3 in Flash using ExternalInterface to provide the communication between the two.</p>
<p>Now for the demos&#8230;</p>
<h3>Axis Control Demo</h3>
<p>This demo basically demonstrates a frame-loop running inside Flash that allows you to drag a joystick-like button to control the animation of a selected object in 3dsmax.</p>
<p>It&#8217;s really interesting to see an object react in realtime in the max viewport, and you can set animation mode on, then play the timeline to record the movement as well.</p>
<p><img src="/resources/maxscript/UI%20Design/flash/axis-control.gif" alt="" style="border:none" /></p>
<h3>Graphing Demo</h3>
<p>This demo shows 2-way communication. The demo maxscript animates a ball, then sends the coordinates to Flash. You can also click the radio buttons to show another view in Flash, and in Flash, click the animation key indicators to start the 3dsmax timeline playing from that point.</p>
<p>It&#8217;s interesting to compare the actual trajectory in the max viewports with the Flash app. With a little more thought I&#8217;m sure some cool stuff could be achieved with this, especially now (late 2009) as we now have proper 3D in Flash.</p>
<p><img src="/resources/maxscript/UI%20Design/flash/graphing.gif" alt="" style="border:none" /></p>
<h3>Character UI Demo</h3>
<p>Probably the most useful demo of the three, this demo is simply to demonstrate how you could build a custom interface within Flash, then use it to select elements in your scene without having to muck about with selection sets, or the scene explorer. In the real world it would probably be written more flexibly, i.e. with XML files and not hard-coding the element names, but you get the idea.</p>
<p><strong>Note: the demo below is actually interactive.<br />
</strong></p>
<div style="margin-left:25px"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="250" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="bgcolor" value="#FFFFFF" /><param name="src" value="/resources/maxscript/UI%20Design/flash/character.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="250" height="360" src="/resources/maxscript/UI%20Design/flash/character.swf" quality="high" bgcolor="#FFFFFF"></embed></object></div>
<h3>Download and installation</h3>
<p>You can download the <a href="/resources/maxscript/UI%20Design/flash/flash-3dsmax.zip">demo files</a> here, and start poking around both the 3dsmax and Flash scripts to see how they work.</p>
<p><strong>In 3dsmax you MUST edit the path to the swf file in each of the scripts before you run them</strong>, or else they simply won&#8217;t work, or you will get errors.</p>
<p>Lastly &#8211; as I said at the top, this would certainly NOT be the way to do it today! But it&#8217;s interesting to think that this sort of thing could be done 7 years ago. Did anyone take advantage of it? Not to my knowledge which is a real shame I think.</p>
<p>If I was still a 3dsmax TD today, I imagine I would be doing this sort of stuff all the time!</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyframesandcode.com/code/development/maxscript/flash-ui-examples/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HTML Interface</title>
		<link>http://www.keyframesandcode.com/code/development/maxscript/html-interface/</link>
		<comments>http://www.keyframesandcode.com/code/development/maxscript/html-interface/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 00:00:00 +0000</pubDate>
		<dc:creator>Dave Stewart</dc:creator>
				<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[UI Design]]></category>

		<guid isPermaLink="false">http://www.keyframesandcode.com/code/?p=121</guid>
		<description><![CDATA[MaxHtml provides methods to run max commands from an ActiveX HTML page. Also, provides simple methods to write back to the page.
Example uses:

Run MaxScript commands as part of a help system
Build a custom UI using HTML / JavaScript

It&#8217;s form is a struct (function library) in conjunction with a JavaScript library. It is designed for programmers [...]]]></description>
			<content:encoded><![CDATA[<p>MaxHtml provides methods to run max commands from an ActiveX HTML page. Also, provides simple methods to write back to the page.</p>
<p>Example uses:</p>
<ul>
<li>Run MaxScript commands as part of a help system</li>
<li>Build a custom UI using HTML / JavaScript</li>
</ul>
<p>It&#8217;s form is a struct (function library) in conjunction with a JavaScript library. It is designed for programmers to use within their scripts.</p>
<h3>Demo UI</h3>
<p><img src="http://www.keyframesandcode.com/resources/maxscript/UI%20Design/MaxHtml/ui/ui.gif" style="border: medium none " height="670" width="577" /></p>
<h3>Functions</h3>
<p>This is just a base set of functions. I may add more at some point.</p>
<table border="0" cellpadding="0" cellspacing="5" width="550">
<tr>
<td>parseUrl</td>
<td>Parse and run the max command from the web page</td>
</tr>
<tr>
<td width="87">addMaxLink</td>
<td width="433">Add a MaxScript link to the web page</td>
</tr>
<tr>
<td>addHtmlLink</td>
<td>Add a normal HTML link to the web page</td>
</tr>
<tr>
<td>setBgColor</td>
<td>Set the background color of the page to the max UI color</td>
</tr>
</table>
<h3>Implementation</h3>
<p><strong>HTML</strong></p>
<ul>
<li>Include maxHtml.js  in your HTML</li>
<li>Construct  your HTML links correctly, e.g. &lt;a href=<em>&#8220;javascript:maxCmd(&#8217;render()&#8217;)&#8221;&gt;render&lt;/a&gt;</em></li>
</ul>
<p><strong>3dsMax</strong></p>
<ul>
<li>Include <em>maxHtml.ms</em> in your MaxScript</li>
<li>Set up the ActiveX browser control to display your html page</li>
<li>Use the control’s <em>BeforeNavigate2</em> event to intercept the links in the web page</li>
<li>Pass the url along to the maxHtml struct like so: <em>maxHtml.parseUrl url</em></li>
</ul>
<p>Explore the demo to see how things work. Be sure to change the path in the top of the demo.ms file to point to towards the html demo file!</p>
<h3>Download</h3>
<p>Download <a href="http://www.keyframesandcode.com/resources/maxscript/UI%20Design/MaxHtml/maxHtml.zip">MaxHtml.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyframesandcode.com/code/development/maxscript/html-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Icons</title>
		<link>http://www.keyframesandcode.com/code/development/maxscript/easy-icons/</link>
		<comments>http://www.keyframesandcode.com/code/development/maxscript/easy-icons/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 00:00:00 +0000</pubDate>
		<dc:creator>Dave Stewart</dc:creator>
				<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[UI Design]]></category>

		<guid isPermaLink="false">http://www.keyframesandcode.com/code/?p=122</guid>
		<description><![CDATA[This MAXScript entry has not yet been completed&#8230;

A range of code-only icons to spice-up your UI and minimize distribution files
]]></description>
			<content:encoded><![CDATA[<p>This MAXScript entry has not yet been completed&#8230;<br />
<span id="more-122"></span><br />
A range of code-only icons to spice-up your UI and minimize distribution files</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyframesandcode.com/code/development/maxscript/easy-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
