Can I add a separate export texture?We need to increase this demand
What happens if your set the parsing option embedImages
to false
? Check out the documentation for more details?
https://threejs.org/docs/index.html?q=gltfex#examples/en/exporters/GLTFExporter.parse
This example does not save the texture separately. Save the texture separately to the picture, which is convenient for me to modify the picture
When embedImages
is false the exporter should just put the filename of the image (e.g. baseColor.png
) into the glTF file. Saving the image to disk would need to be done in your code.
Isn’t that troublesome
My recommendation would be to export a GLB and unpack it after export.
If you’d prefer to create something that exports a ZIP, or some other representation of multiple files, you can always modify GLTFExporter.js to do so.
Example:
import { WebIO } from '@gltf-transform/core';
const io = new WebIO();
const exporter = new THREE.GLTFExporter();
exporter.parse(scene, (buffer) => {
const json = io.binaryToJSON(buffer);
console.log(json.resources);
}, {binary: true});
Thank you. It seems that it still needs to be realized with the help of external programs