Loads GLTF of humanoids, e.g. from this collection. Reparents nodes with meshes to the root. Rigs the meshes based on original hierarchy. Replaces skeleton with MSquared one. Optionally merges meshes into a single one with texture atlasing.
In the result, we get a small GLB (99%+ size reduction), with one mesh and two textures (albedo, emissive), and simplified MSquared skin, so UE5 animations can be applied on it.
WebGL demo: https://playcanv.as/e/b/bb92b862
npm install
node tool.js --file ./path/to/file.gltf --output ./path/to/output.glb --merge
Print possible options.
GLB/GLTF file to convert.
A path for output GLB.
Default false.
If enabled, then all meshes will be merged into a single one. All textures will be merged into an Atlases based on slots: base, emissive.
Default false.
Print resulting GLBs structure: scenes, meshes, materials, textures.
Default false. If set, then console logs will be only errors.
To get models from OpenSea, you need to:
- Find desired model from the collection
- In the top right corner, hit three dots and select "View Original Media"
- New tab will have url like: "https://www.sandbox.game/model-viewer-light/?assetId=79610d33-3b3c-45a5-9d39-9d93d6774991", copy assetId
- Then open new tab with link: https://public-assets.sandbox.game/assets/ASSET_ID/gltf replace "ASSET_ID", e.g.: https://public-assets.sandbox.game/assets/79610d33-3b3c-45a5-9d39-9d93d6774991/gltf