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.

Append and Unload GLTFs using one pulldown.

Home Forums Puzzles Append and Unload GLTFs using one pulldown.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #65850
    calbrecht
    Customer

    Hi,

    I’m trying to append/unload GLTFs using the same input field type pulldown. The behavior would be that when I make a selection in my pulldown it appends the related gltf, then if I select a different option in my pulldown it then unloads the current option and appends the new one to my parent scene.

    If I look into the example you have Load Unload it uses one button to append and another to unload.
    Do you have a puzzle example where you use one pulldown to append/unload gltfs?

    Thanks,
    Cris

    #65855
    mashud008
    Customer

    Please check the Scenes panel, and here is the load/ unload puzzle. Follow the puzzle scene example and load/unload the demo file.

    Scene manual

    #65860
    kdv
    Participant

    I’m trying to append/unload GLTFs using the same input field type pulldown


    https://v3d.net/adf

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #65889
    mashud008
    Customer

    on an event “click” and add the element “button_add”

    #65967
    calbrecht
    Customer

    Thanks for the feedback, but I should probably be a little more clear.
    See the puzzle I have (attached), this works for looping through my pulldown options and appending the gltf. Now, what I don’t know is how to unload the current gltf and append the new one using the very same pulldown.

    As you can see in the screenshot it loops through and checks if the gltf is loaded or not. I have the flag ‘false’ or ‘true’ and it is conditionally set.
    What I’m looking for is to if not in the scene load the gltf, then unload when another one was selected.
    I hope this is a little more comprehensive now!
    Thanks for the help.
    Cris

    Attachments:
    You must be logged in to view attached files.
    #65969
    kdv
    Participant

    Absolutely senseless and useless condition.

    With the empty text field it always returns “true” (the main scene app.scene is always loaded). “Else” will never be perfomed.

    Within one condition you are trying either append or load (will never be loaded) the same .gltf file. So it’s really hard to understand what you reaaly want do do. Do you want it to be appended to the current main scene or do you want it to be the main scene? For the first case puzzles are above, in the second case there is no need to unload the current scene (it will be replaced automatically).

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #65971
    calbrecht
    Customer

    Thank you Kdv, I got it!
    I want to append GLTFs to main main scene, not to replace everything.
    I will make few adjustments and test, will let you know if I’m good or still need some guidance.
    Thanks again

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