WerwackFx.com
WkOldStyleLook PDF Email
Nostalgic about the icons set 3dsMax used to have before R 2010?
This script will set back the good old look of the GUI and will allow you to switch from one to each other.
Version:
1.0
Released:
2010/06/25
2010, 2011
3dsMax:



Purpose

Because I find the old icons set clearer and more visually efficient that the one currently provided with 3dsMAx since release 2010, I wrote this little script to install it properly.

There are indeed a few things to care about with how 3dsMax handles icons since R 2010. One of them is that 32 bits BMP format is now the standard, so no need anymore for an additional mask image. Those masks are still supported though and may introduce some mess in the GUI if not properly removed when switching back from the old style look to the current one.


Here is the visual difference between the two sets:


Icons set differences


Script dialog window

The script dialog is quite simple and self explanatory:


Script GUI


Technical notes for Maxscripters

The script works in a quite simple way: we unzip the icons set we what to use and, in the case of the current icons set, we remove the deprecated icons.

Two points worth being noted because they are powerful features that can be used in other scripts: the use of 7zip and the function HiddentDOSCommand.


  • 7Zip:

In order to save some space on the hard drive, I choose to compress the icons sets. We then have 2 x 2.5Mo of data instead of 2 x 17Mo. To do so, I used an open-source free-ware archiver named 7Zip. 7Zip is well documented and works very well in command line.


  • HiddenDOSCommand:

Introduced in 3dsMax 2009, this function not only hide the DOS windows that gets opened when we use DOSCommand, but it also runs synchronously. In that way it goes further than DOSCommand and ShellLaunch. It is especially useful here because it allows the script to wait for the end of the archiving / unarchiving before running the next instructions.


Here is how these features are used in WkOldStyleLook.ms (see highlighted lines):


(...)

fn mfUnarchiveIcons rDataDir rArchiveName rTargetDir =
(
   local lArchiveFileFullName = rDataDir + rArchiveName
   local lbUnarchivingIsOk = false

   local lbSendLogToFile = true

   -- we create the command line to unzip the archive:
   local lCommandsStr = ""
   lCommandsStr += "\"" + mSCRIPTROOTDIR + "7zipA\\7za.exe\" e \"" + lArchiveFileFullName + "\" -o\"" + rTargetDir + "\" -y"

   -- we can choose to redirect the 7zip output to a file, as a log file
   if lbSendLogToFile then lCommandsStr += " > \"" + rDataDir + "log.txt\" \n\r" else lCommandsStr += " \n\r"

   -- we then execute the command to create the archive file. It is very useful to get the exit value of the function HiddenDOSCommand so that we know if everything went well
   local lExitCode = undefined
   HiddenDOSCommand lCommandsStr exitCode:&lExitCode prompt:("Applying icons from " + rArchiveName + "...")

   lbUnarchivingIsOk = 0 == lExitCode
   if lbUnarchivingIsOk then
   messagebox ("Icons set have been successfully applied\n\nYou need to relaunch 3dsMax to see them\n") title:"WkOldStyleLook"
   else messagebox ("A problem occured during the unzipping of the new icons set;\nSee log.txt in the following directory for more information:\n\n" + rDataDir + "\n") title:"WkOldStyleLook Warning"

   return lbUnarchivingIsOk
),


(...)



Last Updated on Tuesday, 30 November 2010 07:53