We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Accessing Object Within glb or gLTF

Home Forums Programming Accessing Object Within glb or gLTF

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #13583
    anomalyproductions1
    Participant

    Hi there,

    I’ve been having great luck appending glb scenes to my project that is already running on the web, but how to I access the individual models of the glb file, once it’s been loaded? Do I parse the data outside of the puzzle editor?

    Best. :)

    #13584
    anomalyproductions1
    Participant

    Just to add some more context, I’d like to maybe see the name of a model appear on a div element once it’s been loaded, or get a notification of some kind.

    #13594

    Object names in the exported files are basically the same as in the source .blend or .max file.

    Chief 3D Verger | LinkedIn | Twitter

    #13602
    anomalyproductions1
    Participant

    Thanks for getting back to me! I guess my question is, how can I access glb or gLTF nodes within Verge3D so that I can dynamically fetch names after the file has been uploaded.

    #13603

    This can be done with some programming. First, you need to obtain the loaded scene:

    var scene = app.scene.getObjectByName("path/to/your/scene");

    Then, you can search for objects in your scene as usual:

    
    var objNameList = [];
    scene.traverse(function(obj) {
        objNameList.push(obj.name)
    });

    Chief 3D Verger | LinkedIn | Twitter

    #13605
    anomalyproductions1
    Participant

    traversing the app scene is working! last question, and it’s a silly one. How can I get a URL from the newly loaded file? I only ever see base64.

    Thanks again for your time, it’s greatly appreciated :)

    #13606

    it is accessible via scene.name

    Chief 3D Verger | LinkedIn | Twitter

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.