This plugin is an iteration on the idea behind my previous plugin, MeshSwitcher. It is able to recognise identical meshes by their vertices, and automatically merge them together under a single MeshId. You can use the plugin on any selection, including your entire workspace, and it fully supports undo/redo (ChangeHistoryService) and has detailed error reporting.
Demo
Behind the scenes, this plugin uses the EditableMesh class to gather information on the vertices of the mesh and generate an MD5 hash representing them, allowing fast real-time comparison of meshes. To do this, I used BoatBomberās HashLib module, so thanks go to him.
Additional Functionality
Press 'Download unique meshes' to view the problem meshes
This will place a file in ReplicatedStorage, with the meshes grouped by their identifying hash, i.e. meshes that are the same but appear with different MeshIds.
You can also view the attributes of these meshes to see the āOriginalLocationā of that specific instance of the mesh. This does not place every instance of every mesh ID in the folder for performance reasons, it shows one instance of each MeshId. āOriginalLocationā is intended to help you understand what the mesh is for particularly unidentifiable meshes.
Note: The plugin struggles with meshes that have different orientations built in to the mesh itself, for example, a window on the front of a building and a window on the side of a building will be recognised as identical meshes, as they are, but when the MeshIds are unified, the window on the side of the building will be incorrectly scaled due to the originally uploaded mesh having orientation built into it. The result is a manual step needed rescaling those meshes. This is something I would like to resolve but is difficult to find a solution to, but when I find one it will be built directly into this plugin.
So it checks and fixes for meshes that has been uploaded multiple times thus gaining unique IDs despite being the same mesh. If Iām understanding right.
I assume the chosen meshid is random, it would be nice to receive a list of the ids of duplicate meshes, that way I could archive duplicates from my inventory. (Archiving actively used IDs is my own responsibility)
Yep thatās exactly right. The chosen MeshId is random, yes. I could implement that as an option next to merge duplicates such as āSave MeshIdsā, and output a JSON table into files or something - Iām not sure how easy it is to export files like that but I know DataStore editor does it. The JSON output could easily contain the full paths to all the meshes too if thatās useful.
This is no doubt a useful time saving tool but I question why this plugin is 15 dollars, while its prior edition? was 5. I recognize the work it takes to build these tools but surely a 5 dollar price point would be a lot more accessible to a wider demographic of developers and would be a lot easier to recommend to people.
To be honest, initially I thought this plugin was about merging duplicate vertices. It would be cool to see a plugin on the market that can automatically simplify and optimize mesh topology, once publishing EditableMesh becomes available.
This is a fair point, I may reduce the price in future - the reason for the cost is that itās a very specific mostly niche use case and Iām planning on frequently updating and adding features to it.
For example, fixing the orientation bug because of the orientation meshes were uploaded at is a huge task that Iāll attempt to fix and release as part of this plugin, there being some decent revenue from this helps with that , and relatively speaking the time Iām spending on this even with the price will probably generate at least 10-20x less than working on my games does. Essentially, I want to set this up as a premium plugin that with time will hopefully progress into a larger suite of tools.
@SteadyOn I ran this on an environment that I had already combed through manually and merged duplicate meshes on. It works alright for the most part and does a fine job at actually detecting duplicate meshes ā it found 83 additional duplicates (out of 338 total) that Iād missed. However, thereās a bug in the replacement code.
The system doesnāt seem to detect differences in pivot points/bounding boxes between meshes and so it can end up scaling/orienting replaced meshes incorrectly, since meshes are scaled based on their bounding box.
As an example, these overhead lights end up getting totally mangled because whichever meshes were chosen as the āsourceā meshes had different bounding boxes or pivot points.
Attachment, Joints and Constraints support, requested by @Quenty, this has been tested on a few different models, but may not work perfectly in every case. The plugin will attempt to maintain all of the constraint attachments on things like cars.
Further split out the output file into āDuplicateMeshesā and āNonProblemMeshesā, where the former are meshes that the plugin has identified to be identical with different MeshIds, and the latter meshes where there is only one MeshId for that set of vertices across the game (therefore, not a problem)
Performance & potential negative impact improvement, stupidly, the plugin would previously replace the meshes that were not problematic as well as those that are, this is resolved.
Added support for PivotOffset, to resolve the problem@Rocky28447 encountered
Various fixes for SpecialMeshes breaking the āFix Duplicatesā step, meaning SpecialMeshes should just have their MeshId changed from now on, and not come under any of the MeshPart logic, to fix a problem @dogwarrior24 encountered.
Widget button under plugins now toggles the window, plugin is closed by default. Widget button requested by @Dued1
Improved messaging around problematic messaging, requested by @Dued1
Improved messaging
When there are no duplicate meshes in the selection (i.e. no issues)
When there are duplicate meshes under the same ID, and an opportunity to merge them
Iāve implemented a new checkbox that will attempt to fix orientation and sizing for you, in many cases it works perfectly but in others it will cause small inaccuracies in positioning, that are quite large up close.
Is this happening on everything you try to use the plugin on? I assume thereās something different about these meshes (not to say that the plugin shouldnāt work with them, it should)
Just released an update that should mean meshes that have been processed before do not need to be reprocessed, significantly speeding up running the plugin on selections that it has been run on before. You can check the usage of the plugin in