CreateMeshPartAsync doesn't flag skinned MeshParts correctly

I’m trying to develop a solution for rojo’s lack of MeshPart live-syncing. Utilizing AssetService:CreateMeshPartAsync appeared to be the right call, and for static meshes it works perfectly!

But right now there’s a problem with skinned meshes. If you try to create a mesh that has skinning data, the HasSkinnedMesh property is always set to false. This is a problem because scripts are not able to modify this property.

Reproducing

SimpleRepro.rbxl (97.0 KB)

In this repro, I have two models that are direct copies of each other, except the one on the right has its MeshId emptied out. Start the place in run-mode, then paste the following code snippet into Roblox Studio’s command bar:

-- Load a new copy of the mesh from the avatar on the left (pretend we don't have this mesh loaded already)
local importedMesh = game.AssetService:CreateMeshPartAsync(workspace.S1.Lola_Geo.MeshId)
importedMesh.TextureID = workspace.S1.Lola_Geo.TextureID

-- Apply it to the avatar on the right:
workspace.S1_Unloaded.Lola_Geo:ApplyMesh(importedMesh)

If done correctly, you should be observing the following:

The rig on the right is stuck because the MeshPart applied to it was not flagged as a skinned mesh. Now imagine someone is trying to reconstruct a skinned MeshPart rig entirely in Luau from scratch. It’s basically impossible at the moment, which is incredibly frustrating.

Expected behavior

CreateMeshPartAsync should correctly mark imported MeshParts as skinned if they can be deformed by bones, and all will be wonderful and swell.


I just want to be able to live sync MeshParts from my file system and store them in GitHub without any friction or problems. This has been an issue for YEARS now and it’s ridiculous :frowning:

7 Likes

I think this could be solved by creating a script that, after importing the mesh, checks to see if it contains appearance data and then manually sets the HasSkinnedMesh property. I think something like that could work

Property can’t be written to by scripts, I mentioned that in the post :frowning:

I hadn’t read that part correctly:

This is a problem because scripts are not able to modify this property

So I don’t know how it could be solved :sweat:

Skinning isn’t supported by MeshAPI yet, sorry about that, but we are working on it!

Just to clarify a little more clearly: I’m not trying to edit the skinning of MeshParts with EditableMesh. I’m simply trying to allow Bone objects to work with an existing mesh asset that has skinning (i.e. by loading the MeshPart through CreateMeshPartAsync)

It doesn’t work right now because the boolean property enabling it to behave as such isn’t being set.

1 Like

I’m going to try flipping a flag for you.

1 Like

It works!
Thanks for the quick turnaround on this :slight_smile:

1 Like