OptimizeModel | Optimize models and be rid of SpecialMeshes

Introduction

Since 2018, converting SpecialMeshes into MeshParts and changing part shapes has been an absolute pain. It’s very time-consuming and annoying. My OptimizeModel plugin aims to help make it a lot easier.

How It Works

There are 2 sequences to the plugin. The first will create a MeshPart for every SpecialMesh with a FileMesh (SpecialMeshes can also be used to describe part shapes). It will copy every property it can from the original part to the new MeshPart (EXCLUDING MESHID AND TEXTUREID!) and subsequently delete the original part.

:warning: IMPORTANT: Due to Roblox limitations outlined in the link above, OptimizeModel is unable to copy the MeshId and TextureId of FileMesh SpecialMeshes. (More on this in about Sequence 2)

For every non-FileMesh SpecialMesh and BlockMesh, OptimizeModel will simply preserve the original part, change its shape accordingly, and delete the SpecialMesh/BlockMesh.

:information_source: NOTICE: You may notice that your model now has an attribute named “PartlyOptimized”. This is for verification purposes and will be deleted later.

After you have initiated the first sequence, you must copy the MeshIds and TextureIds from each SpecialMesh to its MeshPart. This is because of the limitations outlined above. OptimizeModel makes this easier for you by parenting the SpecialMesh to the MeshPart, from which you can easily copy the two properties. This may take some time, but remember, it would take 10x more to create a replica MeshPart yourself.

:information_source: NOTICE: Your MeshParts may become very large after you paste the MeshIds. Don’t worry, Sequence 2 takes care of that.

After you have done that, you can initiate Sequence 2, which will sweep the model for SpecialMeshes and delete them. It will also multiply the MeshPart’s Size by the SpecialMesh’s Scale, which fixes the massive MeshParts.

Why Use OptimizeModel

Well, really, it’s a no-brainer. Despite the fact it can’t copy MeshIds and TextureIds, it makes your job 10x easier by automating the process of repeatedly creating new MeshParts and copying the other properties. It also takes care of non-FileMesh SpecialMeshes and BlockMeshes with no action required on your part.

Video Tutorial

Install

OptimizeModel.rbxmx (6.9 KB)
(contains source code ig)

Contribute

If you find a bug or want a feature added, please reply to this topic or DM me (DevForum or Roblox).

v1.0.0

5 Likes

Hi, I would really like a video on how it works in the case. That way we will at least understand from the video whether it is worth to install it for yourself, to understand it.

Sure! I’ll get something up soon.

1 Like

The video tutorial has been added.

1 Like

You can use InsertService:CreateMeshPartAsync(), but the TextureId is not read only