Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Bug Unable to build due to Probuilder, Mesh.Colors is out of bounds error

Discussion in 'World Building' started by ghostaegis, May 4, 2021 at 6:02 PM.

  1. ghostaegis

    ghostaegis

    Joined:
    Dec 1, 2016
    Posts:
    14
    Probuilder is preventing builds by throwing the following error between 30-60 times every time I try to run a build. Any idea on what to do? It's been happening for a while, but now I can't even seem to get around it since updating to 2021.1

    Mesh.colors is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.
    UnityEngine.StackTraceUtility:ExtractStackTrace ()
    UnityEngine.Mesh:SetSizedArrayForChannel (UnityEngine.Rendering.VertexAttribute,UnityEngine.Rendering.VertexAttributeFormat,int,System.Array,int,int,int,UnityEngine.Rendering.MeshUpdateFlags)
    UnityEngine.Mesh:SetArrayForChannel<UnityEngine.Color> (UnityEngine.Rendering.VertexAttribute,UnityEngine.Color[],UnityEngine.Rendering.MeshUpdateFlags)
    UnityEngine.Mesh:set_colors (UnityEngine.Color[])
    UnityEngine.ProBuilder.ProBuilderMesh:RefreshColors () (at Library/PackageCache/com.unity.probuilder@5.0.3/Runtime/Core/ProBuilderMeshFunction.cs:519)
    UnityEngine.ProBuilder.ProBuilderMesh:Refresh (UnityEngine.ProBuilder.RefreshMask) (at Library/PackageCache/com.unity.probuilder@5.0.3/Runtime/Core/ProBuilderMeshFunction.cs:404)
    UnityEngine.ProBuilder.ProBuilderMesh:MakeUnique () (at Library/PackageCache/com.unity.probuilder@5.0.3/Runtime/Core/ProBuilderMeshFunction.cs:358)
    UnityEditor.ProBuilder.EditorUtility:SynchronizeWithMeshFilter (UnityEngine.ProBuilder.ProBuilderMesh) (at Library/PackageCache/com.unity.probuilder@5.0.3/Editor/EditorCore/EditorUtility.cs:226)
    UnityEditor.ProBuilder.UnityScenePostProcessor:OnPostprocessScene () (at Library/PackageCache/com.unity.probuilder@5.0.3/Editor/EditorCore/UnityScenePostProcessor.cs:61)
    System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    System.Reflection.MethodBase:Invoke (object,object[])
    UnityEditor.Build.BuildPipelineInterfaces/AttributeCallbackWrapper:OnProcessScene (UnityEngine.SceneManagement.Scene,UnityEditor.Build.Reporting.BuildReport)
    UnityEditor.Build.BuildPipelineInterfaces/<>c__DisplayClass16_0:<OnSceneProcess>b__1 (UnityEditor.Build.IProcessSceneWithReport)
    UnityEditor.Build.BuildPipelineInterfaces:InvokeCallbackInterfacesPair<UnityEditor.Build.IProcessScene, UnityEditor.Build.IProcessSceneWithReport> (System.Collections.Generic.List`1<UnityEditor.Build.IProcessScene>,System.Action`1<UnityEditor.Build.IProcessScene>,System.Collections.Generic.List`1<UnityEditor.Build.IProcessSceneWithReport>,System.Action`1<UnityEditor.Build.IProcessSceneWithReport>,bool)
    UnityEditor.Build.BuildPipelineInterfaces:OnSceneProcess (UnityEngine.SceneManagement.Scene,UnityEditor.Build.Reporting.BuildReport)
    UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
    UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
    UnityEditor.ShortcutManagement.MenuItemEntryDiscoveryInfo:<.ctor>b__7_0 (UnityEditor.ShortcutManagement.ShortcutArguments)
    UnityEditor.ShortcutManagement.Trigger:HandleKeyEvent (UnityEngine.Event,UnityEditor.ShortcutManagement.IContextManager)
    UnityEditor.ShortcutManagement.ShortcutController:HandleKeyEvent (UnityEngine.Event)
    UnityEditor.ShortcutManagement.ShortcutIntegration:EventHandler ()
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
     
    Last edited: May 6, 2021 at 3:25 PM
  2. ghostaegis

    ghostaegis

    Joined:
    Dec 1, 2016
    Posts:
    14
    This is really a problem, it's totally preventing the ability to build. Is anyone else having this problem? Has anyone found a workaround?
     
  3. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    446
    Try running"Tools/ProBuilder/Rebuild All ProBuilder Objects" in the affected scene.

    If you have filed a bug report for this can you please PM me the fogbugz ID?
     
  4. ghostaegis

    ghostaegis

    Joined:
    Dec 1, 2016
    Posts:
    14
    So I've been doing some testing. The ONLY way to fix this is to use the Rebuild Shared Indexes Cache function on all the Probuilder objects in these scenes (the level is split into 10+ scenes, and they contain thousands of Probuilder objects between them, Probuilder is basically our entire level pipeline).

    However, after running one build, the error returns on the next attempt to run a build and I have to open all the affected scenes and rerun Rebuild Shared Indexes Cache.

    I haven't filed a bug report yet, how do I go about doing that? I can't really include the whole project (it's huge), is there a way I can include only a single scene with the affected meshes without totally breaking all the scripts and stuff in the scene?
     
unityunity