the mesh node94 should be named XA_Sweat_01, but it is now a TransformNode
I don’t want this,because I feel trouble, such as when I want to operate mesh, I must first use scene. getTransfromNodeByName (’ xxx '). getChildMeshs (), but I will have to use gltf-transform, because I’m in the mobile terminal, the model should be as small as possible!!!
Most of the commands which are used in optimize command of GLTF-Transform, may change node hierarchy in GLTF/GLB files.
It is hard to say without the model which command you should omit in order to keep the node hierarchy the same. Try to exclude dedup and instance commands and see what will happen (I guess it is instance). In other words, do not use optimize for your file, use separate commands and see what breaks your file herarchy.
One may also perform a quick check (include/exclude some commands, for example) with my online tool (based partially on GLTF-Transform) - https://glb.babylonpress.org/
I can’t seem to live without meshopt because it has so many optimizations!!!
The only trouble is bad code maintenance later, if change for others, they don’t know meshopt, may need to change a lot of code, inside the code with a lot of scene.gtTransformNodeByName.
I tried Draco compression earlier with threejs, but some iphones had problems, Android was fine, so I gave up Draco compression
There is the glb model,It has some drawbacks!!!
myglb
My final idea is to compress resources as losslessly as possible, such as using meshopt, and I can also accept adding TransformNodes
If Draco is not an option for you and there are some transform nodes after meshopt - you can use scene. getNodeByName() to use the same names as before optimization.
Or, since optimized files are the final ones to be used in production, just use their node hierachy to access relevant meshes/transform nodes.
Well done, but why did I export the model with 435kb according to your configuration? The one you gave me is only 289kb. For the picture, I chose ktx2/ETC1S, whose size is 512 and setting is the same as yours. Why is mine 150kb larger? Did I miss something somewhere?
The file was additionally meshopted through GLTF-Transform CLI interface.
You will achieve the same results using only CLI when using the same commands + meshopt at the end.
Ask more questions if you have any!
Hello,
There is a lot of compression options related to textures and geometry as well.
First of all, I would recommend to disable geometry optimization and texture resize and see if results will be satisfying enough with only webp conversion.
At least, try to disable geometry opts by default (uncheck everything checked except dedup):