Home Technical Talk

Script to align UV shells to model position in world/local space?

polycounter lvl 7
Offline / Send Message
mrgesy polycounter lvl 7
Hey guys. Is it possible to find/create a script that takes unwrapped, randomly rotated UV shells and aligns them in the UV square according to the model's position in 3d space? I can do this by hand by rotating all the UV shells so that if I put a checker map with arrows, they all point/flow in the same direction along the model. Without this, all the arrows would just be pointing in different directions and I can't apply seamless gradients/camouflage to the model. Hope I explained it well.

Replies

  • [Deleted User]
    Options
    Offline / Send Message
    [Deleted User] insane polycounter
    The user and all related content has been deleted.
  • mrgesy
    Options
    Offline / Send Message
    mrgesy polycounter lvl 7
    Sorry, I'm using 3ds max and need maxscript to make this.Here's some images. In the first picture, the shells are rotated the wrong way and I had to rotate them so they all face the same direction in relation to the model's geometry. The shells should be aligned on the X axis. Imagine doing this for over 400 elements. I've been looking for automated ways to accomplish this.
  • mrgesy
    Options
    Offline / Send Message
    mrgesy polycounter lvl 7
    No ideas anybody?
  • Revel
    Options
    Offline / Send Message
    Revel interpolator
    I don't think there is a way though, since the mesh is in 3d space (XYZ coord) and UV is on 2d space (UV coord, if we ignored the W coord), max wouldn't know how to interpret the additional axis.
  • throttlekitty
    Options
    Offline / Send Message
    Does max have a planar UV projection like Maya does, and are all the models as boxy as what you're showing? If so, you could project from the top, mark and unfold the seams and have angled UV shells.
  • mrgesy
    Options
    Offline / Send Message
    mrgesy polycounter lvl 7
    Does max have a planar UV projection like Maya does, and are all the models as boxy as what you're showing? If so, you could project from the top, mark and unfold the seams and have angled UV shells.
    Yeah it does, but the models are complex parts of tanks and sometimes projecting just creates a mess. I usually UV them properly and then rotate them to face the +X axis. At least if I could find a way to align them only on this axis and ignore the other axes, it would be great.
  • throttlekitty
    Options
    Offline / Send Message
    mrgesy said:
    Does max have a planar UV projection like Maya does, and are all the models as boxy as what you're showing? If so, you could project from the top, mark and unfold the seams and have angled UV shells.
    Yeah it does, but the models are complex parts of tanks and sometimes projecting just creates a mess. I usually UV them properly and then rotate them to face the +X axis. At least if I could find a way to align them only on this axis and ignore the other axes, it would be great.
    Yeah that would be a pain. You could try using a projected texture and bake that down, but I gotta ask why having a camo pattern aligned a certain way is important?
  • TheGabmeister
    Options
    Offline / Send Message
    TheGabmeister interpolator
    Hello. I was wondering if there's a way to do this in Maya 2018.6.

    Currently, what I do is I Unfold the shells and then manually align them by either using Orient Shells or Orient Shells to Edges. Afterwards, I check the direction by using a checker map with arrows. Maybe there's a more efficient way of doing this?
Sign In or Register to comment.