Speeding Up your Workflow - Using Scripts to Merge Actions.
4 min read

Speeding Up your Workflow - Using Scripts to Merge Actions.

Optimizing your workflow is a must if you want to be efficient at work. This short guide provides a simple method to achieve this.
Speeding Up your Workflow - Using Scripts to Merge Actions.
Photo by Mike from Pexels

Today's post is a bit more technical but will for sure help more than one out there. I'll use 3Ds Max in this example, but the techniques can be replicated in any modeling software.

While working today, I found myself repeating a set of actions over and over again to clean up a model I was working on. I then remembered a piece of advice I got when I first started modeling. Use shortcuts to speed up your work.

This is something I've been doing for a very long time, ever since I started modeling, but with me being in more management-based positions that didn't require me to be creating art all the time, I became a tad rusty when it came to being optimal at work.

So I decided to put an end to that. These are the actions I was constantly repeating:

  • Reset XForm for the model.
  • Apply a modeling material.
  • Reset Normals.
  • Convert to editable poly.

I was doing all of these for the more than a hundred pieces the model was composed of. This model most likely came from somewhere like TurboSquid, and to be honest, it provided a good basic model, but defining it as a clean model wouldn't be too accurate.

Then it hit my head. I could create a script that does this all for me in one click! So it brought me back to the days where I spent 4 days modeling and 1 analyzing my workflow and collapsing all these actions I repeated enough into a single macro.

For this short article, I'll show you how to make them and what you need to keep in mind to make them work for every model out there.

Examining your workflow is the first step required to make the most out of this technique. Find out the actions you do the most and find a way to be faster about them.

In my case, as I described above, my steps looked a bit like this:

So how much did that take, 20 seconds? Multiply that for 100 pieces, and you will have spent 30 minutes just resetting the objects to start working on them.

This is not good, especially when you can automate this process. I'm not an expert in Blender, Maya or Modo, or any other software used for modeling, but I'm sure similar tools exist for them.

If not, these actions are usually nothing but simple scripts that can be called within the software. A short google search will give you the command necessary to do whatever you need in any software. More on this later.

So we have a set of actions that need collapsing into one, but how can we do this? Scripting is here to save the day.

Before you run away, let me explain how effortless it is to put these together. Let's go step by step.

First, you'll need to find the actions you want to batch and their respective script. 3Ds Max provides simple tools like the listener to detect the scripts the software is running, the listener. Accessing it looks a bit like this:

Once you have it open, try doing something, you'll see code appear on the red screen.

Now it's time to run those actions and copy the code that appears on the listener:

My result looks like this:

In case you didn't notice, something is missing here. The listener doesn't always read all your commands. In this case, Reset XForm is missing, so I'll need to find the MaxScript code that actions it.

A quick google search for "Reset XForm Maxscript" gives me the code.

Blurred the image and name to keep the user's privacy.

What I was looking for is "resetxform selection." After testing it and ensuring it worked, I was ready to implement the piece of code to my script, always ensuring it's running in the order I want it to. It ends up looking like this:

After clicking on "Tools" > "Evaluate All" and making sure the script works, I'm ready to drag and drop the code to my toolbar to save a macro for it. I'll name it and save my scene.

After this is done, you are all ready to speed up your workflow!

I hope this short tutorial was somewhat useful to you. If that's the case, let me know in the comments!