I could previously select my meshes and have the highlight layer working when I had a glb file import. The glb file however had issues with 2 meshes per object which created further complexities.
The Babylon file now has the objects as I need them, as a single mesh but I can’t seem to be able to select the objects/meshes now. Could someone help please? There are no errors in the code from de-bugging but I’m still learning Babylon.JS.
The .babylon format saves all information about the scene, and these meshes had
isPickable set to false:
You can just set isPickable to true again when loading Test fresh fruits highlight | Babylon.js Playground (babylonjs.com)
Thanks for pointing that out, I didn’t know that was an option in the popout tabs.
Slight build on this issue if anyone could help please @carolhmj, @Blake or other
I’ve added a few other buildings in of the same type and it either doesn’t let me select the building or it highlights two when i pick one building. I thought this issue might be resolved since I baked the meshes into one and have just the one object (this was a previous issue I had).
For performance reasons, when coming from Blender, use the
Pickable custom property checkbox. The default for the Blender exporter is switched to off.
If every mesh is pickable & you have a lot of them, this can slow the system, especially for XR when you wish to used multiple controllers for picking.
While doing it in inspector and saving works, there are 2 downsides to doing it there:
- If you make changes in Blender, then you will have to do it again.
- The file generated will be massively bigger. For numbers, the file is all numbers, the precision is the maximum supported by your system. The exporter reduces these, but you can control this by datatype:
The blender exporter is designed maximum performance.
Gotcha, I see that now with https://playground.babylonjs.com/#9Z476P#43 which includes the pickable mesh option in Blender. When I take out the ‘make mesh’s pickable’ it still works so thanks for the heads up on that.
Also, you should probably
Freeze World Matrix, right before the
Pickable check. Houses do not generally move, rotate, or scale. This is another performance thing the exporter does, so you do not have to optimize your scene. It just comes out that way.