# Button show/hide for glb files

**URL:** <https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220>\
**Category:** Questions\
**Created:** [July 1, 2019, 6:53am UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220 "2019-07-01T06:53:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![swavec](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@swavec](https://forum.babylonjs.com/u/swavec)\
**Post date:** [July 1, 2019, 6:53am UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/1 "2019-07-01T06:53:47Z")

</div>

HI  
Any one know why this button dont work for glb files?  
If i swich my mesh format to pietro.babylon it is working but pietro.glb work only for “hide” function.

////////////////////  
BABYLON.SceneLoader.ImportMesh("", “./”, “pietro.glb”, scene, function (myMeshesTwo) {

//////////////////

var b\_pietro = document.createElement(‘buttons’);  
b\_pietro.id = “pietro”;  
b\_pietro.textContent = “Pietro”;  
buttonbox.appendChild(b\_pietro);  
b\_pietro.onclick = function() {  
// Show/Hide myMeshTwo  
for (mesh of myMeshesTwo)  
mesh.setEnabled((mesh.isEnabled() ? false : true));  
}

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 1, 2019, 4:35pm UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/3 "2019-07-01T16:35:54Z")

</div>

Can you share a repro somewhere? maybe on the playground if possible?

---

<div class="post-metadata">

**Author:** ![swavec](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@swavec](https://forum.babylonjs.com/u/swavec)\
**Post date:** [July 2, 2019, 4:23am UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/4 "2019-07-02T04:23:25Z")

</div>

Hi  
Here is my scene im working on. All thre meshes are glb files that i cant unhide:  
[http://slawekbiela.pl/wp-content/themes/twentyfifteen-child/web3d/web3d.php](http://slawekbiela.pl/wp-content/themes/twentyfifteen-child/web3d/web3d.php)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 2, 2019, 4:10pm UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/5 "2019-07-02T16:10:43Z")

</div>

You are using different versions for the loader and the engine

They should all come either from cdn or from preview but not a mix

---

<div class="post-metadata">

**Author:** ![swavec](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@swavec](https://forum.babylonjs.com/u/swavec)\
**Post date:** [July 3, 2019, 6:27am UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/6 "2019-07-03T06:27:43Z")

</div>

Made some changes but still no luck.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 3, 2019, 12:21pm UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/7 "2019-07-03T12:21:52Z")

</div>

As @Deltakosh already said a repro in the playground will be most appreciated as it is really hard to debug without it ?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 3, 2019, 12:29pm UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/8 "2019-07-03T12:29:14Z")

</div>

At a first glance it looks like you are enabling from children to parent which might be the issue, the repro would help quite a lot

---

<div class="post-metadata">

**Author:** ![swavec](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@swavec](https://forum.babylonjs.com/u/swavec)\
**Post date:** [July 3, 2019, 2:47pm UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/9 "2019-07-03T14:47:51Z")

</div>

HI  
Here is my scene in playground:  
[https://www.babylonjs-playground.com/#8V8L47#1](https://www.babylonjs-playground.com/#8V8L47#1)

but not working , no meshes, no buttons

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [July 3, 2019, 4:27pm UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/10 "2019-07-03T16:27:54Z")

</div>

There are a number of issues in your playground which I have corrected here [https://www.babylonjs-playground.com/#8V8L47#2](https://www.babylonjs-playground.com/#8V8L47#2)

The major one is that you cannot load files from http in the playground you have to deliver from a http **s** server. I have used available glb files from here [Available Textures in the Playground - Babylon.js Documentation](https://doc.babylonjs.com/resources/playground_textures) to test the logic.

Also used a viewable 360 image from the same source.

Using

```javascript
mesh.setEnabled((mesh.isEnabled() ? false : true));

```

seems to always sets enabled to false so I have changed the logic.

Also I have removed code that is not needed in a playground from the start and end and tidied up the line spacing to make it more readable for other.

Good luck with your project.

---

<div class="post-metadata">

**Author:** ![swavec](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@swavec](https://forum.babylonjs.com/u/swavec)\
**Post date:** [July 4, 2019, 5:34am UTC](https://forum.babylonjs.com/t/button-show-hide-for-glb-files/4220/11 "2019-07-04T05:34:23Z")

</div>

Perfect. Thank you so much.
