Writing .rbxm files

Hey everyone,

.rbxm files are Roblox model files used to store Roblox models. In Roblox Studio, you would make them by selecting something and saving it as a file. You can then load it in from the import model button or by dragging it into the viewport.

I want to know how you can write a .rbxm file outside of Roblox studio. I would like externally in another programming language to create a .rbxm file and store information in there so that a user can use it in Roblox Studio.

Has anyone figured this out already?

.rbxm is binary, unless you understand how to write binary then you can use that, or you can use .rbxmx which is xml

3 Likes

You can use .rbxmx instead of .rbxm which is the same thing, but instead of a binary it is in an xml format.

This is a file type you can export your builds as.

Everything you need to know can be learned by just analyzing these .rbxmx files.

Here is an example of a baseplate:

<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
	<Meta name="ExplicitAutoJoints">true</Meta>
	<External>null</External>
	<External>nil</External>
	<Item class="Part" referent="RBX29AC4E98D5FA4629A3F641FDE153E965">
		<Properties>
			<bool name="Anchored">true</bool>
			<BinaryString name="AttributesSerialize"></BinaryString>
			<float name="BackParamA">-0.5</float>
			<float name="BackParamB">0.5</float>
			<token name="BackSurface">0</token>
			<token name="BackSurfaceInput">0</token>
			<float name="BottomParamA">-0.5</float>
			<float name="BottomParamB">0.5</float>
			<token name="BottomSurface">4</token>
			<token name="BottomSurfaceInput">0</token>
			<CoordinateFrame name="CFrame">
				<X>0</X>
				<Y>-10</Y>
				<Z>0</Z>
				<R00>1</R00>
				<R01>0</R01>
				<R02>0</R02>
				<R10>0</R10>
				<R11>1</R11>
				<R12>0</R12>
				<R20>0</R20>
				<R21>0</R21>
				<R22>1</R22>
			</CoordinateFrame>
			<bool name="CanCollide">true</bool>
			<bool name="CastShadow">true</bool>
			<int name="CollisionGroupId">0</int>
			<Color3uint8 name="Color3uint8">4284702562</Color3uint8>
			<PhysicalProperties name="CustomPhysicalProperties">
				<CustomPhysics>false</CustomPhysics>
			</PhysicalProperties>
			<float name="FrontParamA">-0.5</float>
			<float name="FrontParamB">0.5</float>
			<token name="FrontSurface">0</token>
			<token name="FrontSurfaceInput">0</token>
			<float name="LeftParamA">-0.5</float>
			<float name="LeftParamB">0.5</float>
			<token name="LeftSurface">0</token>
			<token name="LeftSurfaceInput">0</token>
			<bool name="Locked">true</bool>
			<bool name="Massless">false</bool>
			<token name="Material">256</token>
			<string name="Name">Baseplate</string>
			<float name="Reflectance">0</float>
			<float name="RightParamA">-0.5</float>
			<float name="RightParamB">0.5</float>
			<token name="RightSurface">0</token>
			<token name="RightSurfaceInput">0</token>
			<int name="RootPriority">0</int>
			<Vector3 name="RotVelocity">
				<X>0</X>
				<Y>0</Y>
				<Z>0</Z>
			</Vector3>
			<int64 name="SourceAssetId">-1</int64>
			<BinaryString name="Tags"></BinaryString>
			<float name="TopParamA">-0.5</float>
			<float name="TopParamB">0.5</float>
			<token name="TopSurface">3</token>
			<token name="TopSurfaceInput">0</token>
			<float name="Transparency">0</float>
			<Vector3 name="Velocity">
				<X>0</X>
				<Y>0</Y>
				<Z>0</Z>
			</Vector3>
			<token name="formFactorRaw">0</token>
			<token name="shape">1</token>
			<Vector3 name="size">
				<X>512</X>
				<Y>20</Y>
				<Z>512</Z>
			</Vector3>
		</Properties>
	</Item>
</roblox>
5 Likes

If you write to an XML file like that, could you potentially stretch a model and make custom designs in the cube, because when it is read, what is there will get visualized, right?

I’m not sure what you’re asking. The XML is just a format to save the properties of the instance. If can do the exact same things in the property window that you can do by changing the XML file.

EX: You want to change the size. The size is defined by a Vector3 tag with the name size and has 3 sub-elements called X, Y and Z.

<Vector3 name="size">
	<X>1234</X>
	<Y>1111</Y>
	<Z>952</Z>
</Vector3>

Produces a size of Vector3.new(1234, 1111, 952)

3 Likes

Have you tried searching GitHub?

https://github.com/search?q=rbxm

There’s a number of libraries for reading and manipulating Roblox binary files, such as rbxmk by @Anaminus (I believe that allows reading/writing binary files, but I’m sure they’ll correct me if I’m wrong).

4 Likes

@0x6e7367 @SwagMasterAndrew Thanks so much! I completely forgot that there was an xml verison. I saw some other posts talking about it, but when I opened up the .rbxm file, it did look more like binary to me and I was wondering how people did this so quickly.

Xml is so much easier to write. :relieved:

@cxmeels I have tried searching in GitHub, but I didn’t fully know what I was searching for. Thanks for the resources!

2 Likes