Random Rotate Maxscript Version 1.1

The script rotates the selected meshes in any (or any combination of, or all) axis. Just enable one or more of the axises, adjust minimum, maximum values to your liking, press the random rotate button. Check out the gallery for how to install and run the script.

Download Random Rotate

You can use “random rotate” with my “random scale” script for more randomness.

This slideshow requires JavaScript.

Random Material Assigner for Objects with Multiple MaterialIDs

Works on one or multiple object selections. Script detects the materialID count and creates a multi-sub material(s) for the selected object(s), and changes the diffuse channel with a random color. If there is only one materialID on the object, script simply creates a standart material.

Download Random Material Assigner for Objects with MaterialID

As this is a macroscript, after running it, you need to add it to a quad menu, or an icon on a toolbar, or to a menu. Script’s category is “emrahgunduz.com”.

This slideshow requires JavaScript.

Keep these in mind

  • Created materials are named after the object’ own name.
  • Materials in the multi-sub object will be “Standard”.
  • Changes diffuse channel color with a random one.
  • Works only with poly, mesh or patch object. There is no nurbs or basic object support.

Randomly Delete Objects With Maxscript

The script randomly deletes meshes from the selection. As the script depends on the random numbers created by 3dsmax, the percentage can be %0-1 off what you expected. Just select the meshes you want to randomly delete. Enter a percentage, click the Delete button.

Download Random Delete

This slideshow requires JavaScript.

Random Color Maxscript

I hate how wire coloring (default color max assigns to objects when they first created) works in max. After working a few hours, all objects start to appear in lots of colors which really distract me. So, a few months back, I wrote a script to color them in gray. For sharing, I changed the script, added a gui and some improvements.

Download Random Color

This one can randomly color the selected objects in RGB, or simply red, green, blue or a color of gray. If you need to color every object for ObjectID in post processing, you might need something like this.

This slideshow requires JavaScript.

Detach Using Material IDs

This script detaches faces as new objects, using Material ID property of the faces. Most of the cases, matIDs are used to assign multiple materials on one object. Sometimes you might want to detach these as new objects.

Download Detach Using Material IDs Maxscript

It is possible to detach every matID as object, or simply a range, or just one with Min ID and Max ID ranges. If you keep the default settings, every matID becomes a new poly object. The remainder will be a faceless poly, script deletes this poly if this is the case. Naming will be done by adding the ID number at the end of the original name of the selected object (originalname_ID_#). Wirecolor will also be randomly changed. The pivots of the detached objects will be the same as the original object.

Before using the script please keep these in mind :

  • Script only works with polys. If you have a mesh or patch, you’ll need to convert it to poly mesh, or add an “edit poly” modifier on the stack.
  • Do not detach instanced objects, as this will cause deletion of the faces on the instances.
  • For objects with high poly count, it may take some time to process all the faces. I tried the script with a million poly object, it took 30 seconds or something close to detach every matID available. It might be better to detach some of the matID’s by hand, and then using the script.
  • Why is it slow with high poly objects ? There is no method in 3dsmax for detecting the matID count directly. Script goes through every face and count unique matID channels. Then detaches these if desired.

This slideshow requires JavaScript.

Auto Mirror Selected Using a Specific/Picked Object

One of the missing parts of 3ds max is, you can’t find any APIs related to most of the functions. Mirroring is one of them. It has no functions that you can use from maxscript. Just “max mirror” which actually opens the mirror dialog toolbox.

Yet, there is another way for controlling max: dialog monitoring. If you are so tired of selecting objects that needs to be mirrored to a specific object, and selecting or picking that object, plus changing the axis to “use transform center”, this is the script for you.

Download Auto Mirror Script

This script assumes that you’ve an object named MIRROROBJ in the scene, which will be used as the base. The axis of this object will be our transform center. So keep in mind that and before using this script, add your mirror object and move it to anywhere you like.

This slideshow requires JavaScript.

3dsmax : Name An Object From Material Name

This question came a few days ago via a comment. Is it possible to name an object by simply checking the material, and assign that name to the object? Answer is yes, and here is a script that will accomplish this easy task.

A selected object’s material name can be accessed with :
$.material.name

Assigning a name to an object goes like this :
$.name = “MyNewName”

And for a unique name you can use this one :
$.name = uniqueName “MyNewName”

If you’ve got more than one object selected, you can do something like this :

sel = selection as array
count = 1
undo on
  (
    if sel.count > 0 then
    (
      while count <= sel.count do
      (
        select sel[count]
        count += 1
        $.name = uniqueName ($.material.name as String)
      )
    )
)

This will get the material name, and assign it to the object. Plus, it adds an auto incremented number at the end of each name. You can simply delete “uniqueName”, if you do not want this number. Objects can have same names, 3dsmax will not mind.

There is no error caching in this script. If you select an object that is not a member of the mesh class (like lights, cameras, helpers, etc), you might encounter errors.