How to get MeshId from Model upload? (Cloud Assets API)

Hello!

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)?

For example, this model:

has this MeshId:

Is there an API to get this? I cannot find any.

Thanks!

1 Like

https://assetdelivery.roblox.com/v1/asset?id=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)

1 Like

Perfect, thank you. Hopefully they add a newer endpoint for this soon :’)

1 Like

Hey! I’m trying now. I get the binary file downloaded, but cannot seem to parse it as XML or RBXM.

The binary file doesn’t have the version information in the header. Instead, it begins with <roblox! as the header.

I read that it is supposed to contain version information:

I’m able to open the file on Roblox Studio as RBXMX and RBXM. It is a Model that contains a MeshPart inside it.

How do I parse this binary file? Thanks

1 Like

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:

game:GetObjects("rbxassetid://MODELID")[1].Parent = workspace

Run this through the command bar and it puts a meshpart inside wherever you parented it to. Hope this helps…

Cheers,
Edit

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.

I wrote a CLI client for the OC API in Luau that works with the Lune runtime, it should help you get started: GitHub - itsfrank/lune-cloud-luau-client: A client for the Roblox Open Cloud Engine API for Executing Luau written in Luau for Lune
(the announcement for the OC Luau Exec API has a python sample if you prefer to use that).