Is it necessary to enable the “experimental” Meshes as Assets feature in order for PB objects to behave cleanly in prefabs under 2018.3? By “cleanly”, I mean that currently every prefab instance I have that contains a PB object considers itself to have overrides, because the Mesh is different. For example:
No matter how many times I Apply or Revert these overrides, they remain overrides. If I go into Prefab mode, the actual prefab has a different Pb_mesh-xxxx ID.
I’m hesitant to enabled an “Experimental” PB feature though, especially as I don’t know anything about it, or whether there’s a better way for PB objects not to act like overrides in prefabs.
Thanks. Meaning that in some future release of Unity or ProBuilder, Unity will stop telling me that my prefab instance containing PB meshes has overrides due to the PB mesh?
@gabrielw_unity Can you elaborate on what’s happening here? We are seeing issues handling prefabs and prefab instances using Unity 2018.3.5 and ProBuilder 4.04.
It appears that ProBuilder is aggressively regenerating meshes across instances of prefabs, even if they should share the same mesh as the prefab asset. The repro is very simple: create a new PB cube mesh and make it a prefab. Then drag that prefab into a scene. Notice that the mesh on the instance is different than the mesh on the asset, and the instance has been flagged as having an override
This happens whether or not Meshes are Assets is checked. This is odd to me since, digging through the the ProBuilder package source, it appears that Meshes are Assets should be causing ProBuilder to attempt to cache and re-use the same mesh across instances and assets.
This is causing one major issue for us currently, and I’m worried it may be less obviously causing several more.
The obviously apparent issue is that loading a scene containing large ProBuilder meshes takes freaking forever, spending multiple minutes in a call to Prefabs.MergePrefabs() from LoadLevelAsync() – my guess is that all the meshes are being regenerated during deserialization, causing extremely long hangs.
The other issues I’m concerned about are purely hypothetical, but I’m guessing that this could be bloating our application’s memory budgets at runtime. If we have 100 instances of the same ProBuilder prefab, will we be generating 100 identical meshes to store in memory?
If you’re able to shine any light on what is happening here and what possible workarounds are, I’d be very grateful. Right now I don’t know if we’re running into a bug, or if we’re just misunderstanding the way in which ProBuilder is intended to be used. The repro steps I mention feel extremely broken to me, but it’s possible I’m just confused about what is happening under the hood.
One of my coworkers just build a min repro project that confirms that the issue still occurs on 2018.3.10. In the min repro project, it’s really apparently that we’re just generated new meshes all over the place – every time you drag the Cube prefab into a scene, you can see a new mesh asset generated on-disk and added to the ProBuilderMeshCache folder.
Hi! Yep, we see this problem and are working toward a solution. It’s not a quick one, unfortunately. You can use the experimental “Meshes are Assets”, if you like - in fact it’d be great to hear how that works for you!
“Meshes are Assets” works pretty poorly for us. It does the same ‘generate meshes all the dang time’ behavior, with the added fun of writing a new asset to disk and incurring the file I/O costs.
We’ve ended up writing our own code to build out the generated mesh to our own asset cache and delete the ProBuilderMesh script entirely when we’re not actively editing the meshes. It’s a little gross, but it means our scenes load in 5-10 seconds instead of the 10 minutes it was taking before.
Hi, can you clarify “generate meshes all the dang time”? With “Meshes are Assets” (MaA), a new mesh should only be generated once, when the object is created. Are you seeing something different? Thanks!
Drag that prefab into the scene to create an instance
Look at the instance in the inspector and note that it has generated a new mesh asset and overridden the prefab mesh references
Looking at Probuilder’s code, it looks like it attempts to reuse the same mesh across prefab assets and instances if Meshes are Assets is enabled, but for some reason that was not working properly for us.
Is there an ETA on fixing the original problem mentioned in this thread–namely prefabs always thinking PB objects have overrides? It’s making it hard to maintain prefabs and whether they’re up to date.
The fix is first appearing in ProBuilder 4.3.0-preview.2, which should be available within a few hours in Package Manager (make sure you have “Preview Packages Enabled” toggled to “On” to see the update).
Have you guys not published an update to the Changelog for this release? Or is there something going on with docs.unity3d.com that isn’t showing the latest changelogs? The site is still only showing changelog info through
4.3.0-preview.1.
So I tried 4.3.0-preview2 this morning but it doesn’t appear to have addressed the prefab override issue yet. Here’s what I’m seeing for overrides. Going inside the prefab and saving it doesn’t help, as well as applying all changes or reverting all changes.