January 21, 2013
January 9, 2013
August 19, 2012
July 21, 2012
July 17, 2012
Orcs Must Die 2, the latest game I helped create at Robot Entertainment is now available on Steam for pre-order. Orcs Must Die 2 is similar to the first game, but is jam packed with new features! Most importantly online co-op! Thanks for supporting an indie game studio!
March 30, 2012
February 12, 2012
There are 3 ways to dynamically modify a MaxScript UI.
One way to to create all the UI elements you need in order to disable and enable them as needed. (This is the most common method)
A similar method is to use their visible property to turn them off and on.
The most complex way is to generate a maxscript on the fly and use the execute command to create the UI elements.
This script has an example of each method: Martinez_DynamicUI.ms
January 28, 2012
Recently I've been working on a MaxScript project that required a dotNet Treeview and the ability to select multiple items. I was really troubled that the default treeview doesn't support multiselect, only ancient looking check boxes. However, I was happy to find that someone else bumped into this problem and made their solution available. Unfortunately, there were no example on how to use it with MaxScript. Here's how to get it working:
- Step 1 is to download the DLL control from here: http://sourceforge.net/projects/mulsel-treeview/
- Step 2 is to unzip the DLL to a folder you can remember easily. I chose the UserMacro folder. You can get to it quickly by typing the following into the MaxScript Listener:
shelllaunch "$usermacros" ""
- Step 3 is to remove the periods from the file name of the DLL or Max won't load it.
- Step 4 below is an example how to load and use the plugin with MaxScript.
--LOAD THE CUSTOM PLUGIN FIRST
--NOTE THAT THERE ARE NO PERIODS IN THE FILE NAME OF THE DLL
dotnet.loadAssembly ((pathConfig.normalizepath "$usermacros") + "CodersLabWindowsControlsTreeView.dll")
--BASIC MAXSCRIPT ROLLOUT
rollout TreeViewMultiSelect "MultiSelect" width:300 height:200
--THIS IS A BASIC DOTNET TREE VIEW CONTROL
--dotNetControl tv "system.windows.forms.treeView" height:200 width:300
--USE THIS INSTEAD AFTER YOU INSTALL THE DLL
dotNetControl treeviewObjectList "CodersLab.Windows.Controls.treeView" height:192 width:292 pos:[4,4]
on TreeViewMultiSelect open do
--THIS TELLS THE TREEVIEW TO ENABLE MULTISELECT
ms = (dotnetclass "CodersLab.Windows.Controls.TreeViewSelectionMode")
treeviewObjectList.SelectionMode = ms.MultiSelect
--HERE ARE THE OTHER MODES AVAILABLE:
--LETS ADD SOME NODES TO THE TREE VIEW
for obj in objects do
--CREATE A NEW DOTNET TREE NODE
newNode = (dotNetObject "System.Windows.Forms.TreeNode" obj.name)
--ADD IT TO THE TREEVIEW
--OPEN THE ROLLOUT AS A DIALOG
- Step 5 proof that it works!
The only issue I bumped into after replacing the default treeview is that the selectedNode property no longer seems to work. But I replaced it with selectedNodes.item. Note the S in selectedNodes. Leave a comment if this helped!