3dsmax export to .gltf with tags


Hi everyone,

Not sure if I should post here or in the general question so please excuse me if you think this is not the right section.

I’m working on an architectural visualization tool and exporting my model from 3dsmax to gltf with the Babylon exporter. I’d like to use tags so I can easily find objects in Babylon.

I tagged a few objects in 3dsmax as “unit”. The 3d loads fine in Babylon but when I call scene.getMeshesByTags(“unit”); it returns an empty array.
I opened my gltf file and it seems like the tag is properly exported there on the objects I tagged: “extras”:{“tag”:“unit”}}.

I tried to create a box within babylonjs and tagged it with the addTags function. If I use getMeshesByTags after that it does find my box so I’m thinking there might be a problem with my gltf.

Has anyone tried to use tags with gltf from 3dsmax and did you run into any troubles?




pinging @kcoley (He will be back on monday so expect a bit of delay )


Hi @christopheC. Are you importing your glTF asset into Babylon.js and trying to filter on tags, or are you importing a .babylon asset. If the former, I am not sure if the glTF loader handles extras data as tags or not. @bghgary may be able to confirm this.
Have you tried importing a .babylon file to see if that works ?


@christopheC also do you have a sample max scene and/or generated glTF?


No, the loader does not load extras without user code. There is not a 1-to-1 mapping between the glTF hierarchy and Babylon, so this is up to the user to handle it in a loader extension. I can show how this is done in a playground if I can get an asset with tags.


Hi everyone,

Thanks for your quick reply!

@kcoley yes I’m importing my gltf into babylon.js and trying to filter on tags. I also thought that it could be a tag support issue from gltf vs babylon files but I also tried to export as babylon file format and didn’t have more luck.

@bghgary I was trying to put together an example in the playground but I can’t get the gltf to load my file in the playground. I think it’s a problem with the server I’m using to host my file… I need to look more into that.
Anyways, I have saved out a file with tags that you can use for testing purposes. It’s not the one I’m using in my project as it would be too big. There are 4 geometries in that file, two of them are tagged “Unit” and they are the ones I’d like to get with getMeshesByTags.
I saved it as gltf and babylon if you’d like to see the difference.




You can put the file on GitHub somewhere and then use the raw url to access it.


@christopheC looks like the exporter is exporting the tags as “tag” instead of “tags” in the babylon file, which is a bug. I’ll work on a fix for that.


@christopheC I just made a fix for 3ds Max on changing “tag” to “tags”.


Thanks @kcoley that was fast :slight_smile: I just gave it a try and it works fine on Babylon export.

Still doesn’t work on gltf/glb files but I’m guessing @bghgary might be able to help with that soon

I also managed to make a scene work in the playground using dropbox! https://www.babylonjs-playground.com/#8IMNBM#13


Here you go:



Perfect it works!

Thanks everyone I really appreciate your quick help!