Studio Tips Guide #1 - Converting Models to Meshes

INTRODUCTION
We’ve all heard of using Blender to model objects, and then exporting it and importing it into studio as a mesh. This process helps to reduce part count in games and can improve user experience. Plus alongside this process, you can have relatively high detail with less memory use.

On the other hand in Roblox Studio it’s difficult to recreate the same level of detail without using thousands of parts. What if there was a similar process of exporting and importing that could also improve Studio builds? Here is that guide!

Before we get into exporting, let’s review what parts are, and why they cause problems in high quantities.

Each part contains data which in return takes up memory. Some believe that because of this if you union a part it will reduce the amount of data. This is a MYTH!

  • Unions can help make a model look nicer as it combines the parts and so the materials on them will merge. However that is all it does, it combines the parts.
  • Unions still carry the same amount of data from each individual part.

Now after hearing this, some may be discouraged from creating detailed builds. However, this guide is here to show you a simple and effective way to solve such an issue, using the exporting method.

EXPORTING
First let’s make ourselves a model that we wish to reduce the part count of. Below is a quick ring I made (ignore how bad it looks haha).

ring

This ring 32 parts! It may seem like a low part count, however, these things add up and can cause issues later on.

Now that we have our model make sure to export each “piece” separately. This means if you have a sword you would export the handle separate from the blade. Why? If you export it together it will import as one mesh and you will not be able to change the properties of two separate meshes, but only one.

ring 2

As you can see in this example I select one of the “pieces” that create my ring. I will be exporting this as one object.

To export your selection simple right-click, and find where it says export selection. Click on it and create a folder you want to contain all your objects in so that you can organize it.

You must make sure that when you save the export you save it as a .obj in order to, later on, reimport it back into Studio.

obj

Now repeat these steps with the other pieces you wish to export.

IMPORTING
Once all the pieces are exported you’ll need to insert a meshpart into Workspace so that you can insert the .obj into it and create your mesh.

Once you have your meshpart inserted you’ll need to head to the properties of that meshpart. Once there click the meshid and insert the .obj you wish to replace the part.

meshid
middle insert

When importing it’ll ask you if you wish to load the mesh in the given location. Depending on what you are making you can press yes or no. For objects that contain multiple pieces, I personally prefer pressing yes so that they all load in one area.

Now repeat the same steps for the other meshes. You can simplify this process by duplicating the meshpart and just inserting another .obj file.

Once you do so and you have the full pieces assembled you can now change the properties freely as you wish! CAUTION! Please remeber to anchor your meshes.

As you can see compared to the pieces we reimported the original version contains more parts and more memory.


BENEFITS
Some may wonder why use meshes, what are the other benefits to such a process? Here are some below!

  • Less lag from rendering thousands of parts!
  • You won’t take up as much data.
  • Flexible properties! You can stretch and scale meshes, much more flexible compared to unions.
  • You won’t lose your meshes! This is an issue with unions as it saves to a cloud and so you can get corrupted unions which are near impossible to recover.

Now that you have your meshes you can reap their benefits!

One of the benefits listed is flexible properties. With meshes you can deform them however you wish, meaning that each mesh is a part not a union. That means the mesh has it’s own data that you can freely change.

CONCLUSION
Now let’s recap this guide!

  1. Unions do not equal less memory.
  2. Steps on how to export and import.
  3. Benefits of meshes include: less lag, less data, flexible properties, and no corrupt unions.

Hopefully this guide was able to help both beginners and experienced builders! Exporting and importing is a simple, but often looked over way to reduce lag in games.

45 Likes

As far as I’m aware, all of the internal triangles are still there, even if its now one singular piece. I don’t believe this actually reduces memory, but instead just simplifies a group of parts.

I do already use this as an alternative for unions, which are a complete mess.

However, I wouldn’t do this to reduce memory. You would still need to go into blender and remove all internal triangles.

Still appreciate you sharing this tip. It’s useful, just not to reduce memory.

8 Likes

Ah, thank you so much for you feedback!

I’ll be going back and correcting some misused terms, thank you for pointing it out!

To add on to what KeysOfFate said, unions will delete voxels and faces inside parts, simplifying physics calculations.

I am not entirely sure that what you said about unions not reducing memory is correct? While its true that memory of the parts that constructed the union are certainly present in studio, in game I believe after a union is initially rendered using all its constructor parts, the memory for the parts that made it is deleted.
A quick search on robox’s documentation shows there’s no way to separate a union into its constructor parts on a live game, suggesting that the data for its constructor parts is indeed deleted after an initial render, which from an optimisation stand point would make sense.

Maybe you should clarify that you mean memory the union takes up in studio isn’t reduced. However, on a live game it is.

1 Like

I believe that the belief that unions don’t reduce memory stems from the fact that the system has actually been iterated on and that on older versions of the CSG system that unions were actually overall just as costly and sometimes more costly. Not only is this actually not the case when reusing unions, but updates have drastically improved unions and in many cases it can be faster than parts.

1 Like

I used this technique to convert a model in workspace to a mesh. Worked except instead of the being class = mesh part, properties indicated class = script. This was a problem because I needed to attach bool value to it which does not halt scripts but shows an error, “ bool is not part of “the resting mesh part””
Anybody know why it gave class = script and not mesh part?

Please ignore previous post. I figured it out.:crazy_face:

Very useful!Also,whenever someone makes an topic about optimizing the game,i can give the link of this topic!

1 Like