First, for anyone running into this thread, the tools are there to work with MeshId via plugin scripts, just not directly via the property.
-
MeshPart:ApplyMesh- Change the geometry of a MeshPart in-place without disrupting physics simulation / game logic that cares about it. -
InsertService:CreateMeshPartAsync- Create a new MeshPart from a given mesh asset. -
Combining these two you can set an existing MeshPart to have an arbitrary MeshId using plugin code.
Rundown on why these exist instead of you just being able to set MeshId:
-
MeshParts actually have internal properties representing their collision data.
-
CreateMeshPartAsync and ApplyMesh are both “atomic” operations which set the MeshId and the internal collision data at the same time.
-
If you could set MeshId directly, the mesh data to create the collision data may not be there right away because it has to be requested from the network.
-
If you save before the data gets there or if the request fails the mesh could end up “torn” with different collision data that doesn’t match the MeshId.
-
Also consider that things get complicated with the size property. Setting the MeshId in the properties pane includes a special affordance to also change the size of the MeshPart, but doing that when setting the MeshId via code isn’t allowed because it’s a property dependency.
There are resolutions to this (including just saying “rare cases of torn meshes are okay”) but they haven’t happened yet.