Note: I have created a pull request here.
Hello,
The editor keeps crashing when I select some meshes in paint mode. Here is how to reproduce this bug:
- Create two instances of the same mesh.
- Go into Paint Mode
- Select the first instance (Ctrl+Alt+Click)
- Select the second instance (Ctrl+Alt+Click)
- Deselect the second instance (Ctrl+Alt+Click)
- Select the second instance again (Ctrl+Alt+Click)
I have been able to fix this by patching the file “Source\Editor\MeshPaint\Private\MeshPaintStaticMeshAdapter.cpp”. I added the following piece of code at line 183. (See the pull request here).
StaticMeshReferencers->NumReferencers--;
//Patch start
StaticMeshReferencers->Referencers.RemoveAllSwap(
[=](const FStaticMeshReferencers::FReferencersInfo& Info)
{
return Info.StaticMeshComponent == this->StaticMeshComponent;
}
);
//Patch end
// If the last reference was removed, restore the body setup for all the mesh components which referenced it.
Basically, it removes references to meshes that were deselected. This way, the check at line 125 will not be triggered next time you select the item. This seems straight-forward enough, but I would like to make sure this has no side effect.
Thank you for your help!