Home Technical Talk

UV Element Unwrapping Maxscript

DavejaVu
null
Offline / Send Message
DavejaVu null
Hi everyone! I've created a simple maxscript to help save myself a lot of time unwrapping boltholes or any other repetitive cylindrical geometry but I would like your help making my script even better. Right now my script just saves me a few steps but I would like to make it so that it covers most of my procedure for unwrapping a lot of similar elements. I run this script once I have an element already selected in the Edit UVWs floater and have set up my Cylinder projection mapping to the right orientation and scale on one of the boltholes in a piece of geometry. Here's the script:

$.modifiers[#unwrap_uvw].mappingMode 2 //Sets the UV projection mode to cylindrical mapping for the selection
$.modifiers[#unwrap_uvw].mappingCenter () //Adjusts the correctly oriented mapping cylinder to the center of the selection
$.modifiers[#unwrap_uvw].mappingMode 0 // Turns off the UV projection mode

I set this to a keyboard shortcut and manually select each of the cylindrical bolthole geometry elements and run the script using the shortcut. I would like to change this script so that I can select a large group of UV elements (the group of boltholes) all at once and have it run through my script for each UV island or element. I can't run the script on the whole group of elements because it would center the mapping gizmo to the center of all the elements and not to the center of each respective element.

I don't have very much experience with Maxscript so I would greatly appreciate your help and feedback!

Sign In or Register to comment.