Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

UV2 blown out when calling ToMesh()

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

  1. markgrossnickle


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

    Code (CSharp):
    1. var importer = new pb_MeshImporter(pb);
    2.             var settings = pb_MeshImporter.Settings.Default;
    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


    Unity Technologies

    Aug 24, 2017
    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).