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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Error updating 4.6 project to 5.0 version

Discussion in 'Editor & General Support' started by Raybrand, Mar 16, 2015.

  1. Raybrand

    Raybrand

    Joined:
    Feb 6, 2012
    Posts:
    98
    Hi, I just upgraded an old unity 4.6 project to unity 5 and Im getting these 3 new errors that do not occur in my 4.6 version and are preventing me from running my project. Could someone explain to me whats the problem and how to fix it?

    Code (csharp):
    1. Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs(27,74): error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `GetTriangleStrip' and no extension method `GetTriangleStrip' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)
    2. ---------
    3. Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs(152,73): error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `GetTriangleStrip' and no extension method `GetTriangleStrip' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)
    4. ---------
    5. Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs(200,30): error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `SetTriangleStrip' and no extension method `SetTriangleStrip' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    There isn't a GetTriangleStrip in 5.0. There was in 4.x, but it was never documented, and was never meant to be public. You might need to use GetTriangles.
     
  3. Raybrand

    Raybrand

    Joined:
    Feb 6, 2012
    Posts:
    98
    I've gone over the script MeshCombineUtility and I see the variables 'GetTriangleStrip', 'GetTriangles' and 'SetTriangleStrip' but what is it your asking me to do? replace 'GetTriangleStrip' with 'GetTriangles'?

    I have never seen or touched this script before so Im a bit hesitant because I dont want to break anything. What specifically do I have to do please?
     
  4. base4

    base4

    Joined:
    Mar 11, 2015
    Posts:
    30
    Aye that.
    Tough to break it more than "Broken"
     
  5. Raybrand

    Raybrand

    Joined:
    Feb 6, 2012
    Posts:
    98
    I tried edded those 3 lines to

    int curStripCount = 0;//combine.mesh.GetTriangleStrip(combine.subMeshIndex).Length;

    int[] inputstrip = {0,0};//combine.mesh.GetTriangleStrip(combine.subMeshIndex);

    ;// do nothing //mesh.SetTriangleStrip(strip, 0);

    but that just created nearly 600 errors and a lot of other scripts are failing. whats the right way to fix this?
     
  6. Raybrand

    Raybrand

    Joined:
    Feb 6, 2012
    Posts:
    98
    I managed to fix the problem following instructions online, i.e. I literally had to change GetTriangleStrip to GetTriangle and one or two other things.

    One of those other things involved me going into the 'CameraMotionBlurEditor' and commenting out lines 91, 92 and 93. So everything works to my knowledge but I just want to make sure I havent taken out anything essential out or if this is going to bite me in the but later on.
     
  7. Ogeid

    Ogeid

    Joined:
    Apr 16, 2013
    Posts:
    5
    change GetTriangleStrip to GetTriangles