Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UV2 blown out when calling ToMesh()

Discussion in 'World Building' started by markgrossnickle, Dec 21, 2018.

  1. markgrossnickle

    markgrossnickle

    Joined:
    Aug 21, 2017
    Posts:
    32
    I am building a mesh via scripts:

    Code (CSharp):
    1. var importer = new pb_MeshImporter(pb);
    2.             var settings = pb_MeshImporter.Settings.Default;
    3.            
    4.             settings.quads = false;
    5.             importer.Import(mesh, mats, settings);
    6.             //pb.ToMesh(MeshTopology.Quads);
    If I uncomment the last line then UV2 will get blown out and will be a copy of UV. I am uncertain what that line does in hindsight so maybe this is intentional behavior? I must have gotten it from an example and thought it was necessary to build the pb_object.

    It seems like a bug to me but I wasn't certain so I thought I'd post here first and see if anyone had insight on what that function does and whether or not it should be wiping out the UV2s.
     
  2. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    ToMesh by design clears the UV2 channel. ProBuilder doesn't currently have the ability to store user-set UV2 channels, they're always generated by the `Optimize` function (available in Editor only).