Search Unity

Poll: is "Swap UVs" mesh import setting useful for anyone?

Discussion in 'General Discussion' started by Aras, Mar 10, 2013.

?

Is Swap UVs mesh import setting useful?

  1. Yes! I absolutely need it!

    10 vote(s)
    22.2%
  2. No. I don't use it, or could make my own import postprocessor if needed.

    28 vote(s)
    62.2%
  3. Don't care.

    7 vote(s)
    15.6%
Thread Status:
Not open for further replies.
  1. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Does anyone think "Swap UVs" mesh import setting is useful for anything?

    From what I remember, we've added it years ago back when some 3D packages had broken FBX exporters, and our own importer was worse. These days if you really need the option, you could just as well use a mesh import postprocessor script that swaps the UV channels.


    Why I'm asking... say, hypothetically, we'd want to add support for more than 2 UV sets... then this import option doesn't really make any sense, or has to be replaced with something much more complicated.
     
  2. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I'm probably not the best person to answer, as I'm not a 3d modeler, but I've never had to use it at all. All of my 3d models that I've imported have always come in with UVs. The greater problem was when there weren't any UV coordinates, and when I told Unity to create them, the output would not be accurate. But that doesn't really happen much now anyways, so I'm really not concerned one way or another.
     
  3. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    I haven't ever used it and you can always write a postprocessor that swaps it like you are saying.We already use a postprocesor for many things anyway. To be honest I'm sure most people would rather prefer to have support for more UVs per mesh. I know I would ! :p

    My opinion is that as long as there is another way to achieve this then I don't see why it really needs to stay if its getting in the way of something that would be of great use to everyone.
     
    Last edited: Mar 10, 2013
  4. MarigoldFleur

    MarigoldFleur

    Joined:
    May 12, 2012
    Posts:
    1,353
    Having multiple UV sets would be a godsend.
     
  5. larvantholos

    larvantholos

    Joined:
    Oct 29, 2009
    Posts:
    668
    If you added support for multiple uv sets, this would cease to be a useful. Right now however, sometimes when you lightmap, unity will swap the uv's, and you need to check this to swap them back. Similarly this can happen on import if you have multiple sets of uv's, and unity doesn't pick the one I think it should by default ;)

    Having multiple uv sets as a default would be great, especially and perhaps purely for decaling! I know someone who is working on a fighting game, and using a uv layer for damage would be ideal as well.
     
  6. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    All these to me sound like bugs instead. In the ideal world, Unity would always pick the correct UVs, right?

    Do you have mesh file examples where Unity gets confused which UV is which? I've love bug reports with them, that way we can actually fix it instead of having the checkbox in the UI...
     
  7. Mr.T

    Mr.T

    Joined:
    Jan 1, 2011
    Posts:
    546
    Hey there Aras, always nice to see staff from the Unity development team around here

    I personally have never used Swap UVs myself, so I really cannot comment about its utility.
    As far as multiple UV channels go, I am all for it. That is something that would be very useful for me.

    So, +1 for multiple UVs here
     
  8. MarigoldFleur

    MarigoldFleur

    Joined:
    May 12, 2012
    Posts:
    1,353
    It can be super handy with one of the older... I want to say Blender exporters? I remember it had some pretty severe FBX problems.
     
  9. Mr.T

    Mr.T

    Joined:
    Jan 1, 2011
    Posts:
    546
    I see. By older exporters, do you mean Blender 2.49 and previous?
    I mostly use Blender 2.62 and higher these days
     
  10. MarigoldFleur

    MarigoldFleur

    Joined:
    May 12, 2012
    Posts:
    1,353
    I honestly couldn't say since it's only affected me once before, using somebody else's model. I switched to Maya 2012 a while ago and it's been smooth sailing ever since.
     
  11. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    If you add support for multiple UV sets, would it be a good idea to allow UV set selection whenever there is more than one present? Sounds ideal for lightmaps, etc. even in the current situation.
     
  12. larvantholos

    larvantholos

    Joined:
    Oct 29, 2009
    Posts:
    668
    If I thought at the time this was a bug, I'd have kept some examples around, I guess next time this comes up I'll file a report. Its not exactly uncommon tho, last time I was working with my environment stuff in unity I had a few instances of this. I'll keep it in mind when I ramp up in that area again.
     
  13. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I have used this option on a small number of FBX models that have come out of 3DS Max 10. I don't recall the exact number, but somewhere around 4 or 5 models out of appx 250 models. I voted I "absolutely need it!!!", though I don't feel that strongly. It would be a pain in the backside to figure out which ones needed it, and then put in special cases, though.
     
  14. islanddreamer

    islanddreamer

    Joined:
    Apr 29, 2006
    Posts:
    473
    I've definitely used it in the past with Softimage objects. I'd prefer you not remove this capability.
     
  15. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Do you still have to do this? Is this for all Softimage files (if that's the case... we should just always swap UVs when they come out of Softimage, right), or just some of them?
     
  16. islanddreamer

    islanddreamer

    Joined:
    Apr 29, 2006
    Posts:
    473
    I frankly haven't checked in a while. Since Unity doesn't support Softimage directly, the problem would have been related to FBX. Supporting multiple UV sets would be great, just please don't ask us non-coders to have to come up with more scripts.
     
  17. MarigoldFleur

    MarigoldFleur

    Joined:
    May 12, 2012
    Posts:
    1,353
    So, this is a crazy idea, but what about removing direct support, making a simple script for this and putting it as an optional thing on the Asset Store?

    Or this, yeah.
     
  18. Mr.T

    Mr.T

    Joined:
    Jan 1, 2011
    Posts:
    546
    I wonder if whatever the 'Swap UVs' option does can be extricated in the form of an independent script and put in the community wiki so that those people who still need it will always find it there

    If Swap UVs is the only stumbling block to multiple UVs, then the above solution would be a win win for all of us.

    Also, the other way around would be just fine for me. If there was any way to leave Swap UVs as it is and a way to import multiple UV channels in an independent script, that would be welcome as well.

    I remember trying to find material about getting multiple UVs in unity, and during that trial I failed to find a script for that. There was some talk of using some kind of shader magic to get that but that is beyond my capacity
     
  19. GilesDMiddleton

    GilesDMiddleton

    Joined:
    Aug 12, 2015
    Posts:
    91
    I've just voted to keep - but not sure if it's because of bad geometry or a bug in choosing UV layering.
    But the only way I could get my blend to work was by swapping the UVs. I didn't purposefully add a light map. See zip file here, blend file and textures by nobiax. I let unity load the blend file and import materials, then hook up the textures in a textures folder.

    Note - I've got two UV Maps in blender, one for the rock face and one for the snow top.

    Notice that without UV swap ticked, the rock face is super shiny.

    I also don't hook up specular because it adds lots of noise - not sure if they are incompatible specular/height maps, would be good to have a slider for correcting these.

    (Fixed the following - this was smoothed edges with 90 degree adjacent face - making tiling of this asset look bad).There's another weird issue where the right edge is dark as if it's merging two textures together, yet the materials appear correctly configured in blender! Also I'm sure it's not respected the positioning of my UV maps.
     
    Last edited: Oct 8, 2015
  20. GilesDMiddleton

    GilesDMiddleton

    Joined:
    Aug 12, 2015
    Posts:
    91
    I've just tested a basic cube that had two separate uv maps defined in blender, and this experiences the same problem.
    The only way to import it is to tick the swap UV button, or just use one 'named UV map' area in blender.

    So, I can re-use the same 'named UV map area' to define the points, and just swap different images in the node-editor. But it's not neat to do that in blender in a complex model.I like the separation of concerns of having separate named UV Maps, but is that bad practice? I'm a noob.
     
  21. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606

    @Aras
    Please Please Please Please do not remove this. It was the only way for me to fix some weird Blender UV bug, inside Unity!!!

    Was banging my head against the wall because the UV was fine inside Blender, but screwed up In Unity. This was the fix for my FBX file.
     

    Attached Files:

    • 111.jpg
      111.jpg
      File size:
      459.5 KB
      Views:
      875
  22. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,139
    Aras hasn't replied to this thread in five years.
     
  23. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Well hopefully he reads the mention. :)
     
  24. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,139
    I'm pretty sure that, considering nothing on this front has changed since 2013 at the latest that you have nothing to worry about.
     
    KarlKarl2000 likes this.
  25. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    @Aras
    I say first and foremost we need a UV preview tab in the import preview.
    There is no way to preview UVs in Unity except after light baking.
     
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yep that all goes in the feedback section of the site.
     
Thread Status:
Not open for further replies.