Ever uploaded an asset from Blender, or one you purchased from online, and every window in your nice new hotel asset, although identical, is uploaded as a seperate mesh? Well, I had this problem, and when you go to switch the MeshIds through studio, the position and size of the mesh are all messed up.
For the more code savvy among you, perhaps you’ve tried doing it with the terminal. Well, no luck, Roblox doesn’t allow you to change MeshIds through scripts.
Introducing: MeshSwitcher!
Demo
Note: The plugin now keeps the names of the meshes that have had their MeshId changed. If this would be useful as a toggle, I may add it in future
MeshSwitcher allows you to select a model, individual MeshParts or even parts with SpecialMeshes inside them, and give a new MeshId to replace with. It will preserve properties and children of the Meshes.
Behind the scenes, the plugin uses a reference mesh (there must be at least one mesh in the selection that already has the desired MeshId), and replaces all of the other meshes with this mesh while carrying over their properties, hierarchy and children.
Also check out:MeshOptimisationTools, which automatically finds identical meshes and replaces the MeshIds without the manual step.
This plugin is great, I didn’t get it but I faced the exact same problem with importing levels created in blender, the draw calls were unbearably high because the FBX importer cant properly make use of instancing . I had to write my own plugin to fix this issue too, but great plugin!
What I basically did is, I wrote a python script that first exports the levels “props”, it will export 1 of each mesh instance as FBX, then you import it with the new FBX import queue.
Then, another python script in blender will be used to create a huge lua table that collects:
Location (Converted to Roblox coordinate system), Rotation Matrix (CFrame.new(x,y,z, R00, R01, R02, R10, R11, R12, R20, R21, R22) so I know how to rotate each prop) and the scale. This is then used to have a roblox script read this table and clone a prop for each time its used and position it to its according position data.
This reduces drawcalls a lot but still requires a lot of work.