Search Unity

Setting Sub Mesh UV's

Discussion in 'Scripting' started by ValrikRobot, Apr 22, 2014.

  1. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Im writing a script to create a mesh via script using submesh. What i don't understand is g=how to set the UV's in the same way. There is no SetUV's like there is for triangles etc
     
  2. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    OK that problem is solved. New problem though, submeshes arent showing up in the scene
     
  3. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
  4. JD3D

    JD3D

    Joined:
    Oct 25, 2012
    Posts:
    9
    How did you solve the issue of the submeshes not showing up? I am having an issue with combining meshes into one single mesh. One mesh has two submeshes and one of the mesh just has one. When I combine them, I get the first submesh of the first mesh and the mesh of the second object, but the second submesh disappears. The instance mesh shows 3 submeshes and has the same vertix count as both separate meshes have in total, so it has to be there somewhere. I am using CombineInstance method to do so.
     
  5. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    In my case, the issue was to do with materials. The number of materials assigned in the Mesh Renderer didn't match the number of submeshes. Once i changed my script to assign the materials as well, problem solved.

    I havn't yet used the CombineInstance method yet, though in the next part of my project it will be quite necessary i do.
     
  6. JD3D

    JD3D

    Joined:
    Oct 25, 2012
    Posts:
    9
    Ah yeah I had that problem early on. I am trying to combine skinned meshed renderers.
    Combine Instance works well overall and my script was working correctly earlier today, but I added in some optimization and now I am getting this problem. Reverting back to my old code isn't working either, so I am lost on how to fix this.
     
  7. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    AH i see. I'm afraid i have never tried scripting meshes for skinned meshes. Really you should start a new thread with this query, here or on Answers. The guys here are awesome and i have no doubt someone here will be able to assist you in this.