Search Unity

[Blender] Move vertices and keep shape

Discussion in 'Asset Importing & Exporting' started by AndersMalmgren, Nov 30, 2017.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    HI, Im retargeting a Unity asset store asset to something else. I need to thin it down by moving some vertices. Its not a straight shape but a turn. How can I move the vertices but keep the shape? UV needs to stay intact too

    Here is the asset, I have selected the vertices I want to move

    upload_2017-11-30_13-20-54.png
     
  2. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    I would try G+G.
    Then you can move the vertices along the edges.
     
    AndersMalmgren likes this.
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Yeah I used edge slide it also has a option to preserv UV
     
  4. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Edge slide is what I would likely use. You said you used it, did that work for you or did you mean you tried it and it didn't work out?
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    No right after I asked the question I got it to work :D With edge slide and checking Correct UVs checkbox
     
  6. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    But now the UV2 is messed up, how do I fix that?

    upload_2017-12-1_20-26-20.png

    The shadow from the box is duplicated over the track

    edit: I know about generate UVs in the import, but would like to learn how its proper done through blender
     
  7. SnowInChina

    SnowInChina

    Joined:
    Oct 9, 2012
    Posts:
    204
    the problem is most likely that you created this in blender as a small piece, made uvs for channel 0 & 1 and then duplicated the piece with an array
    now you have 7 duplicates where alle the UVs are stacked upon each other, because they are all copies of the first geometry and this is fine for your uv channel that handles your textures, since you want them to be on top of each other, so every piece looks exactly as the first one
    the problem is the second uv channel, lightmaps need to have a unique uv space and should not overlap (there are cases where you can get away with it, but usually its a nono)

    now there are several ways of fixing this
    first, you could split the track into the original pieces, so you would have 7 seperate objects. this is not really good for performance, but would work

    second, you apply the array modifier in blender and open the uv editor, go to uv channel 2 and unwrap them again.
    depending on wether the geometrie is merged or not you now have either 7 uv chunks layed out or one long uv chunk

    this should fix your problem
     
  8. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hey @SnowInChina . The original asset actually shows the same problem, so its something the author did. But I also made a long straight piece from a single short piece and it shows the same problem. So I will try to apply your fix. But please Im a noob to Blender could you be a little more detailed about the last step "apply the array modifier" and the UV editor. Would save me alot of time. Thanks!
     
  9. SnowInChina

    SnowInChina

    Joined:
    Oct 9, 2012
    Posts:
    204
    okay, i thought you created the asset, but if it was created by someone else, most likely the modifiers are already applied, the only way you could still have not applied modifiers is when you opened a .blend file, all other imported formats do not have any modifiers
    you can check that under the modifier tab (screenshot), there you can also apply them


    instead of writing every step, look at this video how to open the uv editor,
    usually it would be better to take some time and learn the basic functions of any software you want to use, there are a lot of tutorials that cover the basic layout and how to navigate in the programm


    now select the object
    on the second screenshot you can see the selected tab on the right side and below that you should have a list under UV MAPS
    there you need to select the second uv channel
    go into edit mode (tab) and select every vertice (a), then press u and select unwrap
    this should make a new unwrap for uv channel 2

    edit: if you upload the file i can take a quick look at it
     

    Attached Files:

    BrandyStarbrite likes this.
  10. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks bud, will look into this tonight when the kids are asleep :D
     
  11. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I watched the video, learnt alot, thanks!
    I have not yet tried to create my own UV2s but will do that shortly. But I have a more urgent problem.

    I have moved a window to make some variations etc to a warehouse asset I just bought

    Here is the orignal mesh and UV mapping

    upload_2017-12-3_15-16-52.png
    Here I have moved the window and tried to manually adjust uv mapping
    upload_2017-12-3_15-17-23.png

    But offcourse I end up with errors
    upload_2017-12-3_15-18-10.png

    Edge slide does not work with this shape so thats not a solution. @SnowInChina you know what todo here? thanks
     
  12. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    I don't think I've done it, but can't you do "face slide" similar to how you do edge slide?

    **************

    I don't see anything like face slide there. It seems logical that it would just be there.
    *****************

    I guess your problem here isn't moving the verts around so much, rather the UV distortion caused by that movement? That's for sure a more difficult issue to solve. More often than not you have to recreate the texture unless it was originally made a certain(which this one doesn't look to be).
     
    Last edited: Dec 3, 2017
  13. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I fixed it by using the Knife project tool instead. So I didnt move the vertices. INstead I used the wall without window. Created a plane of same size as window and then cut out the window hole. This does not answer my question about UV its rather a work arouind. So if someone know how to retarget the UV i would like to know. Thanks
     
  14. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    If this is for a game asset, I don't think that workaround is going to work. If you were just rendering in Blender it probably would though.
    About retargeting the UVs, I don't think Blender has an easy way to do it. If I'm not mistaken, the Substance Painter program has something like that, but it's probably overkill for this.
     
  15. SnowInChina

    SnowInChina

    Joined:
    Oct 9, 2012
    Posts:
    204
    i am not really sure what you excatly want to achieve
    but i can tell you that edgeslide will not work, because you don't have any suitable edges to slide this on
    you would beed to have two perfectly straight vertical edges to slide the cutout down on them and then you would have the option to move the uv coordinates alongside with it

    if i understand it right you only want to move the window down and change the uv maps so that you dont get any distortion
    for flat objects like this i would go into editmode and press u -> smart uv project (disable dtretch to uv bounds)
    now you have a perfect unwrap with no distortion, bust most likely its not aligned how you want it
    so select everything in the uv editor and rotate it. you can rotate by exact values if you press r (for rotation) and type 90 + enter
    to rotate by 90°, or whatever value you want, -90 would rotate in the opposite direction
    if you need to position it after that you can select everything and move it with g
    if you press g you can enter the axis on which you want to move it after that, like g -> y would move it only on the y axis

    you can even snap to exact pixels, on the bottom is a menu named uv
    check "snap to pixels"
    if the scale of the overall uv chart is wrong, it can be tricky to get it right, since it would always scale to the center and it would be a pain to get it right
    for this you have the 2d cursor
    align the uv shell with one corner on the texture, select the vertice on this corner and press shift+s -> cursor to selected
    now change the rotation/scaling pivot in the bottom bar to 2d cursor (see screenshot)
    select everything and scale by pressing s
    if you have snap to pixels activated you can scale the uv chart pixelperfect onto the texture

    i hope i understood your problem right, all this uv stuff is pretty easy once you understand how it works
     

    Attached Files:

  16. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    It seems to work just fine. But its time consuming. Here I have new walls

    upload_2017-12-3_18-15-18.png
     
  17. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thansk china, will try to wrap (unwrap) my head around that :D
     
  18. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    I guess I was wrong...it must be applying the modifier beforehand export. If it works, go for it.
     
  19. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    End result, pretty proud :D

    upload_2017-12-3_20-50-55.png