Home Technical Talk

UV Relax on an Axis? (Max)

Uly
polycounter lvl 17
Offline / Send Message
Uly polycounter lvl 17
So let's say I have this convenient image that explains my problem.

UVWire.jpg
Basically, after I get a level of distortion I'm comfortable with, I'll stitch the other pieces along the tube/wire into place, and do a relax with pinned corners in the end. Those corners won't be too clean, though, and getting them clean takes a lot of time that could be spent elsewhere.

Is this possible in Max 8? Alternatively, if you any of you know a nice, clean way to get a similar shape having a nice square UV map with a (relatively) small amount of distortion, I'd be all ears. Thanks guys.

Replies

  • Ott
    Offline / Send Message
    Ott polycounter lvl 13
    Start your shape by using a line. But make sure you turn "Generate Mapping Coords" on.

    line1gj1.jpg


    After that, all you need to do is scale the UVs slightly in the Unwrap.


    image2rm9.jpg


    You can use this for any variety of hoses, pipes, wires, etc. You can even use this for a 4-sided cylinder (box) and it will do the unwrapping for you.
  • Uly
    Offline / Send Message
    Uly polycounter lvl 17
    Hey Ott, thanks for taking the time to do that. I've used that feature in renderable splines quite a bit at work, and it is pretty cool. Unfortunately, the wire wasn't completely clean, and needed a few tweaks in an edit poly modifier on top of the spline.

    Relaxing along an axis would come in pretty handy in some other instances, such as border edges along a tiling modular sheet with modeled in details. From what I heard, Maya has a similar feature, but I haven't been working in it for a long time. I'm not sure what it's called there, or if there even is an equivilant in Max. Would be totally awesome if anyone did know, though. : ) hurhurhur
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Maya doesn't have a similar feature. There was a script called WorldSpaceUVLine for Maya which did this, but it was horribly slow and really not user-friendly.
    I wrote a Maya script for work called "uvLineRelax" which is hugely faster, more flexible and friendly than WorldSpaceUVLine, after I wrote a similar thing for Max.
    Unfortunately my Max script was written for work too so I'd have to get clearance to post it, however the Max version wasn't as fast or flexible as the Maya version so I might see if I can improve it for a public release :)

    It does save a hell of a lot of time in a lot of cases (I use it to straighten UV borders while keeping everything perfectly aligned, then use the standard Relax tools preserving borders to keep everything inside nice and even).

    Will see what I can do.
  • Ott
    Offline / Send Message
    Ott polycounter lvl 13
    Can you post a 3d image of the object you are trying to Unwrap? I guess I am still confused as to what it is you are trying to do...might make it easier to understand.
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    MoP wrote: »
    Maya doesn't have a similar feature. There was a script called WorldSpaceUVLine for Maya which did this, but it was horribly slow and really not user-friendly.
    I wrote a Maya script for work called "uvLineRelax" which is hugely faster, more flexible and friendly than WorldSpaceUVLine, after I wrote a similar thing for Max.
    Unfortunately my Max script was written for work too so I'd have to get clearance to post it, however the Max version wasn't as fast or flexible as the Maya version so I might see if I can improve it for a public release :)

    It does save a hell of a lot of time in a lot of cases (I use it to straighten UV borders while keeping everything perfectly aligned, then use the standard Relax tools preserving borders to keep everything inside nice and even).

    Will see what I can do.

    Maya's unfold UV's can constrain the 'relaxing' to U, V, or not at all in the options box.
    I'd love a way to do that in max. I usually end up eyeballing it or exporting to maya then back again. A real pain. I think we'd all be hugely grateful for a max port of your script, MoP :D
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Huh, I didn't realise that, Funky Bunnies. Thanks for the tip, I will try it out and see how it compares!

    My Maya scripting was not in vain, though! It doesn't exactly do what unfold does - it basically "pins" the end-points of the UV line where they currently are, and "relaxes" the rest of the line between them, so you can actually map stuff diagonally perfectly if you want. :)

    It'd be much easier in Max if the unwrap_uvw.getSelectedGeomEdges() command actually worked, unfortunately it always returns "undefined" even if you have a valid setting, so I'm doing stuff my way...
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    OK, done.

    Download UV Line Relax here!

    It's a macroScript definition, so you should only need to run that file once and it will add a new Category to the Customize User Interface drop-down list called "MoP's Tools". I recommend putting it on the right-click quad menu for the Unwrap UVW window for easy access.

    It works on UV vertex or UV edge selections. It does not work on faces (that wouldn't make any sense). It should preserve your selections all the time. It uses the end-points of the line as "anchor" points, so it will only produce a perfectly horizontal/vertical line if the end points are aligned.

    It's got a fair level of error checking, but I wouldn't be surprised if you could break it by, say, running it when you're not actually editing UVWs. Even that should be handled though.

    Warning/error messages are printed to the maxScript listener. I did originally have message boxes popping up but it was getting annoying if you ran it when unwrapping multiple objects at once.

    I recommend you use it in conjunction with MoP's UV Tools, which have "Align U" and "Align V" functionality for straightening out UV selections.

    Ninja edit: Just updated the UVLineRelax script with an early-out fix for cases where the user is trying to relax a loop around geometry capped in a certain way - I will look into actually fixing it later, not sure if it's even possible though.
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    Awesomeness!

    -and thanks for releasing your other stuff too. I'm using an obscenely vanilla max setup
  • Yozora
    Offline / Send Message
    Yozora polycounter lvl 11
    thanks mop! just tested it and its working nicely. The UV aligning and relax scripts in mops tools binded to hotkeys = win.
  • Junkie_XL
    Offline / Send Message
    Junkie_XL polycounter lvl 14
    PolyBoost can do this too I believe.
  • Uly
    Offline / Send Message
    Uly polycounter lvl 17
    Aw Mop. You're such a cool guy, one day I'll bake you some cupcakes. : ) I'm gonna test this out, can't wait! I really appreciate you taking the time to do this. Thanks again!

    Ott: I'll try and get a screenie and PM it to you soon, it wasn't any drastic changes, just significant enough that I had to muss up my UVs. Regardless of the wire, I was very interested in a general way of relaxing on an axis, which is applicable in many different areas. Gonna test out Mop's script!

    Edit: Fuck man, this tool is so good. You saved me a lot of time MoP. <3
Sign In or Register to comment.