Home Technical Talk

Unwrapping multiple object UV's and stacking

polycounter lvl 11
Offline / Send Message
Progg polycounter lvl 11
I haven't been able to figure out a simpler method for doing this, and it is driving me bananas.... So here is the situation. I am given a scene with some decal cards for grass... easy enough. Except... there are lots, and lots of them. All different shapes and amount of tris but essentially the same sizes overall.

Here is the problem. The cards were not UV'ed when they were laid out. This is specifically why I always UV my things before I place them in the scene, but that was not up to me. Anyways, I need to UV these cards, and the only logical way I can think of to do this is stack the cards in UV space so I can have most, if not all of them, share the same texture. Does anyone know of a simpler way that I can unwrap these suckers (spread all over the place) so that laying them out to share the same UV space wont be as time consuming as shifting each one around and having to hand move every UV on top of each other.

Maybe I am going about this wrong. Any suggestions would be hugely appreciated.

Replies

  • Mark Dygert
    Using max?

    Select them all, apply UVWMap (not UnwrapUVW), set it face and call it a day.
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    No, I'm in Maya unfortunately :( ... Damn that sounds easy. Maybe I will fire Max up and give it a try.
  • kdm3d
    hmmm... another maya vs max thread:)

    seriously though. That would work if all the grass object were ONE quad. The face mapping applies to each individual face, so that one might not work. There are other way of doing it in max though...

    In maya, cant you select them all and do an auto unwrap? Its been a while since I used maya... Or will that acutally lay them out next to each other rather than on top?
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    It will either lay them out next to one another padded in a 1x1 UV space or it will flip them all over the place. Automatic mapping is terrible and really only serves it purpose in a few select instances.
  • kdm3d
    gotcha... yeah... there might be a script somewhere that'll help you out... but thats a doozy...
  • throttlekitty
    Offline / Send Message
    throttlekitty ngon master
    Are the shapes radically different? Transfer Attributes can (sometimes) get you closer to what you need across different shapes.

    Without seeing what you've got going on, I might suggest Based on Camera, then snapping all the lower border uverts to each other, then to the grid, and try a UV Unwrap on the remainder.
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    They aren't too radically different... there are different number of tri's per plane. They aren't just one solid polygon each. I'll post a screenshot in a second.

    They are radically rotated in different angles so a camera based projection isn't going to work.
  • Grimm_Wrecking
    Offline / Send Message
    Grimm_Wrecking polycounter lvl 8
    After UVs select all objs at once and then go to the uv tex editor and (its either)
    ctrl+righclick->layout uvs
    or
    shift+right click->layout uvs
    -- the op box lets you set padding tex size etc- then export from the uv ed a snapshot (old school before psd networks)

    ---nevermind just saw that you're wanting a fast "stack" same thing just set layout uvs to do it individually and itll arrange the stacks a 0-1 individually and stack them one on top of the other.

    As far as the fast unwrap, planar map set to "Best Plane" might work
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    Yeah I have them unwrapped fine. It's the stacking that is the issue since there are so many.
    After UVs select all objs at once and then go to the uv tex editor and (its either)
    ctrl+righclick->layout uvs
    or
    shift+right click->layout uvs
    -- the op box lets you set padding tex size etc- then export from the uv ed a snapshot (old school before psd networks)

    ---nevermind just saw that you're wanting a fast "stack" same thing just set layout uvs to do it individually and itll arrange the stacks a 0-1 individually and stack them one on top of the other.

    As far as the fast unwrap, planar map set to "Best Plane" might work
  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    Is this what you need (select all objects and run)?:

    $objs = `ls -sl -fl`;
    for ($obj in $objs)
    {
    select $obj;
    ConvertSelectionToFaces;
    $buff = `ls -sl -fl`;
    polyProjection -ch 1 -type Planar -ibd on -kir -md b $buff;
    }
    select $objs;
    TextureViewWindow;
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    Yeah, poly that is really close to what I am going for. Thanks

    If they are all pointed in the same "up" direction in world space is there a way to orient them all the same way in the UV editor via a batch command like you posted.. or does that one already do it?

    For example.. the bottom edge of each decal card being the bottom most edge in the UV editor.
  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    so you want to take pre-unwrapped uvs and batch rotate them all to follow their world orientation? That method does it automatically, but should be possible if that's what your looking for.
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    Yeah, exactly. The problem Im having now is your script works awesome for unwrapping them each to fit the UV space, but some are rotated such that the bottom edges in world space (where they would intersect the ground) is rotated 45-120 degrees so that the bottom edge in the editor is actually pointed up or in an opposite direction from down. I was curious if it was possible to have all of the UV shells rotated so their bottom edges correspond to the bottom edge in 3D world space...

    Does that make sense?
  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    Yep, I see what your saying. Easy enough to find the lowest edge on each object, but I'm not sure about how to calculate the uv rotation angle yet, looking into it.
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    How many variations do you have? Like, if there's hundreds of grass objects, but only 3 or 4 variations, you might try isolating those into separate files, UV them however, and then Replace them all throughout the scene? I know Max can do that, I'm sure Maya can too. You may have to batch rename them or something first, I'm not sure.
  • Mark Dygert
    I don't mean to further the "max can do it" debate but I don't know how to get it done in maya and if I suggest how it can be done in max it might help you figure out a way.

    Since they have different face counts and face mapping would map each face, you could remove the defined edges from all but the boarders making them all n-gons or single faces. There are scripts that help with this and ways to remove the longest edges. I can get into specifics if you want to.

    Neil Blevins has a handy little object replacement script. It's not to hard to get an objects placement/alignment and move/align a new object to it through script. Like leechdemon alluded to this could be a better way to rather than trying to unwrap them all. If you have 3-4 variations you could add some simple checks to push the right variation out to the right spot or just do it one variation at a time.

    Lastly if you're stuck and you need to just flat out re-place them manually, Maya has some object painter scripts that are just as good as SoulBurns object painter script.
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    Yeah this is a really tricky situation. I can't touch the model or replace them in the scene, yet uv'ing a zillion grass objects and stacking them when they are so different in shape and tri count looks to be a nightmare for texturing.
Sign In or Register to comment.