GLTFExporter not exporting hidden objects

I have 4 meshes in a model out of which only 1 is visible at any moment. User can select which mesh to show.

Now when I export the model using GLTFExporter, the exported model only has the visible mesh in it.
Using the below option config:
Also, I have set onlyVisible to false.

What might be the issue here?

The snippet you’ve shared looks OK. You can see how GLTFExporter uses that option here:

I’m not sure why non-visible meshes would be missing from a scene when onlyVisible is false, is it possible to share a demo to recreate the problem?

Demo would be a bit difficult to share

if the visible property is a SkinnedMesh, does onlyVisible supports that?
Because in my case it is a SkinnedMesh

I can’t see any reason it wouldn’t support that, the code check above is pretty simple. :confused:

Yeah so at any instant, out of 4 skinnedMesh only one is visible.

Also, as input I am passing the scene from the GLTFLoader

If the input to GLTFExporter is coming from a glTF file, would you be able to share that file?

yeah sure, in this if you see under jackets_options, you’ll see SkinnedMesh
One of them needs to be visible false

model__.glb (4.9 MB)

I don’t seem to be getting the same result, it exports the hidden objects OK for me. Do you mind sharing more code, perhaps the part where you call the exporter? Expected usage would be something like this:

const options = { onlyVisible: false };

	function ( result ) {

		// ...

	function ( error ) {

		console.log( 'An error happened during parsing', error );