Wednesday 23 September 2009

Helpful Scripts That Help

One thing that helps a lot when working on environments are handy scripts. I've written a couple that some of us use at work that I thought I'd share and explain a bit about how they save time. We use 3dsmax so these are all macroscripts (except one) that you can bind to a hotkey, saving lots of clicking in the ui by automating some functions and adding some that you couldn't bind to hotkeys. If you want to find more scripts for 3dsmax, Scriptspot is an awesome resource. It's been around for ages and has a huge stack of scripts for almost anything you can think of. Two scripts that I always install wherever I go are Meshtools and CsPolytools, exceptionally useful for modeling, I could live without them but it would be a sad sad world. Now on to the scripts!

Macroscripts

Macroscripts go into the 3dsmax\ui\macroscripts folder. You can find these tools under "Urgaffel"

  • urg_backfacecull.mcr - Toggles backface culling on and off for all selected objects. Usefull when you've imported a bunch of objects and you need to flip them. Also unifies the selection so if some objects are toggled  on and some off, this is a quick way of making them all have the same setting.
  • urg_bridge.mcr - This one is pretty neat if I may say so myself. It allows you to bind the Bridge command to a hotkey and will automatically adjust to the sub-object you are using (edge/border/face) and ignore everything else. For some reason the Bridge command isn't in the hotkey list so a co worker wondered if I could write a script which I gladly did.
  • urg_centerpivot.mcr - Does pretty much what it says, it centeres the pivot on all selected objects.
  • urg_originpivot.mcr - Moves the pivot point of selected objects to the origin, 0,0,0. Can be handy when you are exporting props to a game engine and you want the pivot to be on the "ground"
  • urg_resetxconvert.mcr - Resets x-form on all selected objects and then converts them to editable poly. Saves time when you have been moving, scaling and rotating things and just want a quick reset. Serves a similar function to Mayas Freeze transform if I remember correctly.
  • urg_uvwboxmap4.mcr - Applies a 4m x 4m x 4m box mapping modifier to selected polygons and selected objects. This is very very useful when roughing out an environment and you want to slap some textures on to see what it looks like. In most cases, using a 1024 texture for 4m is ok so you get a consistent pixel density as well. With a little bit of tweaking, you can have near final quality uv mapping in no time.
Script... Script

This particular script goes into 3dsmax\scripts\startup. 
  • urg_viewportsettings.ms - The same co worker who I wrote the Bridge script for wanted this little script so that 3dsmax would always start with the same layout and viewport settings. It's a simple script that can be easily adapted to whatever a person would want layout-wise, as long as there is a command for it.
Download the scripts in a tiny zip file here

These are just a few ways that I've tried to save some time by minimizing the ammount of clicking an artist has to do to perform simple, repetitive tasks. Personally I prefer to work with hotkeys since I won't have to hunt around in menus for the tools I need. It lets me keep the focus on the model and have the tools do the work instead of me working to find the tools! I hope you enjoy using them.

The scripts are provided as is and I take no responsibility for anything unexpected that might happen. They've been used in production and we haven't encountered any problems but just in case something does go wrong, please don't sue me :)

6 comments:

  1. can't urg_viewportsettings.ms be accomplished by making the layout you want and saving the file as maxstart.max?

    ReplyDelete
  2. Heavyness; yeah, probably. Back when I wrote this I couldn't remember where to put the maxstart.max so it was easier to just script it :D Might be more commands avaliable via scripting but I'm not sure...

    ReplyDelete
  3. Rodrigo Maldonado29 June 2012 at 17:40

    thanks :D

    ReplyDelete