Jump to content
baroquedub

Can't build due to pb_mesh errors (Failed to create Convex Mesh)

Recommended Posts

I've reopened a project which worked fine (build with no errors) in Unity 5.5.3, now updated to 5.5.4 due to the recent security patch.

Using ProBuilder 2.9.4f1

I've got 'Meshes are assets' turned on in Preferences. Can't remember why it turned it on but I think it's because I was combining meshes after building my level, for optimization. As I said, this all worked fine so I'm not convinced the problem is due to this experimental feature.

All of a sudden I'm getting two errors in the console (both identical except for the mesh names. The build stops and fails on those errors.

Failed to create Convex Mesh from source mesh "pb_Mesh70336". Source mesh is likely have too many smooth surface regions. Please reduce the surface smoothness of the source mesh. Alternatively turn on Inflate Mesh and increase the Skin Width sufficiently for this mesh.
UnityEditor.HostView:OnGUI()

Failed to create Convex Mesh from source mesh "pb_Mesh71416". Source mesh is likely have too many smooth surface regions. Please reduce the surface smoothness of the source mesh. Alternatively turn on Inflate Mesh and increase the Skin Width sufficiently for this mesh.
UnityEditor.HostView:OnGUI()

Ideally I don't want to touch the meshes (they were fine before) not sure why they're suddenly problematic?

However, even if I wanted to try the recommended fix (turn on inflate?, whatever that is) or even just delete and replace these meshes, I don't know where they are in  my scenes. Searching in my project doesn't display pb_Mesh70336 or pb_Mesh71416 assets.

 

Any help, advice would be very much appreciated!

Share this post


Link to post
Share on other sites

I don't think it'd be related to "Meshes are Assets." You'll probably need to find those meshes and either rebuild them or disable the convex collider.
 

Here's a quick editor script that will assist you in finding these meshes. To use, create a new C# script in a folder named "Editor" and paste in these contents. Then run "Tools > ProBuilder > Debug > Find GameObjects with Name."

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;

public class FindGameObjectsWithMesh : EditorWindow
{
	[MenuItem("Tools/ProBuilder/Debug/Find GameObjects with Mesh Name")]
	private static void MenuInit()
	{
		GetWindow<FindGameObjectsWithMesh>(true, "Find GameObjects with Name", true);
	}

	private string m_MeshName = "";
	private MeshFilter[] m_Matches = new MeshFilter[0];

	private void OnGUI()
	{
		m_MeshName = EditorGUILayout.TextField("Mesh", m_MeshName);

		if(GUILayout.Button("Find"))
			m_Matches = Resources.FindObjectsOfTypeAll<MeshFilter>().Where(
				x => x.sharedMesh != null && x.sharedMesh.name.Contains(m_MeshName))
					.ToArray();

		GUILayout.Label("GameObjects with Mesh Name", EditorStyles.boldLabel);

		foreach(MeshFilter mf in m_Matches)
		{
			if(GUILayout.Button(mf.sharedMesh.name))
				EditorGUIUtility.PingObject(mf);
		}
	}
}

 

Share this post


Link to post
Share on other sites

Thanks! That editor utility worked great. Super useful to have on hand.

Turns out the two meshes were in the scene but disabled, so I was able to just delete them and get rid of the errors.

Any ideas why it suddenly started being reported as an error? I hadn't edited the meshes in any way. Is Unity 5.5.4 just more fussy than 5.5.3?

 

btw. this is the first time I've had to get any kind of help or support with a ProBuilder (or any of your other assets) and I'm massively impressed. Having a proper forum, with devs actively monitoring it is for me the sign of a truly top-notch asset. I guess I knew that already from the quality of the asset itself, but having it confirmed by this brilliant support is wonderful. Many thanks and much respect.

Share this post


Link to post
Share on other sites

I'm not sure why Unity decided to start complaining about those meshes with that patch. If it comes up again please let me know, it'd be nice to have an answer as to what causes it for the next time someone asks.

Also thanks for the kind words, I'm glad I could help!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×