Maxscript General support Tools


While learning how to make art in 3dsmax, I encountered many repetitive processes and noticed that I’ve been hitting the same button hundreds of times to do the same thing. I feel like I need an automation tool or shortcuts to improve my productivity, so I started self-learning on how to code in maxscript and wrote scripts in my free time.
My tool starts from a small script that help me set pivot of all my modular tiles to a certain spot. As I did more projects, the tool keeps growing because I have more need. After every project I did, I always have a self-reflection section where I asked myself what I did not enjoy and what can be done to make things faster. If there’re already existing technique or scripts that can solve those problems, I'll use those scripts instead of creating a new one. But if there’s none or the existing one does not suit my work style, I'll then write my own.
Although this tool still has limitations and room for improvement and polish, it helps me speeding up things a lot. Some features here also exists in 3dsmax but I modify and put them together in a way that match my own pipeline and work style. For example, the copying pivot function in 3dsmax require 4 clicks to perform (combination of affect pivot only & align tool) but my tool require only 1 click. This might not seem a lot but by imagining having to do these 10 times, it will be 10 clicks vs 40 clicks. This already reduces 75% of workload.
My tool starts from a small script that help me set pivot of all my modular tiles to a certain spot. As I did more projects, the tool keeps growing because I have more need. After every project I did, I always have a self-reflection section where I asked myself what I did not enjoy and what can be done to make things faster. If there’re already existing technique or scripts that can solve those problems, I'll use those scripts instead of creating a new one. But if there’s none or the existing one does not suit my work style, I'll then write my own.
Although this tool still has limitations and room for improvement and polish, it helps me speeding up things a lot. Some features here also exists in 3dsmax but I modify and put them together in a way that match my own pipeline and work style. For example, the copying pivot function in 3dsmax require 4 clicks to perform (combination of affect pivot only & align tool) but my tool require only 1 click. This might not seem a lot but by imagining having to do these 10 times, it will be 10 clicks vs 40 clicks. This already reduces 75% of workload.
Features and future plan
Features:
Future plan:
|
Demo:
Set position of selected objects to (x, y, z) = (0, 0, 0)
Default pivot:
Custom pivot setting:
- Set pivot of the object to center, center top, center bottom, bottom left or bottom right
- Align pivot to world
Custom pivot setting:
- Change pivot of the object based on user preference. The tool can set x, y or z position of the pivot to minimum, center or maximum of the objects.
- Reference object can be the first object in selection list or the last object in selection list based on user setting
- The replace object can be normal copied or instance copied from the reference object based on user setting
- “Keep ‘Copy’ Object Rotation” is used to make the replaced object remain its original rotation for "copy" mode
- Reference object can be the first object in selection list or the last object in selection list based on user setting
- This function only support object with type “EditPoly”. If the object is other type, user need to check the “Convert to EditPoly” check box and the tool will convert them to EditPoly before attaching. This conversion allows the function to support more input object type.
- If reference object has a modifier and no type conversion needed, the modifier will remain.
Detach selected objects by Element or Face
Reference object can be the first object in selection list or the last object in selection list based on user setting
Pivot:
Translation:
Color:
Pivot:
- Copy “Pivot Position” means the tool will copy pivot from the reference object to other selected objects. This means they all will have the same pivot position.
- Copy “Pivot Distance from Center” means the tool will calculate distance between the reference object pivot and the center position of the object. It will then use this distance to set pivot of another selected object to be the same. The user case of this function is for setting identical object pivots to be the same.
Translation:
- Copy “Position” means the tool will copy position from the reference object and set it to other selected objects. This function acts the same way “Align Selection” tool (Align Position (World)) in 3dsmax.
- Copy “Rotation” means the tool will copy rotation from the reference object and set it to other selected objects. This function acts the same way “Align Selection” tool (Align Orientation (Local)) in 3dsmax.
- Copy “Scale” means the tool will copy scale from the reference object and set it to other selected objects. This function acts the same way “Align Selection” tool (Match Scale) in 3dsmax.
Color:
- Copy color from the reference object and set it to other selected objects.
- Export selected objects to individual fbx. The object name will be use as the object file name.
- Without entering any folder name or path, the tool will create a folder called “exportMdl” on the project path and put the exported file there.
- If the path is entered but the folder name is not, the tool will create a folder called “exportMdl” on the entered path and put the exported file there.
- If both the folder name and the path are entered, the tool will create the entered folder name on the entered path and put the exported file there.
- If the folder already exists, the tool will put the exported file in that existed folder.
- The tool allows user to add prefix to the exported file name by typing word into “Prefix” section. For example object name = ‘model1’ and prefix = ‘town’ will give the output file name as ‘town_model1’
- The “pop up” check box let user choose whether to see the export pop up while export.
- If it’s checked, the pop up that contain export setting will come up before exporting every model. In this case if the exported model already exists in the output path, the warning message for file replace will pop up too.
- If it’s unchecked, the pop up that contain export setting will not come up and 3dsmax will use its default setting for every export file. In this case if the exported model already exists in the output path, the tool will replace the file without giving any warning.
- Select objects by matching input keyword with object name
- “Contain” option searches for object name that contain the input keyword. This is not case sensitive.
- “Perfect match” option searches for object name that perfectly matches the input keyword. This is case sensitive.
- “Match Pattern” option searches for object name that match the input pattern. For more information about how to use matchPattern function, check [Autodesk help page]
Select every instance of the selected object. This function is the same as using Edit>Select Instances in 3dsmax
- Resize UV by adding UVW xform modifier to the selected models.
- “MinSize” is the minimum size that user want the UV to fit into the atlas square. This is the same as adding modifier UVW xform and set the mapping UV tile to (1/MinSize).
- User can select which UV map channel they want to resize. If leaving it empty, channel 1 will be used for default.
- Generate reference block in power of 2
- Generate human size reference block (64*64*192)