When using the Babylon export plugin, why does the Babylon file exported with an older version of the plugin have a capacity of only around 10MB, while the file exported with the new version of the plugin is over 300MB? This is one of the issues. Another issue is that the animations in the older version’s file are messed up, and the model is exploding. The new version, aside from the larger file size, has no other problems. I want to know how to reduce the file size when using the new version of the export plugin, similar to the smaller size achieved with the older version.
The fact that the “older” version (which one? please be more specific) is smaller but the animations don’t work might indicate that it wasn’t saving data that is needed for the animations, and we fixed that.
The version I have been using previously is relatively older, and I encountered issues with exporting animations. That’s why I attempted to use a new export plugin. I am not sure of the exact version, but I have the installation file with me, and I have uploaded it for your reference. Please take a look. older-2019.zip (632.5 KB)
Ok, so by this file you’re using the 3DS Max Plugin. From what I know, we won’t know the version with just the dll file you provided. But @PatrickRyan may have tips on how to achieve a smaller file size using the max export.
@lang_l, I agree with what @carolhmj mentioned that the size difference could be that the animations are being correctly written in the file. Without looking directly at the file, though, this is only a guess. If you have a lot of animation data in the file, it could account for the difference. And this isn’t just the number of frames of animation that you have. This also means the number of bones in a skeleton and the number of morph targets you have in your asset. A full character model with viseme morphs and even a modest amount of animation clips would have a significant chunk of the file size being allocated to animation data.
Since you are looking at an older version of the exporter and newer version with the same file, my guess is that animation is likely the culprit. So what can you do about reducing file size?
- Make sure you are only exporting what you need in the file. Hide anything that you don’t want exported and make sure
export hidden objects
is unchecked. - Use
Flatten Hierarchy
option to eliminate any unneeded nodes in your file. - Uncheck
export tangents
and let the engine calculate the tangents of you mesh for you. This could result in a difference in the render of your asset, so you may be required to export tangents in your file. - Break your asset into several files, one for mesh/textures/skeleton, one or more for animation data. While you might not see an overall reduction in size if the files are broken in to several, you won’t need to take the hit for downloading the entirety of your asset’s requirements at once. Load your mesh/textures/skeleton first and then load animations as you need them. This will get your user into your experience faster.
- Switch your mesh file to a gltf/glb file and use Draco Compression on the file. You will realize a significant savings on your mesh with the compression, which could make up for some of your animation data. Collapsing your modifier stack also should help save some size as well.
All of these are general suggestions, but your individual file will determine where and how you can save file size. Make sure you look for optimizations in your mesh, textures, and animations. For example, do you have more morph targets than you really need? For example, if you have viseme morph targets, do you have any that are really close to one another so that you only need one of them? Removing unneeded visemes and culling down to a smaller set could be a significant savings in animation.
I hope this gives you some direction as to where you could find optimizations, but feel free to ping back with more questions.
Thank you very much for your reply. But I’m sorry, in the process of verifying your statement and finding out the specific problems, I used a Model figure without animation to export from 3D Max to Babylon. The model has no empty objects and only contains a mesh, a material and a texture. The process of using the v20230606.4 version of the export plug-in to export is very time-consuming, and the Progress bar has not changed, even making people wonder whether the computer is stuck. The final size of the Babylon file generated using the v20230606.4 export plugin is 12.7MB, while the file size exported using v1.3.33 is 4.69MB. In addition, I also tried to delete the bones and animations in the 3D Max file with Skeletal animation before, and then re export it with v20230606.4. This file is the file whose size exceeded 300MB when it was last exported. The last version used was 2023.608.5. However, this time, the file size with Skeletal animation exported in v20230606.4 version reached 837MB, while the file size without animation was 887MB. Except for using version v1.3.33, the export time for other versions is very long.
@lang_l, I think to further debug at this point we would need a copy of one of the files that is resulting in size discrepancies on export to further diagnose the issue. If you send a DM to me with a link or zip and I can take a look.