I’m working with the Cloud API and have a question in regards to Model uploads (from fbx files).
When I upload the model with the Cloud API, it returns an ID. However, this ID is not a MeshId or a TextureId. It is a “Model”. It contains both the mesh and texture information.
How do I retrieve the MeshId from this Model upload (by its ID)?
Downloads the underlying asset for the given ID, you’ll get a RBXMX document, which is just XML, or RBXM, which will require a library in your given language to parse. From there, you can derive the mesh ID and download that, which will give you the mesh in Roblox’s internal format. (its converted before it hits the content server, so you cant retrieve the FBX)
If it starts with <roblox! it most likely is XML for the texture, but I don’t understand what is required here. There is an easier way of importing a model into studio if you need this:
Hi there, as others in the thread have pointed out, it is not impossible to get the content in our internal binary format (RBXM) and use one of the community reverse-engineered libraries/tools to extract the asset id.
As this is not an officially supported method, I won’t share any direct links, but there are a few projects on github that can achieve this with impressive accuracy.
As for a more supported method, we recently announced the Open Cloud Engine API for Executing Luau which should provide an avenue to extract the information you want in a fully automated way.
You can read the post for the details, but TLDR, this new Open Cloud API lets you execute a Luau script on an official Roblox RCC server from an Open Cloud request. If you want the mesh and texture IDs resulting from an FBX upload returning a Model ID, you could try the following:
Write a Luau Tasks Script that:
Uses InsertService to insert the model by ID
Finds the MeshPart within the Model
Extracts the Mesh and Texture IDs from the MeshPart
Return an object with the two IDs (which will get automatically translated as a json response to the original OC request)
I recognize this is not the simplest process, but if you are familiar with InsertService in other contexts (e.g. Studio), the learning curve here should only be learning the OC API for Luau execution.
One tip: currently, the OC Luau execution API does not support input arguments, so you will need to perform text replacement in the script you are sending to inject the model ID you want to extract the information from.