How can I pick only specific parts of information from the Inspector tab?

Hi, I’m new to this website so please forgive me in advance if I’m violating any site rules and such.

I want to build a small website that will verify different parts of a GLTF file, and I’ve stumbled across babylon.js. What I’m envisioning is that I’m able to upload a .glb file to my site, and use Babylon.js to return information such as vertex count, material count, and details like that. In the sandbox I noticed that this information is present in the inspector tab, and my question is if I’m able to get that same information returned to me if I were able to reference a .glb object.

I’ve tried looking through the API, and it doesn’t necessarily seem like there is that functionality, but (since I’m new to this space) I wanted to throw this question out and maybe someone could have an idea on a library I could use to accomplish this if there isn’t a way to do this with Babylon.

Thanks in advance!

Welcome and honestly we do not have a lot besides being polite and respectful :slight_smile:

You can probably get inspired by the inspector code about meshes:
Babylon.js/meshPropertyGridComponent.tsx at master · BabylonJS/Babylon.js (github.com)

1 Like

Hello and welcome!

It is possible to get and use all information and values which are shown in the Inspector. Sometimes it is just a line of code, sometimes one needs to write a simple function.
As for the vertex count - here is the example: Babylon.js Playground
Material count is as simple as scene.materials.length

2 Likes

Thank you! And I certainly shall be, I will check this out for sure.

Thank you! I see how that works, I can’t believe I missed it!