I’ve been messing with the EditableMesh API for a few weeks now and have already done some exciting things!
Decal Projection
I can create square planar projections on the surface of any MeshPart!
Shape Key Morphing
Directly morphing the vertices of one mesh into another by recording their difference as vectors and interpolating the vertices that changed. Vertices are linked together by their shared UV mapping.
I was even able to hack it into the FaceControls system
API Feedback
I have a few comments that I can make about the API so far.
1. ID collisions exist across multiple EditableMeshes, potentially causing confusion.
When I was working on the Decal Projector there was one bug in my code that had me stumped for a while. I was getting valid ID reads, but sometimes was getting nil for seemingly no reason.
It turned out I was reading data from the wrong EditableMesh and it was giving me data that was sometimes valid because it would collide with an ID in the mesh I was actually trying to use.
If it’s possible, I think the ID ranges should be further scoped to avoid this confusion. I’m guessing there’s a chance it’s impossible because the IDs are actually some integer representation of a byte sequence. I haven’t had a chance to look at how that actually works yet.
2. Converting EditableMeshes into immutable FixedSize Content.
The limit to how many EditableMesh objects can exist at one time is very harsh right now.
I reckon it’s because there’s a lot of memory overhead from all the tracking and I/O bridging needed to make realtime mesh editing possible in a live game, which is fair.
However, we definitely should have some way to convert the EditableMesh into an immutable Content object once we don’t intend to edit the mesh any further (i.e. for decals and other entities that may rapidly accumulate into the dozens)
3. Permissions need to be relaxed.
I’m not the only one who has brought this up so I’d rather not repeat what everyone else has said, but I will say that ultimately the restrictions are moot:
- There is nothing stopping a user from reuploading someone else’s mesh by simply importing it into Roblox Studio, exporting it as a *.obj file, and then reimporting it.
- Roblox’s in-house filemesh format has been publicly reverse engineered up to
version 5.00
. You can just run a proxy server to download the mesh from assetdelivery, pass that binary to the client, decode it as an EditableMesh on the fly, and completely bypass the permission check. - WrapDeformer ignores the permission check entirely