#Exporting GLTF via Codec not including texture when using .compile(), if I prompt .export() it works

3 messages · Page 1 of 1 (latest)

cold bramble
#

#bb-plugin-dev-old message <-- this sounds exactly like what's happening to me.

@runic pagoda, i know that's a 4 year old post, but hopefully you remember the solution?

I'm loading a Bedrock model, texture, and bedrock animations into a new project using a plugin.

I then grab the GLTF codec, and if I just call

Codecs.gltf.export(), I get the export prompt and it works perfectly (gltf file has animations & texture).

I'm trying to save this to a file without having to go through the dialogue, currently like this:

        const result = await Codecs.gltf.compile()


        Blockbench.writeFile(outputPath, {
          content: result,
          savetype: 'buffer'
        })

But doing so doesn't export the texture.

#

I am adding the texture to the project like this:

        const tex = new Texture().fromPath(texturePath)
        await tex.load()
        Project.textures.push(tex)
cold bramble
#

bump 👀