Scripts

Script: Paint Pot by David Mackenzie

Paint_Pot
Paint_Pot_Crop
Paint_Pot_Crop

Updates!

  • For those of you who are now on Corona I have added the ability to create a Corona materials along with V-Ray and Standard Materials. I do not have a lot experience using Corona so if you run into any trouble please let me know. Version 1.2
  • The Europeans have called and I have answered, I have updated the download below with a new version that includes the RAL paint codes. I also made a another minor change, when you create a material using one the buttons the new material will be named <Brand> - <Paint Name>. You can download the script at the bottom of the page. I am considering including the Pantone library, if I get some interest I will do it. Version 1.1

As a lot of you know, working in visualisation it is not uncommon to be given a very specific design scheme for a project you are working on. Often schemes will include paint codes which is great because you know exactly what you need instead of an architect or designer trying to articulate that exact feature colour...

Unless you have swatches right in front of you with the RGB colour to go with the paint code you will normally look it up online but to be honest, after a while it gets a bit tedious searching through different brands website's looking for the correct RGB colour value for a paint(s). So I created a Paint Pot, which includes a database of around 15000 commonly used paints in Australia (where I live and work). I am not sure if the brands of paints that we use here in Australia are used in the other parts of the world, so Americans and Europeans may not find this tool particularly useful.

The tool itself pretty straight forward, just start typing in a paint code or paint name and you are away. Check out the screencap below to get an idea. Once you have found the paint you like click on it to see a swatch and the RGB values. You can also create a very basic V-Ray material for you as well.

PaintPot
PaintPot

You can download the script here.

If you would like to add the script to a menu copy the script to your /3dsmax/scripts directory and run the code below:

macroScript DANDG_Paint_Pot category:"Daves Tools" tooltip:"Paint Pot" buttontext:"Paint Pot" silentErrors:False ( on execute do ( -- run script local scriptfile = "\\dg_paintPot_public v1.2.mse" if (doesFileExist scriptfile) then( filein ((getdir #scripts) + scriptfile) )else( messageBox ("Could not find script file: " + ((getdir #scripts) + scriptfile)) ) ) )


If you have any other paints you would like added to it and can supply me the paint codes, names and values or a website link I will happily add them to the tool.

As usual if you are using the tool, PLEASE let me know as I am interest where these scripts end up!

Cheers,

Dave

V-Ray Simple Set GI Paths by David Mackenzie

set_gi_paths_feature

Continuing my theme of releasing  simple and useful scripts, I thought I would release this simple tool for quickly setting both Irradiance Map and Light Cache auto save and from file paths. When you are submitting jobs to be rendered this is one of those tedious things that you need to do which lends it self to human error as it is very easy to point a path to the wrong location (we have all done it)... It has a very simple interface, basically you set the path where you would like the GI passes to be saved, type in a name and hit the button. This will set the paths for light cache and Irradiance maps. I have also added some quick options for swapping the modes of GI passes.

The screen shot below should you give you the gist of what is going on.

V-Ray Set GI Paths
V-Ray Set GI Paths

You can download the script here.

This tool was actually extracted from our (Our Vision) custom Network Rendering Submitter I  wrote which basiclly did all of this automatically. It would submit a GI only job and then send the final rendering as a dependant job. This little tool sped up our workflow a great deal.  You can check it out below.

Deadline Quick Submit
Deadline Quick Submit

Oh and for those who have been asking it only works with Deadline from Thinkbox Software. I am planning an entire post related to this tool including some tips for when working with the Deadline scripts.

Cheers,

Dave

Collapse Geometry by David Mackenzie

Collapse
Collapse Geometry
Collapse Geometry

Over the years I have written a bunch of scripts for collapsing geometry, especially since I started working with CAD files more often. I finally had some time to wrap them all up into one interface for easy use.

The collapse tool is very simple to use, you can collapse the selected objects only, by material, layers or an individual layer. Most importantly it has been optimised for collapsing large object counts. A progress bar is displayed so you know Max is still doing something, unlike the standard collapse tool were you often wonder if Max is still working or it has crashed. You can also hit escape to stop as well.

By default it will do a scene hold before the collapsing starts. Max’s undo function is also turned off to increase performance and memory usage. Both of these options can be turned off or on. I am currently adding the option to create a multi sub mat for the collapsed geometry. It is mostly working at the moment but needs further refinement and optimisation before it is released.

You can download the current version here.

As usual if you have suggestions or run into any trouble please post a comment below.

Cheers, Dave

GML Importer Version 2 by David Mackenzie

gml_feature

I will assume most of you know what GML is, if not check out this post I made some time ago here. In the months that have gone passed we have developed three different version of the GML importer. The first version that was featured in a video here, was a basic hack that we used to get a job done. The second version was an expansion of the first while it was a little better it lacked a few important features:

  1. Easily update-able framework.
  2. An "API" or a library of functions to take advantage of in other scripts or tools.
  3. A single unified User Interface that exposes all of the data in the GML File.

So after taking a moment and addressing these issues we created what we believe to be a great tool. It includes a library of code that other 3ds Max TDs and scripters can take advantage of. We choose to focus more on the data and library that goes with it. In it's current form the script will only create a spline shape from the GML file. I will be updating it to include a feature to create proper geometry. We currently have it working by creating a sequence of points and using Delaunay Triangulation to create the surface.

The User Interface

The interface at first glance looks quite complicated, however, it is actually very simple. We wanted to expose everything to the artists so there are quite a lot of UI controls, most of which can easily be tucked away for later use. I was going to document what all of the UI controls do below but since each one has a question mark I'll let you work it out.

GML Importer Version 2
GML Importer Version 2

The Library

We believe simplicity is the ultimate sophistication so we tried to keep everything as simple as possible. Below is a brief run down of the maxscript structs that make up our GML importer.

  • gml_point GML point is a simple struct the stores x, y, z along with t (time) values. If it was not for the t I would had have just used a point3.
  • gml_sketch This struct represents a whole sketch. It is made up of strokes (s_strokes). Each stroke is an array of gml_point()
  • gml_custom_props This struct just stores some custom data that is not from the gml file.
  • gml_header Stores all the information in the header of the GML file. Mainly stores name, username, version and keyword information. This data is reflected in the GUI in the information rollout.
  • gml_enviro This struct holds all of the environment data in the GML file. This includes the canvas size, up vectors and related data. This information is reflected in the GUI in the Environment rollout.
  • gml_document is the guts of everything, its instantiates every one of the above structs. Through this struct you can interact with all facets of a GML file. The struct also provides three methods to create objects and shapes from the data, these are mainly included as examples of what you could do. These functions are  implemented in the GUI. We are currently working on a new method to create geometry that will be included in new updates.

Looking through the gml_data.ms file will give you a good understanding on what is going on. There is a pretty detailed example in the comments showing you how to create gml_documet to sum up the simplicity there is a snippet below:

a = gml_document() a.file = "C:\\18763.gml" a.init() a.createShape()

You can download the GML importer below.

For everyone that has posted and emailed me asking where is the importer? Well it is here now, thank you for your support and let me know how you go. If you create something cool then please send it in. In the spirit of community if you are making this better then lets make it better for everyone! Send in any changes or updates you find. Feel free to posts bugs in the comments below.

Cheers,

Dave

V-Ray Proxy Tools by David Mackenzie

Proxy_Tools
V-Ray Proxy Tools
V-Ray Proxy Tools

Proxy Tools is another one of my most used scripts. It allows you to control the display modes of V-Ray proxies in your scene. This tool has speed up my workflow on large scenes 10 fold. Any scene with large numbers of proxies will benefit from using this tool.

As you can see in the screenshot above their are very few controls. You can easily hide and show proxies as well as change there display mode. If you have suggestions for any additions to Proxy Tools please let me know.

You can download it here.

Hot Box Source by David Mackenzie

Maxscript_Image
Maya Style HotBox for 3dsmax
Maya Style HotBox for 3dsmax

I was recently asked if I could give out the source code to my Hot Box which I have decided to do. I had planned to develop it a lot further but time got the better of me. Starting a new job and jumping straight back into production meant that I had to abandon it. Truth be told I was always going to give away the source. I like to give back to the community that I have learned so much from, however, it was a messy hack and I decided to encrypt it. I have since done quite a lot of work to expand it and I am planning on using it as an interface to all the tools I have written at Our Vision. Unfortunately, I am cannot distribute that to the public I will, however, show some screen shots so you can see what can be done with this kind of interface.

The more I played with the hot box the more I realised that max did not need one. I am sure there are plenty of people who disagree. I do, however, really like this technique for creating an interface for suites of tools.

Feel free to download it below. I would ask that if you use this to create some thing cool or use it in production please let me know. Consider it to be Quoteware.

You can download it here. 

Cheers,

Dave

Select Objects By Material Name by David Mackenzie

AssetManager_Thumb_3

As the name implies this is a simple script for selecting objects based on the name of the material assigned to them. I originally wrote the tool to deal with a sketch up file that was exported for 3ds max. When it came in it had thousands of objects each with their own material, this made it very difficult to work with the file. The script supports wild cards. For example if you have objects with material names like "AC01_GLASS_01", "AC02_GLASS_02" etc. you can drop in wild cards at the start and end such as "*GLASS*". This will select the objects that have "GLASS" in the name of the object's assigned material.

Select Objects By Material Name
Select Objects By Material Name

You can download the script below.

I also wrote another script that works quite well with this one. It makes collapsing geometry a lot easier, faster and more reliable. Anyone who has used the collapse tool with a large object count, knows how much of a pain the ass it can be. I will upload Super Collapse soon.

Cheers,

Dave

As usual if you have any problems, suggestions or comments then please leave them below.

3DS Max Hot Box by David Mackenzie

3ds_hotbox

There are many things I like and dislike about many software packages, one thing I do like is Maya's hot box. Over the years I have often thought it would be great to have a hot box style interface for max. Well lately two things have happened. First I have had some spare time up my sleeve which is very rare. Secondly I got inspired by a video on Script Spot (check it out here) that I thought would solve my hot box lust. As it turned out the project sounds like it is a quite a while off. So I got to work on my own version. At this stage I have just replicated the functionality that was in the video but I have also built an easily expandable framework. The GUI is created entirely on fly dynamically, I am currently adding support for fly out menus. Being that it is all dynamic it will be easy to customise the layouts and functionality in the future. I am unsure whether or not to save the configurations in XML or just write maxscript to a file.

HotBox
HotBox

I would love to here what you all think and if you have any ideas on how this type of interface can be utilised in max then please let me know. I have been using it in its current form and have found it quite useful.

You can download the script here.

You can download the source here.

Please remember this is beta software. Do not be surprised if there are any bugs. Please let me know any issues you do run into.

Why is the script encrypted? Well first off I will be keeping the script free. In time I will make the source available when development has progressed.

Update:

  • 07/09/2010 - New version available it fixes an issue that Max 2011. Users have reported a script error which is raised when trying to run it. This has now been fixed.
  • 31/08/2010 - I have optimised the script and gained more performance. It now shows and hides very quickly without any black ghosting taking place.
  • 31/08/2010 - User reported seeing the interface in black before it moved to the cursor. This has now been fixed. Users may still see some black the first time the hotbox is opened, after that it should be fine. I have also optimised the script so it should show faster.
  • 30/08/2010 - Added a new version label to the UI. Fixed a couple of new bugs.
  • 30/08/2010 - The download is now version 0.04. I have fixed a bug where the UI controls would become unresponsive. I also added some buttons to the center of UI for switching view.
Maya Style HotBox for 3dsmax
Maya Style HotBox for 3dsmax

Cheers,

Dave

Logo Tools - Convert Bitmaps to MXS by David Mackenzie

Maxscript_Image
Logo Tools v1.00
Logo Tools v1.00

Here is a script designed for other script writers. Anyone who has spent some time creating custom images for their scripts and tools know how much of a pain it can be wrapping them for distribution. Logo Tools is designed to make that a little bit easier. It allows you to pick an image and then convert it to a maxscript array so you can embed your bitmap into your script. All of the functions and code required to convert your maxscript array back into a bitmap are included.

This is a very easy, neat and tidy way to package your scripts up. I normally include the code in a install script that writes all of the bitmaps to disk so they can be used again later. If anything ever happens to those images your script has the code to recreate them on the fly.

Logo Tools is very easy to use, just follow the steps below:

  1. Pick an image file that you would like to convert. Do this by clicking the "+" button.
  2. Now pick the file to output again by clicking the "+" button. This file will contain the array representing the bitmap and a code required to convert the array back to a bitmap.
  3. You can now hit the "Make It So" button to get the ball rolling. The progress bars will continue to update until complete.
  4. You can now open the outputted script file which will have the array and a function to create the bitmap already in it.

If you run into any trouble or have any ideas on how I could improve this script please let me know. Feel free to leave a comment below.

To download Logo Tools just click here.

Remember the bigger the image you select the longer it will take and the larger the resulting script file will be.  This script is really designed to handle small logos and button icons that would be added to custom tools. Running the script on a large image will take a long time and the script file will be huge!

I have been asked for an example on how to integrate the images into a GUI control. Below you can download the source for my script (I think some people thing I did not write it??) along with a small example showing how to add an image to a button. I should also mention that the max script help file has excellent resources for working with images and UI controls.

To download Logo Tools source and demo click the link below.

{filelink=5}

Wire Colour Tools by David Mackenzie

WireColourTools_Thumb

Wire Colour Tools is a simple script for setting random wire colours to all of the objects in the scene. Anyone who does allot of post work either in PS or a compositing package should find this script useful. Being able to adjust any element or of your project in post by the object enables you to get the most of your image, rendering Wire Colour passes is very simple and inexpensive from render time point of view.

Wire Colour Tools
Wire Colour Tools

You can download it here.

Wire Colour Tools has three way in which you can use it:

  • Colour By Layer. This sets a random wire colour all of the objects on each layer.
  • Colour By Material. Perhaps the most useful of the three options this one will set all objects wire colour based on the material that is applied to it.
  • Random Colour. This is pretty self explanatory it allows you to set a random wire colour to every object in the scene.

There is also the option to run these only on selected objects.

To install just copy "wireColourTools.ms" to you 3dsmax/Scripts directory and then run "wireColourTools_Macro.mcr". You will then be able to find the script in the Customize User Interface options under the category "Daves Tools".

I hope you find Wire Colour Tools useful. Again if you are doing allot photoshop work on your images I imagine this tool will save you some time.  If you have any suggestions for new features please let me know and I will do my best to get them in there. If you do come across a bug please let me know.

Cheers,

Dave

V-Ray Material Shortcuts by David Mackenzie

Vray Material Shortcuts

These short cuts are really collection of very simple Macro scripts. Like my Turn Viewport Maps On/Off this one has had some serious staying power with artists to date it has to be one of my most used scripts. All of the macros are designed to manipulate V-Ray materials globally throughout the scene, very quickly and efficiently. Each macro effects every V-Ray material in the scene. They are very handy in a number of situations, for example when you get a file from a junior that has the glossy sub divs on every material sky high.

Vray Material Short Cuts Screen Cap
Vray Material Short Cuts Screen Cap

You can download it here.

To install just run the script and all of the macros will be available under the category "Daves Tools" where you can choose to add all or some of them to a menu. I suggest you create a new menu and add them all to it. At the request of my good friend Warwick Hays from Monkey3Media I am currently in the process of creating a GUI version as well that will give artists a lot more control. If you have any suggestions for improvement or there is anything else you would like automated in V-Ray please let me know  I am always looking to expand upon and improve my scripts.

Cheers,

Dave

Turn View Port Maps On/Off by David Mackenzie

Turn View Port Maps On

A simple script that wrote quite some time ago. It seems to have a great deal of staying power as artists continure to use it on a daily basis. It is very simple and only has a few options. At the moment it support standard materials and V-Ray materials including nested Multi Sub-Materials. If there are any other types of materials that you would like me to implement just let me know, even though I may not use them I am more than happy to add them for the sake of completeness.

Turn View Port Maps On/Off Screen Capture
Turn View Port Maps On/Off Screen Capture

I hope it helps you out. If you have any ideas for features to add just leave me a comment.

You can download it here.

To install just copy "TurnViewPortMapsOn.ms" to your 3dsmaxroot/Scripts directory and then run the included macro ("turnViewPortMapsOn_Macro.ms". Once the macro has been run you can find the script under the category "Daves Tools".

Updates:

29/07/2010  I have updated the version for download. Changes include:

  • I have fixed the problem that lead to bump maps not being turned off and on.
  • I have Added support for MR Arch Design material s.

Cheers,

Dave