Search Unity

Impossible to modify UV2, UV3, UV4 with ProBuilder?

Discussion in 'World Building' started by awardell, Dec 28, 2021.

  1. awardell

    awardell

    Joined:
    Feb 5, 2014
    Posts:
    71
    I'm doing some experimentation with shaders and UVs, and I was hoping ProBuilder would allow me to iterate faster than Blender. Unfortunately, it seems like the 2 channel is read-only and the 3 & 4 channels don't exist. Is there any way to get around this limitation? Surely I can't be the only one who has wanted to edit those channels with ProBuilder...
     
  2. oswin_c

    oswin_c

    Joined:
    Oct 12, 2016
    Posts:
    6
    It is possible, but you need to use the Probuilder API.

    The Probuilder Vertex class does hold properties for UV2, 3, and 4. You can create a custom editor to do this.

    Unfortunately, the implementation is quite limited.

    Any operation such as extrusion will return this data to default. Meaning, you must operate on these last thing.

    Furthermore, the last set of channels (UV5 and up) are not available through the Probuilder API -- only through the Unity mesh API itself. I am running on an older version of Unity and this may have changed since then.


    I created a custom mesh editor that wraps both UnityMesh and Probuilder operations under a single codebase, and performs appropriate conversions, serialization, etc. It applies the UV color to either the Unity mesh or Probuilder mesh, whichever is appropriate, but also saves them in a custom data structure.

    Then after I've made some mesh operations in probuilder, I re-apply the coordinates saved in the custom editor. Unfortunately I have found no way of working with UV5+ in Probuilder.