Home Technical Talk

PatJS's big ol' pile of Maxscripts

polycounter lvl 9
Offline / Send Message
PatJS polycounter lvl 9
Hey guys, I've been customizing Max for a couple of years now, and I figured I ought to package up some of my better scripts and release them to the public! Without further ado,
turbosmoothToolsButton.jpg

turbosmoothTools.jpg

Turbosmooth Tools is a batch processing script designed to let you modify Turbosmooth modifiers on a whole pile of objects at once. It also has filters to let you limit the effects to the top modifier on the stack (if it's a TS modifier), the first one it sees on the stack, or (default) all turbosmooth modifiers on the stack.


vertMatchButton.jpg

vertMatch.jpg

VertMatch snaps all selected verts of one object to the verts of another within a specified range threshold. Each vertex is snapped to the closest vertex on the other object.


UVMatchButton.jpg

UVMatchDemo.gif

UVMatch is my implementation of XSI's Match UVs function. It lets you snap selected UV verts, edges, or faces to the unselected vertices of your object. This is super handy when you have stacked UVs and some of them have become desynchronized, or you have a series of similar objects that all need to fit on the same area, but which are not the same size. The tool matches them interactively, so just drag up and down on the threshold spinner and watch it match stuff. If you change your mind about matching things, just zero out the spinner and close the floater.


hippoMatButton.jpg

hippoMat.jpg

HippoMat's a wierd one, but it's super useful. Basically, I wanted to be able to bake diffuse maps and other masks straight off of my high poly, and often this required me to put more than one material on a given high poly object. Unfortunately, this uses MatIDs, meaning that I couldn't take advantage of Max's Matching MatIDs Only feature. The solution was to make a script that automatically UVd high poly models (or sections of them) to one of 16 spots in a grid texture, and then baking a Diffuse map to get my masks. As with all of these, a detailed explanation on how to use it is on the download page, but trust me when I say that for complicated stuff this is way faster than manual material assignment.


modifierDeleterButton.jpg

modifierDeleter.jpg

Modifier Deleter lets you batch delete modifiers from a range of selected objects, using the same logic as Turbosmooth Tools. It's completely generic, so you can delete any modifier you want very quickly. This is super useful when you get files that have modifiers you don't have installed on them, like custom skinning stuff and you just wanna delete that stuff because it's not relevant to you.


bakeShifterButton.jpg

bakeShifter.jpg

BakeShifter was originally meant for shifting objects for baking purposes, but is also useful for laying out modular sets. It will let you move either objects or subobjects by a specific increment along any axis very quickly. It also has multplier buttons (1/4,1/2,1x, and 2x) to speed up fractional movement. Way faster than using the default Max World:Offset F12 thingy.


UVBoundaryEnforcerButton.jpg

UVBoundaryEnforcer.jpg

UV Boundary Enforcer is a QA script designed to batch process a million objects, and determine whether their UVs are outside of the 0-1 space. You can also specify a safety margin, so that you can make sure that nothing is within 2% of the edge or something (super useful when all textures are going to be atlassed onto a megatexture and you don't want a lava texture to MIP bleed onto a character or something, which has happened on a project I worked on!)


I've also got a script called LODVis which is designed to make it easy to preview LODs, but it's pretty project-specific so it's not a very generally usable script. I just threw it up there in case it would make a useful stopgap for somebody until I wrote a more powerful tool.


All scripts are available >>here<<
And have detailed instructions on how to use them on their individual pages.


Let me know if you have any questions, comments, problems, suggestions, or requests! I've left all of these as .mcr files so that people can open them up and see how they tick. I can't claim to be King of the Programmers, so it's not always going to be the best code, but I think it will be informative, especially with regards to some of the various gotchas of Maxscript.

These aren't all of the scripts that I've made for myself, so watch this space, as it's where I will be posting new scripts.

Replies

  • SsSandu_C
    Options
    Offline / Send Message
    SsSandu_C polycounter lvl 13
    Thank you Pat for sharing these. Cheers!
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    UVMatch, how I've missed you!
  • monster
    Options
    Offline / Send Message
    monster polycounter
    Great work man!
  • Pabs
    Options
    Offline / Send Message
    Pabs polycounter lvl 11
    thank you soo much man
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Awesome stuff! Glad to see you got you're problem fixed
  • Mark Dygert
    Options
    Offline / Send Message
    Nice scripts!

    I'll be checking out the VertMatch, UVMatch and BakeShifter the next chance I get.

    I don't know if you're looking for suggestions or requests but for vertMatch it would be great if it also made the vertex numbering (vertex index?) match also =D

    That way if you had identical meshes but they had different vert numbering, like what happens with some imp/exporters (looking at you max obj and zbrush). If people could make two meshes match identically, it would allow people to load/save UV layouts and transfer morphs back and forth, fixing a pretty common problem with objs.

    There was an ancient script that did this (in a pretty convoluted way) called "morphix" but I think it stopped working with newer versions of max...

    Anyway, cool scripts I look forward to checking them out.
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    i concur, thanks a lot for those tools. Will be handy pretty soon
  • PatJS
    Options
    Offline / Send Message
    PatJS polycounter lvl 9
    Thanks guys!

    Perna: the links work for me, can you try again? I'm hoping it's just a transient problem. If it still doesn't work I'll package them up into a zip and put up a dropbox link.

    Mark: That's a good idea, I'll look into getting that to work. I've used morphix before, but as you said it doesn't really work any more.
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    awesome work man, a lot of scripts that will come in handy
    also thank you for releasing them for free to the community
  • wiredhumans
    Options
    Offline / Send Message
    you rock Pat! Thanks for these!
  • seforin
    Options
    Offline / Send Message
    seforin polycounter lvl 17
    Mr.Cakes I read through your HippoMat , and I want to use it, but I am still a little lost on how to utilize it fully, is there any possibility of a little quick vid run down of it?
  • PatJS
    Options
    Offline / Send Message
    PatJS polycounter lvl 9
    Yeah man, I can do that. I probably should have done that to begin with! I've got a pretty busy weekend, but I'll get a video made this week.
  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    Thanks ! Also for not encrypted them. Was planning to do a little turbosmooth toggle tool hehe.
    Btw, you can copy paste uv shells inside the unwrap to stack them (shells that have the same topology, vertices order, so basically attached copies). I know people arent always aware of it.
  • odd_enough
    Options
    Offline / Send Message
    odd_enough polycounter lvl 9
    Those match tools look super handy. Thanks for posting these!
  • Justin Meisse
    Options
    Offline / Send Message
    Justin Meisse polycounter lvl 18
    UVmatch is great but it's very slow, I can drag up the spinner and then sit back and watch as the values slowly move up. This was on about 23 verts in Max 2009
  • PatJS
    Options
    Offline / Send Message
    PatJS polycounter lvl 9
    Hey Justin, you're totally right. I should have tested that guy more, it's the only one I haven't used in production much :/

    I've rewritten it to be a bit faster, though it's still pretty slow. I think I may need to do a C++ plugin for this one; the big problem is that it uses nested loops when checking distance, and the fact that it's an interpreted script is making this process very very slow.

    In the mean time, the latest version is on my site. It's no longer interactive; it works like my vert match script (which, for some reason, is much faster than the UV script despite doing basically the same math).
  • Neox
    Options
    Offline / Send Message
    Neox veteran polycounter
    awesome collection!
    is it possible to get something like this uv match but for actual vertices? Snapping it to the closest vertex. Also either selecting the ones that don't find something within the distance so you can project them onto the surface of the target object or doing the snap onto the surface within the tool

    That'd be super handy.
  • PatJS
    Options
    Offline / Send Message
    PatJS polycounter lvl 9
    Hey Neox, I actually do have something like that already up there, called VertMatch!

    As for the second request, are you talking about something that performs like the Freeform Conform tool? If so, it's definitely possible, though I'd have to do some research first. I actually don't know a whole lot of 3d math, most of these are more like data manipulation than anything else. I'm also probably going to have to make a C++ plugin for performance reasons, which is something I haven't done before so don't expect anything soon, sorry!

    EDIT: ah, looks like there are some ray intersection functions I can use -- I'll play around with these tomorrow and see what I can come up with!
  • Neox
    Options
    Offline / Send Message
    Neox veteran polycounter
    haha o i'm blind i ignored it because it didn't show anything but an interface :D

    well if it does seelect the vertices it couldn't match to the low, i could simply just use conformwrap or any of the other tools to match it, so yeah.
  • PatJS
    Options
    Offline / Send Message
    PatJS polycounter lvl 9
    Hey Neox, I've updated the script to select unmatched vertices! Everyone should redownload it anyways, as I've found a logic error pertaining to the vertex selection that can creep in occasionally.
  • erik!
    Options
    Offline / Send Message
  • PatJS
    Options
    Offline / Send Message
    PatJS polycounter lvl 9
    Erik:
    miss-piggy.jpg

    Neox: I've made a conforming script. I'm going to clean it up a bit, do some testing, and then integrate it into vertmatch!
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    Grabbed the UV Match script, can see that coming in handy.

    Remi also mentioned you used the old TSTools script I made as a base for your version? G;ad to see it still lives on in some form, though hopefully the bugs don't :p
  • PatJS
    Options
    Offline / Send Message
    PatJS polycounter lvl 9
    Aha, so you're the one who made the original! I tried to get your name so that I could credit you with the original concept. I hope you don't mind that I released it, at this point there is none of your code or layout left in the script, it's completely new from the ground up. I'm still going to credit you on my site though!
    vertMatch.jpg

    I've updated VertMatch to add conform functionality, as requested by Neox. It's a tad slow because I'm using the unaccelerated intersection code; the nice voxel-based one keeps returning faces that are out of range, so until I figure out what's going on there this will do. It pops out a progress bar while it works so that you can tell how long you have to wait. I did a conform with a 25x25 grid of vertices against a 1.7m tri mesh on my i5 and it took about 5 seconds, so it's slow but not unworkable.
    vertConform.jpg

    As you can see it ignores verts that aren't within the threshold range. It also respects the all/selected radiobuttons
Sign In or Register to comment.