Anaminus / rbxmk

A tool for processing Roblox files.
MIT License
109 stars 11 forks source link

Converting rbxm to rbxmx using linux tool corrupts unions #61

Closed LabGuy94 closed 2 years ago

LabGuy94 commented 2 years ago

The title says it all, I'm downloading a .rbxm file from roblox and then I'm converting it and when the model gets uploaded again the meshes in the model break.

iUnstable0 commented 2 years ago

I think you meant 'Converting rbxm to rbxmx', RBXMK is a tool name

LabGuy94 commented 2 years ago

using rbxmk run

Anaminus commented 2 years ago
LabGuy94 commented 2 years ago

We are using version 0.8.0 and the first image is what it should look like and the second one is what it looks like at the end. A sample file is also bellow

image

image

Bellow is the RBXM file before converted. https://www.mediafire.com/file/1qnb7fkom7aim7d/HPD.rbxm/file

LabGuy94 commented 2 years ago

And to reproduce I am just converting from rbxm to rbxmx

Anaminus commented 2 years ago

One of the problems here is that the MeshIds aren't loading. They aren't loading because, without a descriptor, any property of the Content type can't properly be converted from rbxm to rbxmx. Supplying an up-to-date descriptor will resolve this part of the issue. The easiest way is to include the --desc-latest flag, which will download and use the latest API dump from Roblox.

Still unresolved are the wheels, which are made out of unions. I'll look into this part.

LabGuy94 commented 2 years ago

Ok thanks!

iUnstable0 commented 2 years ago

I tried with --desc-latest and the mesh still corrupts

iUnstable0 commented 2 years ago

echo 'the code' | ./rbxmk run - --desc-latest

iUnstable0 commented 2 years ago

Screen Shot 2565-03-02 at 11 12 57 PM

Screen Shot 2565-03-02 at 11 14 18 PM

LabGuy94 commented 2 years ago

I agree with this @iUnstable0

Anaminus commented 2 years ago

The flag needs to be added before the file name, or it will be treated as an argument passed to the script. It should look like this:

echo 'the code' | ./rbxmk run --desc-latest -
iUnstable0 commented 2 years ago

Screen Shot 2565-03-03 at 9 15 13 AM It works now, thanks! but some part are missing I guess it's union

LabGuy94 commented 2 years ago

Ive renamed this issue to breaks unions because that is now the current bug

Anaminus commented 2 years ago

It turns out that the issue with unions is the same as with MeshParts. When a union is constructed, an asset is uploaded representing the mesh of the union. In this case, the ID is stored in the hidden "AssetId" property. Once again, the property is incorrectly converted to a string instead of the Content type, resulting in the mesh failing to load.

The problem is that this property is not included in Roblox's API dump. Fortunately, I've anticipated this sort of thing happening, with a system that allows descriptors to be patched with additional data.

Because this will be a common problem, I've produced a patch file that includes missing properties, along with instructions on how to apply it:

https://github.com/Anaminus/rbxmk/tree/imperative/doc/examples/dump-patch

I've confirmed on my end that this fixes the unions failing to load.

LabGuy94 commented 2 years ago

Thank you so much!